The Logger ALP is a M2ALP that is reserved by the DASH7 Mode 2 spec but defined by OpenTag. It is used chiefly as a method for reporting data (logging) from OpenTag to a client. Thus, it is much like the ubiquitous “printf,” although, by virtue of the M2ALP data format, it may support more output variants than printf does presently. All current, supported output variants are quite simplistic, though.
Logger ALP data should follow the basic M2ALP structure. Below is what a Logger ALP header should look like.
|M2ALP Header for Logger|
|Flags||Record Length||ALP ID||ALP Command||ALP Payload|
|1 Byte||1 Byte||1 Byte||1 Byte||N-4 Bytes|
|(normal usage)||(N)||0x04||(0x00-12)||(see below)|
At present, the logger supports two basic output formats: unstructured and message.
|Cmd ID||Type of Payload|
|0x00||Binary Unstructured Data|
|0x01||ASCII Unstructured Data|
|0x02||Unicode Unstructured Data|
|0x10||Message with Binary Data|
|0x11||Message with ASCII Data|
|0x12||Message with Unicode Data|
As mentioned earlier, there are two currently-defined command types for the Logger ALP, Unstructured and Message.
The unstructured payload is just N-4 bytes of data of a certain data type (N being the value transmitted in Record Length). The data types are corresponding to the Command ID, namely: raw binary, ASCII, Unicode.
The message payload is an unstructured block that is preceded by an ASCII text block (space delimited). Here is an example:
Message_block ASCII TEXT BLOCK. The message block must not contain any spaces (character 32 / 0x20), because the space character is the delimiter between the message block and the unstructured block.