Read logged history
Lifecycle: Beta. Last updated 2020-12-10
The log read is initiated by central which requests for the type of data and time range of the logs. The log is read with command that has a header destination set to physical quantity being read, source to any and type as a log read. The payload is two 32-bit timestamps, seconds since unix epoch. First timestamp is current time, and second time is the lower bound of log data timestamps. For example if the timestamps are 1567047917 and 1566047917 data from time between 2019-08-13 13:18 and 2019-08-29 03:05 is sent.
The logs are sent in format where header destination is the source of read command, source is the physical quantity and type is log write. Payload is 4 bytes of timestamp and 4 bytes of value. Interpretation of value depends on the type of data, possible types are listed below.
When the log buffer is sent and no more data remains, a special message with the entire payload set to 0xFF is sent. It should be noted that there is no way to send only “missing sections” of data from the middle of the logs, logs are always retrieved to the end of the stored data.
File below is abbreviated nRF Connect log with some heartbeat transmissions and clutter removed. Log read command was added manually
If log read takes over 5 minutes, the tag assumes that it has encourtered an internal error and will send error message with header type
0xF0and payload set to
0x 30 30 F0 FF FF FF FF FF FF FF FF. It's safe to resume log read by sending a repeated log read command with start timestamp at the last received element.