# Mailbox protocol (ID 5)
The Mailbox Protocol allows sleepy devices to retrieve messages during a connection to a Gateway. Gateway devices MAY choose to implement the Mailbox Protocol.
# Message structure
Protocol message structure for Request messages:
Type Header (THdr) 1 byte | Parameter 1 byte | Command specific payload 0-58 bytes |
---|
Some commands takes a parameter, like "Get message number 1" - here "Get message" is the command and '1' is the parameter.
Protocol message structure for Response messages:
Type Header (THdr) 1 byte | Status 1 byte | Command specific payload 0-58 bytes |
---|
All responses contain a return status code. It indicates to the requesting device if the request was a success or not. 0 (zero) is returned if the request was successful otherwise a negative number is returned to indicate the failure code.
# Type Header (THdr)
The Type Header (THdr) is defined as follows:
Reserved [7:6] | Proprietary extentions [5] | Command [4:1] | Direction [0] |
---|
The 5-bit Command field is defined in the table below, the direction bit is:
- 0 - Request
- 1 - Reply
# Commands
Command | Description | Request parameter | Response payload |
---|---|---|---|
0x00 | Reserved | ||
0x01 | Create message | Receiver address | Message contents |
0x02 | Number of messages | Number of messages (uint8) | |
0x03 | Retrieve message N | Message number | Message contents |
0x04 | Delete message N | Message number | |
0x04 - 0x1F | Reserved |
# Status codes
Status code | Description |
---|---|
0 | Reserved |
>0 | Error |