Settings def
Auto-generated files settings_def.h and settings_def.c containing all settings defined in settings.json file and functions for getting and setting values.
settings_def.h
Defines
SETTING_TYPE(_id) TYPE_##_id
Returns data type for setting with specified ID.
SETTINGS_STRUCT(_id) STRUCT_##_id
Returns value struct based on setting ID.
Main settings
main_settings
struct is auto-generated to contain all settings as defined in settings.json file. In addition to value structs containing settings, it contains:
n_settings - number of settings
settings_id - array containing all settings ids
settings_length - array containing all settings lengths
Global variables
Main_settings
is global main_settings
struct, accessible in all threads and modules that contains all settings data.
Settings_defines
is global settings_defines
struct , accessible in all threads and modules that contains settings for receiving and sending settings.
Functions
void *get_setting_struct_by_id(uint8_t id)
- returns setting value, provided ID of setting.
int set_setting_value_by_id(uint8_t id, uint8_t *data, uint8_t len)
- sets value of setting, provided setting id, new value in form of a byte array and its length. Function returns 0 if ok and -1 if error in provided length.
settings_def.c
For all settings defined in settings.json, structs of appropriate type are auto-generated and initialised with provided data. Main_settings
struct is initialised with generated setting structures.
Described functions definitions are auto-generated.
Last updated