Configuration file format
The file is in standard JSON format. The decoder parses the JSON and validates that it is correct, e.g. no missing commas, no comments etc. Then, it parses the configuration and stores it internally. The configuration must adhere to some rules, which are detailed below.
There are 5 main sections in the JSON document:
DecoderOptions
TypeDefinitions
PacketHeader (optional)
MessageHeader (optional)
Messages (mandatory if a field with msg_type flag is defined).
Type and Field Naming Conventions
Type names and field names should be replicated from the source specification where possible. If new types are added to help implement the decode, then they should adhere to some standard, i.e. all lowercase or all uppercase. Consistency within the same JSON file is important for future maintenance.
Flags
Flags are used to enable the behaviour of some fields. For example, use a msg_type flag to tell the ACD decoder which field represents a msg_type, so that it can decode the correct message definition. If no msg_type flag is enabled, then message definitions will not be decoded.
Flags are specifed using the JSON key "flags" and are defined as an array of strings. [ "msg_type", "blah" ]. Not all protocols have a Message Type; however, for protocols that do, you must specify the msg_type flag on a "field" definition. This enables the ACD to identify the message type field and then decode the correct message definition.