Settings, values, commands and messaging structures.
Settings, values, commands and messages are determined by the settings.json structure, that is parsed in build time to several .h and .c files, as described below.
It contains the following main fields:
fw_version
major
minor
hardware
type - firmware type, for example "wisentedge_nrf52840"
version
settings
port - port on which settings are sent and received from
type - settings type, based on tracker type
commands
port - port on which commands are sent and received from
commands of the form:
values
port - port on which settings are sent and received from
values of the form:
messages
messages of the form:
message_name
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
All auto-generated files are equipped with /* AUTOGENERATED FILE - DO NOT MODIFY! */ comment. Sections below describe content of each generated file and helping files.
major
minor
setting of the form:
setting_name
id - for "basic settings" from 0x01 to 0x0F, for "advanced" from 0x11 to 0x9F
enabled - true or false
default - default value
min - min value
max - max value
length - in bytes
conversion - data type, possible options:
uint8, uint16, uint32, int8, int16, int32
float
command_name
id - from 0xA1 to 0xCF
length - length of send command value, if 0 none
conversion - data type of send value, if there is non uint8 is used
value - default value, 0 if none
value_name
id - from 0xD1 to 0xEF
enabled - true or false
default - default value
min - min value
max - max value
length - in bytes
conversion - data type, possible options:
uint8, uint16, uint32, int8, int16, int32
float
port - to send message on
id - from 0xF1 to 0xFF
length - in bytes
conversion - data type, possible options:
uint8, uint16, uint32, int8, int16, int32
float
byte_array
bool
commands_def.h and commands_def.c - commands defines and settingsvalues_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
bool
bool