Settings JSON
Settings, values, commands and messaging structures.
settings.json
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
major
minor
settings
port - port on which settings are sent and received from
type - settings type, based on tracker type
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
byte_array
bool
commands
port - port on which commands are sent and received from
commands of the form:
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
values
port - port on which settings are sent and received from
values of the form:
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
byte_array
bool
messages
messages of the form:
message_name
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
Python parser
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" fieldsettings_def.h
andsettings_def.c
- containing settings structure and auto-generated functions for access and writing to structurecommands_def.h
andcommands_def.c
- commands defines and settingsvalues_def.h
andvalues_def.c
- containing main values structure and auto-generated functions for access and writing to structuremessages_def.h
andmessages_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.
Last updated