Data messages
Data messages¶
This section describes the methods of sending data messages in the network. We will show that this is much simpler than you could ever have expected.
Sending data¶
To send data to the network the DATA_SEND
message is used. By sending this command to the Mira module, the data payload
will be sent over the wireless network to the node being addressed.
Message class | Message type | Data length | Data |
---|---|---|---|
0x3 | 0x3 | n | Data provided by application. |
Receiving data¶
When data is received from the network, the Mira module will generate a DATA_RECEIVED
message.
Message class | Message type | Data length | Data |
---|---|---|---|
0x3 | 0x4 | n | Data provided by the sending application. |
Receiving data from sleepy nodes¶
If the data message is originating from a sleepy node, then the Mira module will instead generate a SLEEPY_DATA_RECEIVED
Message class | Message type | Data length | Data |
---|---|---|---|
0x3 | 0x5 | n | Sleepy data provided by the sending application. |
The sleepy data structure is defined as
Parameter | Data type | Data size | Description |
---|---|---|---|
node_eui | uint8_t | 8 | Node's EUI64 address |
router_eui | uint8_t | 8 | Router node's EUID64 address |
data | uint8_t | n | message data |
Sending data to sleepy nodes¶
Data to sleepy nodes can be delivered in the form of mails, through the use of SLEEPY_DATA_MAIL
messages. Mails are short messages that are placed in route nodes that acts as as mailboxes.
Each router node (a non sleepy node) can hold one mail to sleepy node at any time, and up to eight mails in total. Care must be taken to not place more
mails before the sleepy nodes have checked their mailbox. Otherwise the old mail will be dropped and the new mail will be stored instead.
Each sleepy node will have the responsibility to periodically wake up and check the mailbox.
This messages shall be sent to a router node using the Adress
adressing mode.
Message class | Message type | Data length | Data |
---|---|---|---|
0x3 | 0x7 | n | Data provided by the sending application. |
The mail data structure is defined as
Parameter | Data type | Data size | Description |
---|---|---|---|
node_eui | uint8_t | 8 | Sleepy node's EUI64 address |
seq_no | uint8_t | 1 | Mail sequence number. This shall be incrememnted by one for each mail to a particular node. The value 0xFF is reserved and shall not be used. |
data | uint8_t | n | message data, up to 16 bytes. |
Response codes¶
When sending a message to the Mira module, the application should expect to receive response codes from the Mira module. These response codes will be sent from the Mira module to the application as a response to every request. The application shall not send responses to the Mira module.
Response type | Message class | Message type | Data type | Data length | Data |
---|---|---|---|---|---|
DATA_ACK | 0x3 | 0x1 | n/a | 0 | n/a |
DATA_ERROR | 0x3 | 0x2 | uint8_t | 1 | 0x02 – unknown message type |
0x03 – incorrect message size |
|||||
0x05 – invalid addressing mode |