By default, the system reads bytes from your message from left to right. You can simply reverse the order (e.g. read bytes of your message from right to left) by adding “r” before the data type.
Message from device as seen in SIGFOX portal:
command C3896.int will read 7044b200 and convert to int value
command C3896.rint will read 14bf4a13 and convert to int value
If you don’t specify index, values are read from the beginning (that means from the zero index). You can specify at which byte of the message your data are located, e.g. where to start reading from. Therefore, for example, C3896.int will start reading data from the third byte of the message and will read 4 bytes, converting them to integers. The index always starts from 0.
For integer data types (char, sint, int) you can also extract bits. To do so add .BitNo after the data type. For example, this command C3896.char.2 will read the second character from the message and extract the third bit. Therefore, you will get 0 or 1 as a result, depending on the bit status.
Moreover, you can control some advanced settings concerning your device by adding a JSON type string after the tag. The syntax is as follows
Currently, only the option timeout is supported; in the future, more options will be added based on customer requirements. Timeout specifies the maximum age of the message to consider device communication. The value is in seconds.
- C3896.char read first char of the message
- C3896.char read 11th character of the message (indexing is always from zero)
- C3896.int read first four bytes of message and convert them to integers
- C3896.int read four bytes of the message starting at the third character and convert them to integers
- C3896.char.0 read the second character of the message and return 1st bit of it