NHS31xx msg - Message Handler Protocol
'tlogger' app.spec. messages

Detailed Description

This file describes the application specific commands and responses used in the Temperature Logger demo application.

Data Structures

struct  APP_MSG_CMD_GETMEASUREMENTS_T
 
struct  APP_MSG_CMD_SETCONFIG_T
 
struct  APP_MSG_CMD_MEASURETEMPERATURE_T
 
struct  APP_MSG_CMD_GETEVENTS_T
 
struct  APP_MSG_CMD_GETPERIODICDATA_T
 
struct  APP_MSG_RESPONSE_GETMEASUREMENTS_T
 
struct  APP_MSG_RESPONSE_GETCONFIG_T
 
struct  APP_MSG_RESPONSE_MEASURETEMPERATURE_T
 
struct  APP_MSG_RESPONSE_GETEVENTS_T
 
struct  APP_MSG_RESPONSE_GETPERIODICDATA_T
 

Macros

#define APP_MSG_ERR_TSEN   0x1000E
 
#define APP_MSG_MIN_TEMPERATURE   -400
 
#define APP_MSG_MAX_TEMPERATURE   850
 
#define APP_MSG_TEMPERATURE_PLACEHOLDER_VALUE   (APP_MSG_MAX_TEMPERATURE + 1)
 
#define APP_MSG_DELAY_START_INDEFINITELY   0xFFFFFFFF
 
#define APP_MSG_MAX_TEMPERATURE_VALUES_IN_RESPONSE   232
 
#define APP_MSG_SIZEOFEVENT_IN_RESPONSE(info, data)
 
#define APP_MSG_MAX_EVENTS_IN_RESPONSE(size)   (505 / (size))
 

Enumerations

enum  APP_MSG_ID_T {
  APP_MSG_ID_GETMEASUREMENTS = 0x46,
  APP_MSG_ID_GETCONFIG = 0x48,
  APP_MSG_ID_SETCONFIG = 0x49,
  APP_MSG_ID_MEASURETEMPERATURE = 0x50,
  APP_MSG_ID_START = 0x5A,
  APP_MSG_ID_GETEVENTS = 0x5B,
  APP_MSG_ID_GETPERIODICDATA = 0x5E,
  APP_MSG_ID_COUNT = 7,
  APP_MSG_ID_GETMEASUREMENTS = 0x46,
  APP_MSG_ID_GETCONFIG = 0x48,
  APP_MSG_ID_SETCONFIG = 0x49,
  APP_MSG_ID_MEASURETEMPERATURE = 0x50,
  APP_MSG_ID_START = 0x5A,
  APP_MSG_ID_GETEVENTS = 0x5B,
  APP_MSG_ID_GETACCELCONFIG = 0x5C,
  APP_MSG_ID_SETACCELCONFIG = 0x5D,
  APP_MSG_ID_GETPERIODICDATA = 0x5E,
  APP_MSG_ID_COUNT = 9,
  APP_MSG_ID_GETMEASUREMENTS = 0x46,
  APP_MSG_ID_GETCONFIG = 0x48,
  APP_MSG_ID_SETCONFIG = 0x49,
  APP_MSG_ID_MEASURETEMPERATURE = 0x50,
  APP_MSG_ID_START = 0x5A,
  APP_MSG_ID_GETEVENTS = 0x5B,
  APP_MSG_ID_GETACCELCONFIG = 0x5C,
  APP_MSG_ID_SETACCELCONFIG = 0x5D,
  APP_MSG_ID_GETPERIODICDATA = 0x5E,
  APP_MSG_ID_GETHUMIDITYCONFIG = 0x5F,
  APP_MSG_ID_SETHUMIDITYCONFIG = 0x60,
  APP_MSG_ID_COUNT = 11,
  APP_MSG_ID_SETURL = 0x71,
  APP_MSG_ID_SETOFFSET = 0x72,
  APP_MSG_ID_SETRESOLUTION = 0x73,
  APP_MSG_ID_SETUNIT = 0x74,
  APP_MSG_ID_SETKEY = 0x75,
  APP_MSG_ID_LOCK = 0x77,
  APP_MSG_ID_SETCONFIG = 0x78,
  APP_MSG_ID_GETCONFIG = 0x79
}
 
enum  APP_MSG_EVENT_T {
  APP_MSG_EVENT_PRISTINE = 1 << 0,
  APP_MSG_EVENT_CONFIGURED = 1 << 1,
  APP_MSG_EVENT_STARTING = 1 << 2,
  APP_MSG_EVENT_LOGGING = 1 << 3,
  APP_MSG_EVENT_STOPPED = 1 << 4,
  APP_MSG_EVENT_TEMPERATURE_TOO_HIGH = 1 << 5,
  APP_MSG_EVENT_TEMPERATURE_TOO_LOW = 1 << 6,
  APP_MSG_EVENT_BOD = 1 << 7,
  APP_MSG_EVENT_FULL = 1 << 8,
  APP_MSG_EVENT_EXPIRED = 1 << 9,
  APP_MSG_EVENT_I2C_ERROR = 1 << 10,
  APP_MSG_EVENT_SPI_ERROR = 1 << 11,
  APP_MSG_EVENT_SHOCK = 1 << 12,
  APP_MSG_EVENT_SHAKE = 1 << 13,
  APP_MSG_EVENT_VIBRATION = 1 << 14,
  APP_MSG_EVENT_TILT = 1 << 15,
  APP_MSG_EVENT_SHOCK_CONFIGURED = 1 << 16,
  APP_MSG_EVENT_SHAKE_CONFIGURED = 1 << 17,
  APP_MSG_EVENT_VIBRATION_CONFIGURED = 1 << 18,
  APP_MSG_EVENT_TILT_CONFIGURED = 1 << 19,
  APP_MSG_EVENT_HUMIDITY_CONFIGURED = 1 << 20,
  APP_MSG_EVENT_HUMIDITY_TOO_HIGH = 1 << 21,
  APP_MSG_EVENT_HUMIDITY_TOO_LOW = 1 << 22,
  APP_MSG_EVENT_COUNT = 23,
  APP_MSG_EVENT_ALL = (1 << APP_MSG_EVENT_COUNT) - 1,
  APP_MSG_EVENT_PRISTINE = 1 << 0,
  APP_MSG_EVENT_CONFIGURED = 1 << 1,
  APP_MSG_EVENT_STARTING = 1 << 2,
  APP_MSG_EVENT_LOGGING = 1 << 3,
  APP_MSG_EVENT_STOPPED = 1 << 4,
  APP_MSG_EVENT_TEMPERATURE_TOO_HIGH = 1 << 5,
  APP_MSG_EVENT_TEMPERATURE_TOO_LOW = 1 << 6,
  APP_MSG_EVENT_BOD = 1 << 7,
  APP_MSG_EVENT_FULL = 1 << 8,
  APP_MSG_EVENT_EXPIRED = 1 << 9,
  APP_MSG_EVENT_I2C_ERROR = 1 << 10,
  APP_MSG_EVENT_SPI_ERROR = 1 << 11,
  APP_MSG_EVENT_SHOCK = 1 << 12,
  APP_MSG_EVENT_SHAKE = 1 << 13,
  APP_MSG_EVENT_VIBRATION = 1 << 14,
  APP_MSG_EVENT_TILT = 1 << 15,
  APP_MSG_EVENT_SHOCK_CONFIGURED = 1 << 16,
  APP_MSG_EVENT_SHAKE_CONFIGURED = 1 << 17,
  APP_MSG_EVENT_VIBRATION_CONFIGURED = 1 << 18,
  APP_MSG_EVENT_TILT_CONFIGURED = 1 << 19,
  APP_MSG_EVENT_HUMIDITY_CONFIGURED = 1 << 20,
  APP_MSG_EVENT_HUMIDITY_TOO_HIGH = 1 << 21,
  APP_MSG_EVENT_HUMIDITY_TOO_LOW = 1 << 22,
  APP_MSG_EVENT_COUNT = 23,
  APP_MSG_EVENT_ALL = (1 << APP_MSG_EVENT_COUNT) - 1,
  APP_MSG_EVENT_PRISTINE = 1 << 0,
  APP_MSG_EVENT_CONFIGURED = 1 << 1,
  APP_MSG_EVENT_STARTING = 1 << 2,
  APP_MSG_EVENT_LOGGING = 1 << 3,
  APP_MSG_EVENT_STOPPED = 1 << 4,
  APP_MSG_EVENT_TEMPERATURE_TOO_HIGH = 1 << 5,
  APP_MSG_EVENT_TEMPERATURE_TOO_LOW = 1 << 6,
  APP_MSG_EVENT_BOD = 1 << 7,
  APP_MSG_EVENT_FULL = 1 << 8,
  APP_MSG_EVENT_EXPIRED = 1 << 9,
  APP_MSG_EVENT_I2C_ERROR = 1 << 10,
  APP_MSG_EVENT_SPI_ERROR = 1 << 11,
  APP_MSG_EVENT_SHOCK = 1 << 12,
  APP_MSG_EVENT_SHAKE = 1 << 13,
  APP_MSG_EVENT_VIBRATION = 1 << 14,
  APP_MSG_EVENT_TILT = 1 << 15,
  APP_MSG_EVENT_SHOCK_CONFIGURED = 1 << 16,
  APP_MSG_EVENT_SHAKE_CONFIGURED = 1 << 17,
  APP_MSG_EVENT_VIBRATION_CONFIGURED = 1 << 18,
  APP_MSG_EVENT_TILT_CONFIGURED = 1 << 19,
  APP_MSG_EVENT_HUMIDITY_CONFIGURED = 1 << 20,
  APP_MSG_EVENT_HUMIDITY_TOO_HIGH = 1 << 21,
  APP_MSG_EVENT_HUMIDITY_TOO_LOW = 1 << 22,
  APP_MSG_EVENT_COUNT = 23,
  APP_MSG_EVENT_ALL = (1 << APP_MSG_EVENT_COUNT) - 1
}
 
enum  EVENT_INFO_T {
  EVENT_INFO_INDEX = 1 << 0,
  EVENT_INFO_TIMESTAMP = 1 << 1,
  EVENT_INFO_ENUM = 1 << 2,
  EVENT_INFO_DATA = 1 << 3,
  EVENT_INFO_COUNT = 4,
  EVENT_INFO_NONE = 0,
  EVENT_INFO_ALL = EVENT_INFO_INDEX | EVENT_INFO_TIMESTAMP | EVENT_INFO_ENUM | EVENT_INFO_DATA,
  EVENT_INFO_MORE = 1 << 7,
  EVENT_INFO_INDEX = 1 << 0,
  EVENT_INFO_TIMESTAMP = 1 << 1,
  EVENT_INFO_ENUM = 1 << 2,
  EVENT_INFO_DATA = 1 << 3,
  EVENT_INFO_COUNT = 4,
  EVENT_INFO_NONE = 0,
  EVENT_INFO_ALL = EVENT_INFO_INDEX | EVENT_INFO_TIMESTAMP | EVENT_INFO_ENUM | EVENT_INFO_DATA,
  EVENT_INFO_MORE = 1 << 7,
  EVENT_INFO_INDEX = 1 << 0,
  EVENT_INFO_TIMESTAMP = 1 << 1,
  EVENT_INFO_ENUM = 1 << 2,
  EVENT_INFO_DATA = 1 << 3,
  EVENT_INFO_COUNT = 4,
  EVENT_INFO_NONE = 0,
  EVENT_INFO_ALL = EVENT_INFO_INDEX | EVENT_INFO_TIMESTAMP | EVENT_INFO_ENUM | EVENT_INFO_DATA,
  EVENT_INFO_MORE = 1 << 7
}
 
enum  APP_MSG_PERIODICDATA_TYPE_T {
  APP_MSG_PERIODICDATA_TYPE_TEMPERATURE = 0x01,
  APP_MSG_PERIODICDATA_TYPE_HUMIDITY = 0x02,
  APP_MSG_PERIODICDATA_TYPE_COUNT = 2,
  APP_MSG_PERIODICDATA_TYPE_ALL = APP_MSG_PERIODICDATA_TYPE_TEMPERATURE | APP_MSG_PERIODICDATA_TYPE_HUMIDITY,
  APP_MSG_PERIODICDATA_TYPE_TEMPERATURE = 0x01,
  APP_MSG_PERIODICDATA_TYPE_HUMIDITY = 0x02,
  APP_MSG_PERIODICDATA_TYPE_COUNT = 2,
  APP_MSG_PERIODICDATA_TYPE_ALL = APP_MSG_PERIODICDATA_TYPE_TEMPERATURE | APP_MSG_PERIODICDATA_TYPE_HUMIDITY,
  APP_MSG_PERIODICDATA_TYPE_TEMPERATURE = 0x01,
  APP_MSG_PERIODICDATA_TYPE_HUMIDITY = 0x02,
  APP_MSG_PERIODICDATA_TYPE_COUNT = 2,
  APP_MSG_PERIODICDATA_TYPE_ALL = APP_MSG_PERIODICDATA_TYPE_TEMPERATURE | APP_MSG_PERIODICDATA_TYPE_HUMIDITY
}
 
enum  APP_MSG_PERIODICDATA_FORMAT_T {
  APP_MSG_PERIODICDATA_FORMAT_FULL = 0,
  APP_MSG_PERIODICDATA_FORMAT_RAW = 1,
  APP_MSG_PERIODICDATA_FORMAT_FULL = 0,
  APP_MSG_PERIODICDATA_FORMAT_RAW = 1,
  APP_MSG_PERIODICDATA_FORMAT_FULL = 0,
  APP_MSG_PERIODICDATA_FORMAT_RAW = 1
}
 
enum  APP_MSG_TSEN_RESOLUTION_T {
  APP_MSG_TSEN_RESOLUTION_7BITS = 2,
  APP_MSG_TSEN_RESOLUTION_8BITS = 3,
  APP_MSG_TSEN_RESOLUTION_9BITS = 4,
  APP_MSG_TSEN_RESOLUTION_10BITS = 5,
  APP_MSG_TSEN_RESOLUTION_11BITS = 6,
  APP_MSG_TSEN_RESOLUTION_12BITS = 7,
  APP_MSG_TSEN_RESOLUTION_7BITS = 2,
  APP_MSG_TSEN_RESOLUTION_8BITS = 3,
  APP_MSG_TSEN_RESOLUTION_9BITS = 4,
  APP_MSG_TSEN_RESOLUTION_10BITS = 5,
  APP_MSG_TSEN_RESOLUTION_11BITS = 6,
  APP_MSG_TSEN_RESOLUTION_12BITS = 7,
  APP_MSG_TSEN_RESOLUTION_7BITS = 2,
  APP_MSG_TSEN_RESOLUTION_8BITS = 3,
  APP_MSG_TSEN_RESOLUTION_9BITS = 4,
  APP_MSG_TSEN_RESOLUTION_10BITS = 5,
  APP_MSG_TSEN_RESOLUTION_11BITS = 6,
  APP_MSG_TSEN_RESOLUTION_12BITS = 7,
  APP_MSG_TSEN_RESOLUTION_7BITS = 2,
  APP_MSG_TSEN_RESOLUTION_8BITS = 3,
  APP_MSG_TSEN_RESOLUTION_9BITS = 4,
  APP_MSG_TSEN_RESOLUTION_10BITS = 5,
  APP_MSG_TSEN_RESOLUTION_11BITS = 6,
  APP_MSG_TSEN_RESOLUTION_12BITS = 7
}
 

Data Structure Documentation

◆ APP_MSG_CMD_GETMEASUREMENTS_T

struct APP_MSG_CMD_GETMEASUREMENTS_T
Data Fields
uint16_t offset

Unit: number of samples.

  • A value of 0 returns the oldest samples.
  • Any other value denotes the number of old samples to skip.
Note
This command has to be issued multiple times using different offsets, each time retrieving part of the stored samples.

◆ APP_MSG_CMD_SETCONFIG_T

struct APP_MSG_CMD_SETCONFIG_T
Data Fields
uint32_t currentTime

The absolute current time in epoch seconds.

uint16_t interval

The time between two measurements, set in seconds.

Note
: A value of 0 disables taking measurements: after entering a power save mode, the chip can then only wake up when an NFC field is present.
uint32_t startDelay

Only looked at when interval is strict positive. Time in seconds to wait before the first measurement is made.

  • If equal to 0, a first measurement will be made immediately (at currentTime).
  • The special value APP_MSG_DELAY_START_INDEFINITELY is used to defer the start indefinitely: the configuration will be fully stored, but no measurements will be made. To save battery, the IC will shut down when no NFC field is present; this means the IC cannot keep track of time during that period. Use the command with message id APP_MSG_ID_START to make a first measurement.
  • Any other value will cause the IC to minimize power while still keeping track of time.

Regardless of when the first measurement is taken, subsequent measurements will be spaced interval seconds apart.

uint32_t runningTime

Only looked at when interval is strict positive. Time in seconds to run after the first measurement.

  • A value of 0 indicates to run indefinitely, i.e. until storage is full, until the battery dies, or until a new configuration is given.
  • Any other value gives a hard stop after that many seconds.

For example, with interval equal to 10 and runningTime equal to 42, a total of 5 measurements will be made. When the time expires, the IC will shut down and will no longer keep track of time. All measurements are retained and can be retrieved.

int16_t validMinimum

A validity constraint. The minimum value in deci-Celsius degrees for each measured temperature value.

  • The entire batch of stored samples is considered valid if all samples comply with this constraint.
  • The entire batch of stored samples is considered invalid if one or more samples do not comply with this constraint.
Note
If validMinimum is not less than validMaximum, all samples are considered valid.
int16_t validMaximum

A validity constraint. The minimum value in deci-Celsius degrees for each measured temperature value.

  • The entire batch of stored samples is considered valid if all samples comply with this constraint.
  • The entire batch of stored samples is considered invalid if one or more samples do not comply with this constraint.
Note
If validMinimum is not less than validMaximum, all samples are considered valid.
uint8_t len
See also
APP_MSG_CMD_SETURL_T.len
uint8_t url[APP_MSG_MAX_LEN_URL]
See also
APP_MSG_CMD_SETURL_T.url
int8_t offset
See also
APP_MSG_CMD_SETOFFSET_T.offset
uint8_t resolution
See also
APP_MSG_CMD_SETRESOLUTION_T.resolution
uint8_t unit
See also
APP_MSG_CMD_SETUNIT_T.unit
uint32_t key[4]
See also
APP_MSG_CMD_SETKEY_T.key
uint8_t lock
See also
APP_MSG_CMD_LOCK_T.lock

◆ APP_MSG_CMD_MEASURETEMPERATURE_T

struct APP_MSG_CMD_MEASURETEMPERATURE_T
Data Fields
uint8_t resolution

Type: APP_MSG_TSEN_RESOLUTION_T

◆ APP_MSG_CMD_GETEVENTS_T

struct APP_MSG_CMD_GETEVENTS_T
Data Fields
uint16_t index

Unit: number of events.

  • A value of 0 returns the oldest events
  • Any other value denotes the number of old samples to skip. Only events that are withheld using eventMask are counted.
Note
This command may have to be issued multiple times using different offsets, each time retrieving part of the stored events.
uint32_t eventMask

A bitmask of OR'd events of type APP_MSG_EVENT_T.

  • Only events which have been set in the mask are retrieved.
  • a value of 0 is treated as if is given.
uint8_t info

A bitmask of OR'd event information types of type EVENT_INFO_T.

  • Only data from information types which have been set in the mask are returned.
  • Use the value EVENT_INFO_NONE to retrieve just the count of events matching eventMask.

◆ APP_MSG_CMD_GETPERIODICDATA_T

struct APP_MSG_CMD_GETPERIODICDATA_T
Data Fields
uint8_t which

A bitmask of OR'd values of type APP_MSG_PERIODICDATA_TYPE_T.

  • Only data from the types which have been set in the mask are returned.
  • When multiple data types have been set - i.e. more than one bit - the data is interleaved: first a data sample of the type indicated by the lowest set bit, second a data sample of the type indicated by the second set bit, and so on.
uint8_t format

The enumeration value of type APP_MSG_PERIODICDATA_FORMAT_T, indicating the format of the retrieved data. When this format is not compatible with the value which, only an error response is generated: MSG_RESPONSE_RESULTONLY_T

uint16_t offset
  • If format equals APP_MSG_PERIODICDATA_FORMAT_FULL: Unit: number of samples.
    • A value of 0 returns the oldest samples.
    • Any other value denotes the number of old samples to skip.
  • If format equals APP_MSG_PERIODICDATA_FORMAT_RAW: Unit: number of bytes.
    • A value of 0 returns the oldest bytes.
    • Any other value denotes the number of bytes to skip.
Note
This command has to be issued multiple times using different offsets, each time retrieving part of the stored samples.

◆ APP_MSG_RESPONSE_GETMEASUREMENTS_T

struct APP_MSG_RESPONSE_GETMEASUREMENTS_T
See also
APP_MSG_ID_GETMEASUREMENTS
  1. If a valid command was received, and temperature values are available, the structure is appended with extra data for each reported temperature:
    dot_inline_dotgraph_1.png


  2. If the command was rejected, or if no temperature values are available, the response consists of just the structure without trailing extra bytes:
    dot_inline_dotgraph_2.png


  3. Or if the command was rejected, only a MSG_RESPONSE_RESULTONLY_T structure is returned:
    dot_inline_dotgraph_3.png
Data Fields
uint32_t result

The command result. Only when result equals MSG_OK, the other fields in this response are valid.

uint16_t offset

Unit: number of samples. Defines the sequence number of the first data value that follows.

Note
This may differ from the offset value given in the corresponding command: APP_MSG_CMD_GETMEASUREMENTS_T.offset
uint8_t count

The number of values that follow after the padding bytes. This number can be 0. Immediately following this structure is an array of count elements, each element 16 bits wide. Each element holds one measurement value in deci-Celsius degrees. The total size of the response is thus variable and equals

sizeof(APP_MSG_RESPONSE_GETMEASUREMENTS_T) + sizeof(int16_t) * count
Note
There are no implicit padding bytes before the values, only the explicit bytes below.
The timestamp for each measurement can be reconstructed using APP_MSG_RESPONSE_GETCONFIG_T.startTime and APP_MSG_RESPONSE_GETCONFIG_T.interval, the value of offset and the position in the array of values that follow after this structure.
uint8_t zero[3]

Padding bytes. Must be 0.

Note
Added to ensure size is a multiple of 2. Added solely to ease ARM SW development, and left at 3 for backwards compatibility.
Directly after these padding bytes, the measurements are listed, to be interpreted as
int16_t data[count]

◆ APP_MSG_RESPONSE_GETCONFIG_T

struct APP_MSG_RESPONSE_GETCONFIG_T
Data Fields
uint32_t result

The command result. Only when result equals MSG_OK, the contents below this field are valid.

uint32_t configTime

The value as given by APP_MSG_CMD_SETCONFIG_T.currentTime, with 0 as default value.

uint16_t interval

The value as given by APP_MSG_CMD_SETCONFIG_T.interval, with 0 as default value.

uint32_t startDelay

The value as given by APP_MSG_CMD_SETCONFIG_T.startDelay, with 0 as default value.

uint32_t runningTime

The value as given by APP_MSG_CMD_SETCONFIG_T.runningTime, with 0 as default value.

int16_t validMinimum

The value as given by APP_MSG_CMD_SETCONFIG_T.validMinimum, with 32767 as default value.

int16_t validMaximum

The value as given by APP_MSG_CMD_SETCONFIG_T.validMaximum, with -32768 as default value.

int16_t attainedMinimum

The absolute minimum value of all temperature measurements.

int16_t attainedMaximum

The absolute maximum value of all temperature measurements.

uint16_t count

The number of measurements available.

A sequence number. Indicates the number of times a URL was read out in different NFC sessions.

Note
This value corresponds to the n query argument in the URL.
uint32_t status

A bitmask of OR'd events of type APP_MSG_EVENT_T.

  • Multiple bits indicating a state change can be set simultaneously: in that case, the highest value bit indicates the current state.
  • Multiple bits indicating a failure or achievement can be set simultaneously.
uint32_t startTime

The time in epoch seconds when the first measurement was taken. 0 if no measurement has yet been taken.

uint32_t currentTime

The current time as known by the IC. This may or may not reflect the current absolute time in epoch seconds: The IC may have stopped keeping track of time:

In these cases, currentTime reflects the time since last waking up again after being shut down. In all other cases the epoch time in seconds was given to the IC using a command with message ID APP_MSG_ID_SETCONFIG or APP_MSG_ID_START and the IC kept up to and including now track of time. The value returned here then reflects the current absolute epoch time in seconds.

Note
Using the other fields in this structure the correct type of the value can be deduced. Typical epoch values will also be a lot larger than any running time since a last reset pulse: any value less than configTime indicates logging has stopped and the device went to power-off mode or has experienced a power loss.
uint8_t len
See also
APP_MSG_CMD_SETURL_T.len
uint8_t url[APP_MSG_MAX_LEN_URL]
See also
APP_MSG_CMD_SETURL_T.url
int8_t offset
See also
APP_MSG_CMD_SETOFFSET_T.offset
Note
This value corresponds to the o query argument in the URL.
uint8_t resolution
See also
APP_MSG_CMD_SETRESOLUTION_T.resolution
uint8_t unit
See also
APP_MSG_CMD_SETUNIT_T.unit
uint8_t locked
See also
APP_MSG_CMD_LOCK_T.lock
uint8_t id[8]

An identifier guaranteed unique for each IC.

Note
This value corresponds to the i query argument in the URL.
uint16_t temperature

The last measured temperature. The offset is not added. Expressed in deci-degrees with an offset value of -40C. For example:

  • A value of 0 corresponds to -40C.
  • A value of 789 corresponds to -40 + 78.9 = 38.9C
Note
This value corresponds to the t query argument in the URL.

◆ APP_MSG_RESPONSE_MEASURETEMPERATURE_T

struct APP_MSG_RESPONSE_MEASURETEMPERATURE_T
Data Fields
uint32_t result

The command result. Only when result equals MSG_OK, the contents of data is valid.

int16_t temperature

The measured temperature in deci-Celsius degrees.

◆ APP_MSG_RESPONSE_GETEVENTS_T

struct APP_MSG_RESPONSE_GETEVENTS_T
See also
APP_MSG_ID_GETEVENTS

Depending on the value given in APP_MSG_CMD_GETEVENTS_T.info, the response will have a different stream of bytes 'data' added right after the last field of this structure. The diagrams below give some examples what to expect:

  1. If only the count is requested, the response is most simple:
    dot_inline_dotgraph_4.png



  2. If for each event both the event value and the timestamp on which it occurred is requested, the structure is appended with extra data for each reported event:
    dot_inline_dotgraph_5.png



  3. In case all event information is requested, a GetEvents response is assembled as:
    dot_inline_dotgraph_6.png
Data Fields
uint16_t index

Unit: number of events. The value as given by APP_MSG_CMD_GETEVENTS_T.index.

uint32_t eventMask

A bitmask of OR'd events of type APP_MSG_EVENT_T. The value as given by APP_MSG_CMD_GETEVENTS_T.eventMask, with 0 replaced by

.

uint8_t info

A bitmask of OR'd event information types of type EVENT_INFO_T. The value as given by APP_MSG_CMD_GETEVENTS_T.info, possibly extended by setting EVENT_INFO_MORE.

  • If equal to EVENT_INFO_NONE no data is following this structure.
  • If EVENT_INFO_MORE is set, issue a new command using index + count as the new value for index.
uint16_t count

The number of events that match eventMask that are reported by this response. This number can be 0.

  • This number may be less than the total number of events matching eventMask - as indicated by EVENT_INFO_MORE being set or not in info.

Immediately following this structure is an array of bytes, with extra information per event, as indicated by info.

  • Depending on the bits set in info, the number of bytes added will vary; if EVENT_INFO_DATA is set, the number of added bytes can even differ per event.
  • The order in which the enumeration values are listed - and their enumeration value - in EVENT_INFO_T determines the order in which the information is given.

The total size of the response is thus variable and must be deduced from this value count together with info.

◆ APP_MSG_RESPONSE_GETPERIODICDATA_T

struct APP_MSG_RESPONSE_GETPERIODICDATA_T
Data Fields
uint32_t result

The command result. Only when result equals MSG_OK, the other fields in this response are valid.

uint8_t which

A bitmask of OR'd values of type APP_MSG_PERIODICDATA_TYPE_T The value as given by APP_MSG_CMD_GETPERIODICDATA_T.which, possibly reduced to only list the available types.

uint8_t format

The value as given by APP_MSG_CMD_GETPERIODICDATA_T.format

uint16_t offset

A value smaller than or equal to APP_MSG_CMD_GETPERIODICDATA_T.offset, with the unit defined by format.

Note
Directly hereafter, the data is given, to be interpreted per the value set in which and format. It is possible no bytes follow, indicating no data matching the filters set in APP_MSG_CMD_GETPERIODICDATA_T are available. There are no padding bytes before the values.
Warning
The amount of bytes or the number of samples given is not provided and must be derived from the interpretation of the field values in this structure and the extra bytes appended hereafter.
Note
The timestamp for each measurement can be reconstructed using APP_MSG_RESPONSE_GETCONFIG_T.startTime and APP_MSG_RESPONSE_GETCONFIG_T.interval, and the sequence value of each data sample.
Example
when: A total of 6 bytes will be added:
T1 H1 T2 H2 -> 345 91 567 136 -> (59h 01h) 5Bh (37h 02h) 88h

Macro Definition Documentation

◆ APP_MSG_ERR_TSEN

#define APP_MSG_ERR_TSEN   0x1000E

The temperature sensor was already in use. Wait, then try again. The time to wait is dependent on the resolution of the temperature conversion currently in progress - see APP_MSG_TSEN_RESOLUTION_T - and is at most 100 ms.

◆ APP_MSG_MIN_TEMPERATURE

#define APP_MSG_MIN_TEMPERATURE   -400

The maximum temperature the application can handle. This is a result of the limitations of the IC (-40:+85C), the limitations of the battery (say, -30:+50C), and the requirements of the use case. Since this is a demo, the maximum temperature the IC validated for is chosen.

  • All measured temperatures are clamped in the range [MIN-MAX].
  • Expressed in deci-degrees.

◆ APP_MSG_MAX_TEMPERATURE

#define APP_MSG_MAX_TEMPERATURE   850

The maximum temperature the application can handle. This is a result of the limitations of the IC (-40:+85C), the limitations of the battery (say, -30:+50C), and the requirements of the use case. Since this is a demo, the maximum temperature the IC validated for is chosen.

  • All measured temperatures are clamped in the range [MIN-MAX].
  • Expressed in deci-degrees.

◆ APP_MSG_TEMPERATURE_PLACEHOLDER_VALUE

#define APP_MSG_TEMPERATURE_PLACEHOLDER_VALUE   (APP_MSG_MAX_TEMPERATURE + 1)

A value used to indicate either

  • a value above APP_MSG_MAX_TEMPERATURE or below -APP_MSG_MAX_TEMPERATURE was measured. The measurement value was replaced with this value. Or
  • a measurement was due while an NFC field was present. The measurement did not take place and this value was stored instead.

◆ APP_MSG_DELAY_START_INDEFINITELY

#define APP_MSG_DELAY_START_INDEFINITELY   0xFFFFFFFF

The value used to indicate the first measurement is to be delayed until an explicit command with message id APP_MSG_ID_START is given. See APP_MSG_CMD_SETCONFIG_T.startDelay.

◆ APP_MSG_MAX_TEMPERATURE_VALUES_IN_RESPONSE

#define APP_MSG_MAX_TEMPERATURE_VALUES_IN_RESPONSE   232

The maximum number of temperature measurement values that can be retrieved in one response.

See also
APP_MSG_ID_GETMEASUREMENTS
APP_MSG_ID_GETPERIODICDATA

◆ APP_MSG_SIZEOFEVENT_IN_RESPONSE

#define APP_MSG_SIZEOFEVENT_IN_RESPONSE (   info,
  data 
)
Value:
(((((info) & EVENT_INFO_INDEX) == EVENT_INFO_INDEX) * 2) \
+ ((((info) & EVENT_INFO_TIMESTAMP) == EVENT_INFO_TIMESTAMP) * 4) \
+ (((info) & EVENT_INFO_ENUM) == EVENT_INFO_ENUM) \
+ ((((info) & EVENT_INFO_DATA) == EVENT_INFO_DATA) * (data)))
Definition: app_demo_dp_tlogger/inc/msghandler_protocol.h:329
Definition: app_demo_dp_tlogger/inc/msghandler_protocol.h:310
Definition: app_demo_dp_tlogger/inc/msghandler_protocol.h:302
Definition: app_demo_dp_tlogger/inc/msghandler_protocol.h:319

Helper macro to calculate the size of a single event, appended after a APP_MSG_CMD_GETEVENTS_T response.

Parameters
info: A bitmask of OR'd event information types of type EVENT_INFO_T.
data: The number of bytes of the extra data stored with the event. Ignored if EVENT_INFO_DATA is not set in info.

◆ APP_MSG_MAX_EVENTS_IN_RESPONSE

#define APP_MSG_MAX_EVENTS_IN_RESPONSE (   size)    (505 / (size))

The maximum number of events that can be retrieved in a one response.

Parameters
size: the size of one event, appended after a APP_MSG_CMD_GETEVENTS_T response. All events are assumed to be of equal size (i.e. ignoring potential differences when EVENT_INFO_DATA is set).

Enumeration Type Documentation

◆ APP_MSG_ID_T

Supported messages

Enumerator
APP_MSG_ID_GETMEASUREMENTS 

0x46
Retrieves (part of) the stored measurements, that were taken after the last APP_MSG_ID_SETCONFIG command.

Parameters
APP_MSG_CMD_GETMEASUREMENTS_T
Returns
MSG_RESPONSE_RESULTONLY_T if the command could not be handled; APP_MSG_RESPONSE_GETMEASUREMENTS_T otherwise.
Note
synchronous command
All temperatures retrieved are within the range [-APP_MSG_MAX_TEMPERATURE; +APP_MSG_MAX_TEMPERATURE]. There is one special value, APP_MSG_TEMPERATURE_PLACEHOLDER_VALUE, that is used to indicate anomalies.
APP_MSG_ID_GETCONFIG 

0x48
Retrieves all configuration parameters regarding temperature and chip behavior, and the number of temperature measurements available.

Parameters
none
Returns
APP_MSG_RESPONSE_GETCONFIG_T
Note
synchronous command
The response of this command will be buffered by the application in addition to being sent out immediately. It will then also be placed in the same NFC message that contains the response for the MSG_ID_GETVERSION command.
APP_MSG_ID_SETCONFIG 

0x49
Sets all configuration parameters regarding temperature and chip behavior, and clears the buffer holding all measurements and events.

Parameters
APP_MSG_CMD_SETCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_MEASURETEMPERATURE 

0x50
Measures the temperature using the built-in temperature sensor.

Parameters
APP_MSG_CMD_MEASURETEMPERATURE_T
Returns
MSG_RESPONSE_RESULTONLY_T immediately;
If result was equal to MSG_OK, APP_MSG_RESPONSE_MEASURETEMPERATURE_T thereafter. This may take up to 100 ms. This second response must be fetched by issuing a command with MSG_ID_GETRESPONSE.
Note
asynchronous command
APP_MSG_ID_START 

0x5A
Starts logging according to the last given configuration using APP_MSG_ID_SETCONFIG. A first measurement will be taken immediately.

Parameters
none
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_GETEVENTS 

0x5B
Retrieves events logged by the application. Changes in execution state and detection of anomalies are recorded with a full timestamp and are annotations to the logged measurement values.

Parameters
APP_MSG_CMD_GETEVENTS_T
Returns
APP_MSG_RESPONSE_GETEVENTS_T
Note
synchronous command
APP_MSG_ID_GETPERIODICDATA 

0x5E
Retrieves (part of the) data that was taken periodically. No timing information will be provided, as that can be deduced from the sequence and the configuration details - see APP_MSG_ID_GETCONFIG.

Parameters
APP_MSG_CMD_GETPERIODICDATA_T
Returns
MSG_RESPONSE_RESULTONLY_T if the command could not be handled; APP_MSG_RESPONSE_GETPERIODICDATA_T otherwise.
Note
synchronous command
APP_MSG_ID_COUNT 

Number of application specific message IDs. Not to be used as a possible ID. Use this in for loops or to define array sizes.

APP_MSG_ID_GETMEASUREMENTS 

0x46
Retrieves (part of) the stored measurements, that were taken after the last APP_MSG_ID_SETCONFIG command.

Parameters
APP_MSG_CMD_GETMEASUREMENTS_T
Returns
MSG_RESPONSE_RESULTONLY_T if the command could not be handled; APP_MSG_RESPONSE_GETMEASUREMENTS_T otherwise.
Note
synchronous command
All temperatures retrieved are within the range [-APP_MSG_MAX_TEMPERATURE; +APP_MSG_MAX_TEMPERATURE]. There is one special value, APP_MSG_TEMPERATURE_PLACEHOLDER_VALUE, that is used to indicate anomalies.
APP_MSG_ID_GETCONFIG 

0x48
Retrieves all configuration parameters regarding temperature and chip behavior, and the number of temperature measurements available.

Parameters
none
Returns
APP_MSG_RESPONSE_GETCONFIG_T
Note
synchronous command
The response of this command will be buffered by the application in addition to being sent out immediately. It will then also be placed in the same NFC message that contains the response for the MSG_ID_GETVERSION command.
APP_MSG_ID_SETCONFIG 

0x49
Sets all configuration parameters regarding temperature and chip behavior, and clears the buffer holding all measurements and events.

Parameters
APP_MSG_CMD_SETCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_MEASURETEMPERATURE 

0x50
Measures the temperature using the built-in temperature sensor.

Parameters
APP_MSG_CMD_MEASURETEMPERATURE_T
Returns
MSG_RESPONSE_RESULTONLY_T immediately;
If result was equal to MSG_OK, APP_MSG_RESPONSE_MEASURETEMPERATURE_T thereafter. This may take up to 100 ms. This second response must be fetched by issuing a command with MSG_ID_GETRESPONSE.
Note
asynchronous command
APP_MSG_ID_START 

0x5A
Starts logging according to the last given configuration using APP_MSG_ID_SETCONFIG. A first measurement will be taken immediately.

Parameters
none
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_GETEVENTS 

0x5B
Retrieves events logged by the application. Changes in execution state and detection of anomalies are recorded with a full timestamp and are annotations to the logged measurement values.

Parameters
APP_MSG_CMD_GETEVENTS_T
Returns
APP_MSG_RESPONSE_GETEVENTS_T
Note
synchronous command
APP_MSG_ID_GETACCELCONFIG 

0x5C
Retrieves all configuration parameters regarding acceleration-related detection such as shock and vibration, and the number of acceleration-related events available.

Parameters
none
Returns
APP_MSG_RESPONSE_GETACCELCONFIG_T
Note
synchronous command
APP_MSG_ID_SETACCELCONFIG 

0x5D
Caches all configuration parameters regarding acceleration-related detection. The cached data is stored in volatile memory only. If later, within the same session, a command with ID APP_MSG_ID_SETCONFIG is given, the configuration parameters are used to configure the accelerometer. Then the configuration is copied to non-volatile memory.

Note
Once configured, the configuration can be overwritten by issuing a new command.
This message does not start a monitoring session.
Parameters
APP_MSG_CMD_SETACCELCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T
See also
APP_MSG_ID_SETCONFIG
Note
synchronous command
APP_MSG_ID_GETPERIODICDATA 

0x5E
Retrieves (part of the) data that was taken periodically. No timing information will be provided, as that can be deduced from the sequence and the configuration details - see APP_MSG_ID_GETCONFIG.

Parameters
APP_MSG_CMD_GETPERIODICDATA_T
Returns
MSG_RESPONSE_RESULTONLY_T if the command could not be handled; APP_MSG_RESPONSE_GETPERIODICDATA_T otherwise.
Note
synchronous command
APP_MSG_ID_COUNT 

Number of application specific message IDs. Not to be used as a possible ID. Use this in for loops or to define array sizes.

APP_MSG_ID_GETMEASUREMENTS 

0x46
Retrieves (part of) the stored measurements, that were taken after the last APP_MSG_ID_SETCONFIG command.

Parameters
APP_MSG_CMD_GETMEASUREMENTS_T
Returns
MSG_RESPONSE_RESULTONLY_T if the command could not be handled; APP_MSG_RESPONSE_GETMEASUREMENTS_T otherwise.
Note
synchronous command
All temperatures retrieved are within the range [-APP_MSG_MAX_TEMPERATURE; +APP_MSG_MAX_TEMPERATURE]. There is one special value, APP_MSG_TEMPERATURE_PLACEHOLDER_VALUE, that is used to indicate anomalies.
APP_MSG_ID_GETCONFIG 

0x48
Retrieves all configuration parameters regarding temperature and chip behavior, and the number of temperature measurements available.

Parameters
none
Returns
APP_MSG_RESPONSE_GETCONFIG_T
Note
synchronous command
The response of this command will be buffered by the application in addition to being sent out immediately. It will then also be placed in the same NFC message that contains the response for the MSG_ID_GETVERSION command.
APP_MSG_ID_SETCONFIG 

0x49
Sets all configuration parameters regarding temperature and chip behavior, and clears the buffer holding all measurements and events.

Parameters
APP_MSG_CMD_SETCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_MEASURETEMPERATURE 

0x50
Measures the temperature using the built-in temperature sensor.

Parameters
APP_MSG_CMD_MEASURETEMPERATURE_T
Returns
MSG_RESPONSE_RESULTONLY_T immediately;
If result was equal to MSG_OK, APP_MSG_RESPONSE_MEASURETEMPERATURE_T thereafter. This may take up to 100 ms. This second response must be fetched by issuing a command with MSG_ID_GETRESPONSE.
Note
asynchronous command
APP_MSG_ID_START 

0x5A
Starts logging according to the last given configuration using APP_MSG_ID_SETCONFIG. A first measurement will be taken immediately.

Parameters
none
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_GETEVENTS 

0x5B
Retrieves events logged by the application. Changes in execution state and detection of anomalies are recorded with a full timestamp and are annotations to the logged measurement values.

Parameters
APP_MSG_CMD_GETEVENTS_T
Returns
APP_MSG_RESPONSE_GETEVENTS_T
Note
synchronous command
APP_MSG_ID_GETACCELCONFIG 

0x5C
Retrieves all configuration parameters regarding acceleration-related detection such as shock and vibration, and the number of acceleration-related events available.

Parameters
none
Returns
APP_MSG_RESPONSE_GETACCELCONFIG_T
Note
synchronous command
APP_MSG_ID_SETACCELCONFIG 

0x5D
Caches all configuration parameters regarding acceleration-related detection. The cached data is stored in volatile memory only. If later, within the same session, a command with ID APP_MSG_ID_SETCONFIG is given, the configuration parameters are used to configure the accelerometer. Then the configuration is copied to non-volatile memory.

Note
Once configured, the configuration can be overwritten by issuing a new command.
This message does not start a monitoring session.
Parameters
APP_MSG_CMD_SETACCELCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T
See also
APP_MSG_ID_SETCONFIG
Note
synchronous command
APP_MSG_ID_GETPERIODICDATA 

0x5E
Retrieves (part of the) data that was taken periodically. No timing information will be provided, as that can be deduced from the sequence and the configuration details - see APP_MSG_ID_GETCONFIG.

Parameters
APP_MSG_CMD_GETPERIODICDATA_T
Returns
MSG_RESPONSE_RESULTONLY_T if the command could not be handled; APP_MSG_RESPONSE_GETPERIODICDATA_T otherwise.
Note
synchronous command
APP_MSG_ID_GETHUMIDITYCONFIG 

0x5F
Retrieves the configuration parameters for humidity-related measurements.

Parameters
none
Returns
APP_MSG_RESPONSE_GETHUMIDITYCONFIG_T
Note
synchronous command
APP_MSG_ID_SETHUMIDITYCONFIG 

0x60
Sets the configuration parameters for humidity-related measurements.

Warning
The given settings overwrite the previous ones, even when measurements are already ongoing. Advised is to strictly adhere to this order: This sequence is not enforced nor checked for.
Note
This message does not start a monitoring session.
Parameters
APP_MSG_CMD_SETHUMIDITYCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T
Note
synchronous command
APP_MSG_ID_COUNT 

Number of application specific message IDs. Not to be used as a possible ID. Use this in for loops or to define array sizes.

APP_MSG_ID_SETURL 

0x71
Provides a new domain and path to use. The query arguments will be appended after this supplied base and path.

Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_SETURL_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
APP_MSG_ID_SETOFFSET 

0x72
Provides an offset to add to each temperature measurement. Use this to compensate for a suboptimal location of the IC.

Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_SETOFFSET_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
APP_MSG_ID_SETRESOLUTION 

0x73
Determines the resolution - and thus also the conversion time - of a single temperature measurement.

Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_SETRESOLUTION_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
APP_MSG_ID_SETUNIT 

0x74
Determines the temperature unit with which to report the measured temperatures.

Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_SETUNIT_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
APP_MSG_ID_SETKEY 

0x75
Provides a key to use to calculate the hashing value with.

Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_SETKEY_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
APP_MSG_ID_LOCK 

0x77
Blocks all future configuration changes. Once locked, all these commands will return an error without making any change:

Warning
Once locked, the IC can not be unlocked.
Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_LOCK_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
APP_MSG_ID_SETCONFIG 

0x78
Provides a new domain and path, an offset, and a key in one command.

Parameters
Header: Sequence of bytes as per the Protocol.
Payload: APP_MSG_CMD_SETCONFIG_T
Returns
MSG_RESPONSE_RESULTONLY_T.
Note
synchronous command
See also
APP_MSG_ID_SETURL
APP_MSG_ID_SETOFFSET
APP_MSG_ID_SETRESOLUTION
APP_MSG_ID_SETUNIT
APP_MSG_ID_SETKEY
APP_MSG_ID_GETCONFIG 

0x79
Retrieves the different parts that make up the full URL in byte format.

Parameters
Header: Sequence of bytes as per the Protocol.
none
Returns
APP_MSG_RESPONSE_GETCONFIG_T
Note
synchronous command

◆ APP_MSG_EVENT_T

The different events that can occur and are tracked - used in APP_MSG_RESPONSE_GETCONFIG_T.status.

  • All events that indicate a failure or achievement provide information can co-exist.
  • All events that indicate a state change remain set even when they are superseded with a new state change: e.g. APP_MSG_EVENT_PRISTINE will remain set after being configured, indicated by bit APP_MSG_EVENT_CONFIGURED.
Note
This enumeration is shared across multiple demo firmware applications; not all events listed here may be applicable.
See also
APP_MSG_ID_GETCONFIG
Enumerator
APP_MSG_EVENT_PRISTINE 

0x0000 0001
State change: the IC no longer has a configuration and contains no data.

APP_MSG_EVENT_CONFIGURED 

0x0000 0002
State change: the IC is configured, but requires a APP_MSG_ID_START command to start.

APP_MSG_EVENT_STARTING 

0x0000 0004
State change: the IC is configured and will make a first measurement after a delay.

APP_MSG_EVENT_LOGGING 

0x0000 0008
State change: the IC is configured and is logging. At least one sample is available.

APP_MSG_EVENT_STOPPED 

0x0000 0010
State change: the IC is configured and has been logging. Now it has stopped logging.

APP_MSG_EVENT_TEMPERATURE_TOO_HIGH 

0x0000 0020
Failure: at least one temperature was strictly higher than the valid maximum value.

APP_MSG_EVENT_TEMPERATURE_TOO_LOW 

0x0000 0040
Failure: at least one temperature was strictly lower than the valid minimum value.

APP_MSG_EVENT_BOD 

0x0000 0080
Failure: a brown-out is about to occur or has occurred. Battery is (nearly) depleted.

APP_MSG_EVENT_FULL 

0x0000 0100
Failure: logging has stopped because no more free space is available to store samples.

APP_MSG_EVENT_EXPIRED 

0x0000 0200
Achievement: logging has stopped because the time spent logging has exceeded the non-zero value set in APP_MSG_CMD_SETCONFIG_T.runningTime.

APP_MSG_EVENT_I2C_ERROR 

0x0000 0400
Temporary error: The application could not successfully communicate using I2C with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When I2C communication is successful next time, this bit is cleared again.

APP_MSG_EVENT_SPI_ERROR 

0x0000 0800
Temporary error: The application could not successfully communicate using SPI with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When SPI communication is successful next time, this bit is cleared again.

APP_MSG_EVENT_SHOCK 

0x0000 1000
Storage condition notification: the product has received a shock.

APP_MSG_EVENT_SHAKE 

0x0000 2000
Storage condition notification: the product has been shaken with.

APP_MSG_EVENT_VIBRATION 

0x0000 4000
Storage condition notification: the product has detected a vibration.

APP_MSG_EVENT_TILT 

0x0000 8000
Storage condition notification: the product has detected a tilt.

APP_MSG_EVENT_SHOCK_CONFIGURED 

0x0001 0000
Storage condition notification: the product is configured to detect shocks.

APP_MSG_EVENT_SHAKE_CONFIGURED 

0x0002 0000
Storage condition notification: the product is configured to detect shaking.

APP_MSG_EVENT_VIBRATION_CONFIGURED 

0x0004 0000
Storage condition notification: the product is configured to detect vibrations.

APP_MSG_EVENT_TILT_CONFIGURED 

0x0008 0000
Storage condition notification: the product is configured to detect tilts.

APP_MSG_EVENT_HUMIDITY_CONFIGURED 

0x0010 0000
Storage condition notification: the product is configured to detect humidity.

APP_MSG_EVENT_HUMIDITY_TOO_HIGH 

0x0020 0000
Failure: at least one humidity measurement was strictly higher than the valid maximum value.

APP_MSG_EVENT_HUMIDITY_TOO_LOW 

0x0040 0000
Failure: at least one humidity measurement was strictly lower than the valid minimum value.

APP_MSG_EVENT_COUNT 

23
Number of possible events. Not to be used as a possible event. Use this in for loops or to define array sizes.

APP_MSG_EVENT_ALL 

Convenience value. Not to be used as a possible event. Use this in bitmasks to capture all events.

APP_MSG_EVENT_PRISTINE 

0x0000 0001
State change: the IC no longer has a configuration and contains no data.

APP_MSG_EVENT_CONFIGURED 

0x0000 0002
State change: the IC is configured, but requires a APP_MSG_ID_START command to start.

APP_MSG_EVENT_STARTING 

0x0000 0004
State change: the IC is configured and will make a first measurement after a delay.

APP_MSG_EVENT_LOGGING 

0x0000 0008
State change: the IC is configured and is logging. At least one sample is available.

APP_MSG_EVENT_STOPPED 

0x0000 0010
State change: the IC is configured and has been logging. Now it has stopped logging.

APP_MSG_EVENT_TEMPERATURE_TOO_HIGH 

0x0000 0020
Failure: at least one temperature was strictly higher than the valid maximum value.

APP_MSG_EVENT_TEMPERATURE_TOO_LOW 

0x0000 0040
Failure: at least one temperature was strictly lower than the valid minimum value.

APP_MSG_EVENT_BOD 

0x0000 0080
Failure: a brown-out is about to occur or has occurred. Battery is (nearly) depleted.

APP_MSG_EVENT_FULL 

0x0000 0100
Failure: logging has stopped because no more free space is available to store samples.

APP_MSG_EVENT_EXPIRED 

0x0000 0200
Achievement: logging has stopped because the time spent logging has exceeded the non-zero value set in APP_MSG_CMD_SETCONFIG_T.runningTime.

APP_MSG_EVENT_I2C_ERROR 

0x0000 0400
Temporary error: The application could not successfully communicate using I2C with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When I2C communication is successful next time, this bit is cleared again.

APP_MSG_EVENT_SPI_ERROR 

0x0000 0800
Temporary error: The application could not successfully communicate using SPI with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When SPI communication is successful next time, this bit is cleared again.

APP_MSG_EVENT_SHOCK 

0x0000 1000
Storage condition notification: the product has received a shock.

APP_MSG_EVENT_SHAKE 

0x0000 2000
Storage condition notification: the product has been shaken with.

APP_MSG_EVENT_VIBRATION 

0x0000 4000
Storage condition notification: the product has detected a vibration.

APP_MSG_EVENT_TILT 

0x0000 8000
Storage condition notification: the product has detected a tilt.

APP_MSG_EVENT_SHOCK_CONFIGURED 

0x0001 0000
Storage condition notification: the product is configured to detect shocks.

APP_MSG_EVENT_SHAKE_CONFIGURED 

0x0002 0000
Storage condition notification: the product is configured to detect shaking.

APP_MSG_EVENT_VIBRATION_CONFIGURED 

0x0004 0000
Storage condition notification: the product is configured to detect vibrations.

APP_MSG_EVENT_TILT_CONFIGURED 

0x0008 0000
Storage condition notification: the product is configured to detect tilts.

APP_MSG_EVENT_HUMIDITY_CONFIGURED 

0x0010 0000
Storage condition notification: the product is configured to detect humidity.

APP_MSG_EVENT_HUMIDITY_TOO_HIGH 

0x0020 0000
Failure: at least one humidity measurement was strictly higher than the valid maximum value.

APP_MSG_EVENT_HUMIDITY_TOO_LOW 

0x0040 0000
Failure: at least one humidity measurement was strictly lower than the valid minimum value.

APP_MSG_EVENT_COUNT 

23
Number of possible events. Not to be used as a possible event. Use this in for loops or to define array sizes.

APP_MSG_EVENT_ALL 

Convenience value. Not to be used as a possible event. Use this in bitmasks to capture all events.

APP_MSG_EVENT_PRISTINE 

0x0000 0001
State change: the IC no longer has a configuration and contains no data.

APP_MSG_EVENT_CONFIGURED 

0x0000 0002
State change: the IC is configured, but requires a APP_MSG_ID_START command to start.

APP_MSG_EVENT_STARTING 

0x0000 0004
State change: the IC is configured and will make a first measurement after a delay.

APP_MSG_EVENT_LOGGING 

0x0000 0008
State change: the IC is configured and is logging. At least one sample is available.

APP_MSG_EVENT_STOPPED 

0x0000 0010
State change: the IC is configured and has been logging. Now it has stopped logging.

APP_MSG_EVENT_TEMPERATURE_TOO_HIGH 

0x0000 0020
Failure: at least one temperature was strictly higher than the valid maximum value.

APP_MSG_EVENT_TEMPERATURE_TOO_LOW 

0x0000 0040
Failure: at least one temperature was strictly lower than the valid minimum value.

APP_MSG_EVENT_BOD 

0x0000 0080
Failure: a brown-out is about to occur or has occurred. Battery is (nearly) depleted.

APP_MSG_EVENT_FULL 

0x0000 0100
Failure: logging has stopped because no more free space is available to store samples.

APP_MSG_EVENT_EXPIRED 

0x0000 0200
Achievement: logging has stopped because the time spent logging has exceeded the non-zero value set in APP_MSG_CMD_SETCONFIG_T.runningTime.

APP_MSG_EVENT_I2C_ERROR 

0x0000 0400
Temporary error: The application could not successfully communicate using I2C with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When I2C communication is successful next time, this bit is cleared again.

APP_MSG_EVENT_SPI_ERROR 

0x0000 0800
Temporary error: The application could not successfully communicate using SPI with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When SPI communication is successful next time, this bit is cleared again.

APP_MSG_EVENT_SHOCK 

0x0000 1000
Storage condition notification: the product has received a shock.

APP_MSG_EVENT_SHAKE 

0x0000 2000
Storage condition notification: the product has been shaken with.

APP_MSG_EVENT_VIBRATION 

0x0000 4000
Storage condition notification: the product has detected a vibration.

APP_MSG_EVENT_TILT 

0x0000 8000
Storage condition notification: the product has detected a tilt.

APP_MSG_EVENT_SHOCK_CONFIGURED 

0x0001 0000
Storage condition notification: the product is configured to detect shocks.

APP_MSG_EVENT_SHAKE_CONFIGURED 

0x0002 0000
Storage condition notification: the product is configured to detect shaking.

APP_MSG_EVENT_VIBRATION_CONFIGURED 

0x0004 0000
Storage condition notification: the product is configured to detect vibrations.

APP_MSG_EVENT_TILT_CONFIGURED 

0x0008 0000
Storage condition notification: the product is configured to detect tilts.

APP_MSG_EVENT_HUMIDITY_CONFIGURED 

0x0010 0000
Storage condition notification: the product is configured to detect humidity.

APP_MSG_EVENT_HUMIDITY_TOO_HIGH 

0x0020 0000
Failure: at least one humidity measurement was strictly higher than the valid maximum value.

APP_MSG_EVENT_HUMIDITY_TOO_LOW 

0x0040 0000
Failure: at least one humidity measurement was strictly lower than the valid minimum value.

APP_MSG_EVENT_COUNT 

23
Number of possible events. Not to be used as a possible event. Use this in for loops or to define array sizes.

APP_MSG_EVENT_ALL 

Convenience value. Not to be used as a possible event. Use this in bitmasks to capture all events.

◆ EVENT_INFO_T

Lists the different types of information that can be returned in a response with message id APP_MSG_ID_GETEVENTS

Enumerator
EVENT_INFO_INDEX 

0x01
When set, include the absolute index number of the event.

  • Size: 2 bytes, LSByte first
EVENT_INFO_TIMESTAMP 

0x02
When set, include the absolute timestamp when the event occurred.

  • Size: 4 bytes, LSByte first
EVENT_INFO_ENUM 

0x04
When set, include the event number n. This is equal to log_2 of the enumeration value of type APP_MSG_EVENT_T. The enumeration value can be retrieved by shifting 1
positions to the left.

  • Size: 1 byte
EVENT_INFO_DATA 

0x08
When set, include the extra data stored with the event, if any.

  • Size: variable, depending on the event being stored.
Note
The size is not passed along. It is assumed the tag reader knows this in advance, as it knows how to interpret this data.
EVENT_INFO_COUNT 

4
Number of possible types of event information. Not to be used as a possible enumeration value. Use this in for loops or to define array sizes.

EVENT_INFO_NONE 

0x00
When no bits are set, no information about the events is included. Use this if you want to learn only about count of events that match APP_MSG_RESPONSE_GETEVENTS_T.eventMask.

EVENT_INFO_ALL 

0x0F
Convenience value, enabling all the available different types of information.

EVENT_INFO_MORE 

0x80

When set, indicates more events matching APP_MSG_RESPONSE_GETEVENTS_T.eventMask are available, that did not fit in the response.

EVENT_INFO_INDEX 

0x01
When set, include the absolute index number of the event.

  • Size: 2 bytes, LSByte first
EVENT_INFO_TIMESTAMP 

0x02
When set, include the absolute timestamp when the event occurred.

  • Size: 4 bytes, LSByte first
EVENT_INFO_ENUM 

0x04
When set, include the event number n. This is equal to log_2 of the enumeration value of type APP_MSG_EVENT_T. The enumeration value can be retrieved by shifting 1
positions to the left.

  • Size: 1 byte
EVENT_INFO_DATA 

0x08
When set, include the extra data stored with the event, if any.

  • Size: variable, depending on the event being stored.
Note
The size is not passed along. It is assumed the tag reader knows this in advance, as it knows how to interpret this data.
EVENT_INFO_COUNT 

4
Number of possible types of event information. Not to be used as a possible enumeration value. Use this in for loops or to define array sizes.

EVENT_INFO_NONE 

0x00
When no bits are set, no information about the events is included. Use this if you want to learn only about count of events that match APP_MSG_RESPONSE_GETEVENTS_T.eventMask.

EVENT_INFO_ALL 

0x0F
Convenience value, enabling all the available different types of information.

EVENT_INFO_MORE 

0x80

When set, indicates more events matching APP_MSG_RESPONSE_GETEVENTS_T.eventMask are available, that did not fit in the response.

EVENT_INFO_INDEX 

0x01
When set, include the absolute index number of the event.

  • Size: 2 bytes, LSByte first
EVENT_INFO_TIMESTAMP 

0x02
When set, include the absolute timestamp when the event occurred.

  • Size: 4 bytes, LSByte first
EVENT_INFO_ENUM 

0x04
When set, include the event number n. This is equal to log_2 of the enumeration value of type APP_MSG_EVENT_T. The enumeration value can be retrieved by shifting 1
positions to the left.

  • Size: 1 byte
EVENT_INFO_DATA 

0x08
When set, include the extra data stored with the event, if any.

  • Size: variable, depending on the event being stored.
Note
The size is not passed along. It is assumed the tag reader knows this in advance, as it knows how to interpret this data.
EVENT_INFO_COUNT 

4
Number of possible types of event information. Not to be used as a possible enumeration value. Use this in for loops or to define array sizes.

EVENT_INFO_NONE 

0x00
When no bits are set, no information about the events is included. Use this if you want to learn only about count of events that match APP_MSG_RESPONSE_GETEVENTS_T.eventMask.

EVENT_INFO_ALL 

0x0F
Convenience value, enabling all the available different types of information.

EVENT_INFO_MORE 

0x80

When set, indicates more events matching APP_MSG_RESPONSE_GETEVENTS_T.eventMask are available, that did not fit in the response.

◆ APP_MSG_PERIODICDATA_TYPE_T

The different types of data that is sampled periodically.

See also
APP_MSG_ID_GETPERIODICDATA
Enumerator
APP_MSG_PERIODICDATA_TYPE_HUMIDITY 

0x01
Temperature

APP_MSG_PERIODICDATA_TYPE_COUNT 

0x02
Humidity 2
Number of possible types of periodic data. Not to be used as a possible event. Use this in for loops or to define array sizes.

APP_MSG_PERIODICDATA_TYPE_ALL 

0x03
Convenience value, selecting all available types.

APP_MSG_PERIODICDATA_TYPE_HUMIDITY 

0x01
Temperature

APP_MSG_PERIODICDATA_TYPE_COUNT 

0x02
Humidity 2
Number of possible types of periodic data. Not to be used as a possible event. Use this in for loops or to define array sizes.

APP_MSG_PERIODICDATA_TYPE_ALL 

0x03
Convenience value, selecting all available types.

APP_MSG_PERIODICDATA_TYPE_HUMIDITY 

0x01
Temperature

APP_MSG_PERIODICDATA_TYPE_COUNT 

0x02
Humidity 2
Number of possible types of periodic data. Not to be used as a possible event. Use this in for loops or to define array sizes.

APP_MSG_PERIODICDATA_TYPE_ALL 

0x03
Convenience value, selecting all available types.

◆ APP_MSG_PERIODICDATA_FORMAT_T

The different formats periodic data is represented in.

See also
APP_MSG_ID_GETPERIODICDATA
Enumerator
APP_MSG_PERIODICDATA_FORMAT_FULL 

Each data sample takes up 1 or more full bytes:

  • For temperature, each sample takes up two bytes, LSByte first. The value is expressed in deci-Celsius. For example, a temperature of 34.5C is encoded as 345 decimal, giving two bytes 59h 01h.
  • For humidity, each sample takes up 1 byte. The value is rounded to the nearest halve percentage, then expressed in halve-percentages. For example, a humidity of 45.6% is encoded as 91, giving 1 byte 5Bh.
    Note
    This type can be chosen with any chosen combination of APP_MSG_PERIODICDATA_TYPE_T values.
APP_MSG_PERIODICDATA_FORMAT_RAW 

The data is returned as it is stored in memory: an exact copy of the raw bytes from the non-volatile memories EEPROM and FLASH used for data storage are returned. The data may be converted, mapped, lossless or lossy compressed. It is up to the tag reader to know and understand the storage format and to be able to convert it back to the sampled data.

Warning
While this allows for much faster transmission of all the data, it also ties the implementation of the firmware application much tighter to the implementation of the tag reader host application.
Note
This type can only be chosen in combination with APP_MSG_PERIODICDATA_TYPE_ALL
APP_MSG_PERIODICDATA_FORMAT_FULL 

Each data sample takes up 1 or more full bytes:

  • For temperature, each sample takes up two bytes, LSByte first. The value is expressed in deci-Celsius. For example, a temperature of 34.5C is encoded as 345 decimal, giving two bytes 59h 01h.
  • For humidity, each sample takes up 1 byte. The value is rounded to the nearest halve percentage, then expressed in halve-percentages. For example, a humidity of 45.6% is encoded as 91, giving 1 byte 5Bh.
    Note
    This type can be chosen with any chosen combination of APP_MSG_PERIODICDATA_TYPE_T values.
APP_MSG_PERIODICDATA_FORMAT_RAW 

The data is returned as it is stored in memory: an exact copy of the raw bytes from the non-volatile memories EEPROM and FLASH used for data storage are returned. The data may be converted, mapped, lossless or lossy compressed. It is up to the tag reader to know and understand the storage format and to be able to convert it back to the sampled data.

Warning
While this allows for much faster transmission of all the data, it also ties the implementation of the firmware application much tighter to the implementation of the tag reader host application.
Note
This type can only be chosen in combination with APP_MSG_PERIODICDATA_TYPE_ALL
APP_MSG_PERIODICDATA_FORMAT_FULL 

Each data sample takes up 1 or more full bytes:

  • For temperature, each sample takes up two bytes, LSByte first. The value is expressed in deci-Celsius. For example, a temperature of 34.5C is encoded as 345 decimal, giving two bytes 59h 01h.
  • For humidity, each sample takes up 1 byte. The value is rounded to the nearest halve percentage, then expressed in halve-percentages. For example, a humidity of 45.6% is encoded as 91, giving 1 byte 5Bh.
    Note
    This type can be chosen with any chosen combination of APP_MSG_PERIODICDATA_TYPE_T values.
APP_MSG_PERIODICDATA_FORMAT_RAW 

The data is returned as it is stored in memory: an exact copy of the raw bytes from the non-volatile memories EEPROM and FLASH used for data storage are returned. The data may be converted, mapped, lossless or lossy compressed. It is up to the tag reader to know and understand the storage format and to be able to convert it back to the sampled data.

Warning
While this allows for much faster transmission of all the data, it also ties the implementation of the firmware application much tighter to the implementation of the tag reader host application.
Note
This type can only be chosen in combination with APP_MSG_PERIODICDATA_TYPE_ALL

◆ APP_MSG_TSEN_RESOLUTION_T

Possible resolutions for the Temperature Sensor, used in APP_MSG_CMD_MEASURETEMPERATURE_T.resolution

Note
Regardless of the resolution, the accuracy of the sensor is always +-0.3°C between 0°C and 40°C, and +-0.5°C between -40°C to +85°C.
See also
APP_MSG_ID_MEASURETEMPERATURE
Enumerator
APP_MSG_TSEN_RESOLUTION_7BITS 

0x02
7 bits resolution: +-0.8°C; requires a conversion time of 4 ms.

APP_MSG_TSEN_RESOLUTION_8BITS 

0x03
8 bits resolution: +-0.4°C; requires a conversion time of 7 ms.

APP_MSG_TSEN_RESOLUTION_9BITS 

0x04
9 bits resolution: +-0.2°C; requires a conversion time of 14 ms.

APP_MSG_TSEN_RESOLUTION_10BITS 

0x05
10 bits resolution: +-0.1°C; requires a conversion time of 26 ms.

APP_MSG_TSEN_RESOLUTION_11BITS 

0x06
11 bits resolution: +-0.05°C; requires a conversion time of 50 ms.

APP_MSG_TSEN_RESOLUTION_12BITS 

0x07
12 bits resolution: +-0.025°C; requires a conversion time of 100 ms.

APP_MSG_TSEN_RESOLUTION_7BITS 

0x02
7 bits resolution: +-0.8°C; requires a conversion time of 4 ms.

APP_MSG_TSEN_RESOLUTION_8BITS 

0x03
8 bits resolution: +-0.4°C; requires a conversion time of 7 ms.

APP_MSG_TSEN_RESOLUTION_9BITS 

0x04
9 bits resolution: +-0.2°C; requires a conversion time of 14 ms.

APP_MSG_TSEN_RESOLUTION_10BITS 

0x05
10 bits resolution: +-0.1°C; requires a conversion time of 26 ms.

APP_MSG_TSEN_RESOLUTION_11BITS 

0x06
11 bits resolution: +-0.05°C; requires a conversion time of 50 ms.

APP_MSG_TSEN_RESOLUTION_12BITS 

0x07
12 bits resolution: +-0.025°C; requires a conversion time of 100 ms.

APP_MSG_TSEN_RESOLUTION_7BITS 

0x02
7 bits resolution: +-0.8°C; requires a conversion time of 4 ms.

APP_MSG_TSEN_RESOLUTION_8BITS 

0x03
8 bits resolution: +-0.4°C; requires a conversion time of 7 ms.

APP_MSG_TSEN_RESOLUTION_9BITS 

0x04
9 bits resolution: +-0.2°C; requires a conversion time of 14 ms.

APP_MSG_TSEN_RESOLUTION_10BITS 

0x05
10 bits resolution: +-0.1°C; requires a conversion time of 26 ms.

APP_MSG_TSEN_RESOLUTION_11BITS 

0x06
11 bits resolution: +-0.05°C; requires a conversion time of 50 ms.

APP_MSG_TSEN_RESOLUTION_12BITS 

0x07
12 bits resolution: +-0.025°C; requires a conversion time of 100 ms.

APP_MSG_TSEN_RESOLUTION_7BITS 

0x02
7 bits resolution: +-0.8°C; requires a conversion time of 4 ms.

APP_MSG_TSEN_RESOLUTION_8BITS 

0x03
8 bits resolution: +-0.4°C; requires a conversion time of 7 ms.

APP_MSG_TSEN_RESOLUTION_9BITS 

0x04
9 bits resolution: +-0.2°C; requires a conversion time of 14 ms.

APP_MSG_TSEN_RESOLUTION_10BITS 

0x05
10 bits resolution: +-0.1°C; requires a conversion time of 26 ms.

APP_MSG_TSEN_RESOLUTION_11BITS 

0x06
11 bits resolution: +-0.05°C; requires a conversion time of 50 ms.

APP_MSG_TSEN_RESOLUTION_12BITS 

0x07
12 bits resolution: +-0.025°C; requires a conversion time of 100 ms.