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.
Returns data type for setting with specified ID.
Returns value struct based on setting ID.
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
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.
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.
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.
Most files, containing settings, values, commands and messages data and forms are auto-generated at build time, as they depend on Settings.json file and are dependent on specific tracker type.
Python parser py2h.py
and validation script validate_data.py
are used to convert settings.json
file to c files.
In particular the following files are generated:
hardware_def.h
- containing only definitions from "hardware" field
settings_def.h
and settings_def.c
- containing settings structure and auto-generated functions for access and writing to structure
commands_def.h
and commands_def.c
- commands defines and settings
values_def.h
and values_def.c
- containing main values structure and auto-generated functions for access and writing to structure
messages_def.h
and messages_def.c
- message defines and messages
All auto-generated files are equipped with /* AUTOGENERATED FILE - DO NOT MODIFY! */
comment. Sections below describe content of each generated file and helping files.
Auto-generated files commands_def.h and commands_def.c containing all commands defined in settings.json file.
Auto-generated files messages_def.h and messages_def.c containing all message forms as defined in settings.json file.
Auto-generated defines for all messages ID-s. Based on message ID, appropriate message is composed and returend in firmware. All defines are of the form MSG_XXX_ID
.
main_messages
struct is auto-generated to contain all messages of cmd_message
struct type as defined in settings.json file. In addition to message structs containing different message forms, it contains:
n_values - number of values
messages_id - array containing all messages ids
messages_length - array containing all messages lengths
messages_port - array containing all port numbers on which message is sent
Main_messages
is global main_messages
struct, accessible in all threads and modules that contains all defined message types.
Auto-generated files values_def.h and values_def.c containing all values defined in settings.json file and functions for getting and setting values.
main_values
struct is auto-generated to contain all values as defined in settings.json file. In addition to value structs containing settings, it contains:
n_values - number of values
values_id - array containing all values ids
values_length - array containing all values lengths
Values are defined using same values structs as are used for settings and defined in settings_types.h
.
Main_values
is global main_values
struct, accessible in all threads and modules that contains all tracker functionality values.
Values_settings
is global values_settings
struct , accessible in all threads and modules that contains settings for receiving and sending values.
void *get_value_struct_by_id(uint8_t id)
- returns value struct, provided ID of value.
int get_value_by_id(uint8_t id, uint8_t *data)
- returns value from the value struct, provided ID of value.
int set_value_by_id(uint8_t id, uint8_t *data, uint8_t len)
- sets value, provided value id, new value in form of a byte array and its length. Function returns 0 if ok and -1 if error in provided length.
For all values defined in settings.json, structs of appropriate type are auto-generated and initialised with provided data. Main_values
struct is initialised with generated values structures.
Described functions definitions are auto-generated.