Values def

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.

values_def.h

Main 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.

Global variables

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.

Functions

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.

values_def.c

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.

Last updated