Mailbox Server Plugin#
APIs for mailbox server.
Mailbox protocol is designed for devices that can't be online on the network all the time. The most common example for this is a sleepy end device.
Mailbox clients and the server can submit messages into the mailbox, which is stored in RAM on the mailbox server. Clients can then query the mailbox server for available messages.
The mailbox server will notify clients who submit messages when a message was delivered or when it couldn't be delivered due to an error.
Mailbox uses a plugin-configurable protocol endpoint, which is 15 by default.
The server can also configure the size of the mailbox (in number of packets, 25 by default) and the packet timeout, after which the server drops the message and notifies the source of the error.
The mailbox protocol uses standard data messages, so in case of sleepy end devices, it will use the indirect queue. This means that if a sleepy end device sends a request to a mailbox server, the end device should poll for the response.
Note
Mailbox is not available in MAC mode due to the lack of endpoints.
See mailbox-server.h and mailbox-server.c for source code.
Callbacks#
Mailbox Server Message Delivered Callback.
Functions#
Add a message to the mailbox server queue. The message is stored in the internal queue until the destination node queries the mailbox server node for messages or upon timeout.
Callbacks Documentation#
emberAfPluginMailboxServerMessageDeliveredCallback#
void emberAfPluginMailboxServerMessageDeliveredCallback (EmberAfMailboxStatus status, EmberNodeId messageDestination, uint8_t tag)
Mailbox Server Message Delivered Callback.
[in] | status | An EmberAfMailboxStatus value of:
|
[in] | messageDestination | The node ID of the destination. |
[in] | tag | The tag value passed in the emberAfPluginMailboxServerAddMessage() API. |
This callback is invoked at the server when a message submitted locally by the server was successfully delivered or when it timed-out.
See Also
110
of file /mnt/raid/workspaces/ws.Q8qnkBLX2/overlay/gsdk/protocol/flex/mailbox/mailbox-server/mailbox-server.h
Function Documentation#
emberAfPluginMailboxServerAddMessage#
EmberAfMailboxStatus emberAfPluginMailboxServerAddMessage (EmberNodeId destination, uint8_t * message, EmberMessageLength messageLength, uint8_t tag, bool useSecurity)
Add a message to the mailbox server queue. The message is stored in the internal queue until the destination node queries the mailbox server node for messages or upon timeout.
[in] | destination | The node ID of the destination for this data message. |
[in] | message | A pointer to the message to be enqueued. |
[in] | messageLength | The length in bytes of the message to be enqueued. |
[in] | tag | A tag value which will be returned in the corresponding emberAfPluginMailboxServerMessageDeliveredCallback() callback. The application can use to match the callbacks with the call. |
[in] | useSecurity | Set it true if the data message should be sent to the server using security. |
Returns
An EmberAfMailboxStatus value of:
EMBER_MAILBOX_STATUS_SUCCESS if the message was successfully added to the packet queue.
EMBER_MAILBOX_STATUS_INVALID_CALL if the passed message is invalid.
EMBER_MAILBOX_STATUS_INVALID_ADDRESS if the passed destination address is invalid.
EMBER_MAILBOX_STATUS_MESSAGE_TOO_LONG if the payload size of the passed message exceeds the maximum allowable payload for the passed transmission options.
EMBER_MAILBOX_STATUS_MESSAGE_TABLE_FULL if the packet table is already full.
EMBER_MAILBOX_STATUS_MESSAGE_NO_BUFFERS if not enough memory buffers are available for storing the message content.
See Also
79
of file /mnt/raid/workspaces/ws.Q8qnkBLX2/overlay/gsdk/protocol/flex/mailbox/mailbox-server/mailbox-server.h