APIs for mailbox server. More...

Functions

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. More...
 

Callbacks

void emberAfPluginMailboxServerMessageDeliveredCallback (EmberAfMailboxStatus status, EmberNodeId messageDestination, uint8_t tag)
 Mailbox Server Message Delivered Callback. More...
 

Detailed Description

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.

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.

Parameters
[in]destinationThe node ID of the destination for this data message.
[in]messageA pointer to the message to be enqueued.
[in]messageLengthThe length in bytes of the message to be enqueued.
[in]tagA tag value which will be returned in the corresponding emberAfPluginMailboxServerMessageDeliveredCallback() callback. The application can use to match the callbacks with the call.
[in]useSecuritySet it true if the data message should be sent to the server using security.
Returns
An EmberAfMailboxStatus value of:
See also
emberAfPluginMailboxClientMessageSubmit()

◆ emberAfPluginMailboxServerMessageDeliveredCallback()

void emberAfPluginMailboxServerMessageDeliveredCallback ( EmberAfMailboxStatus  status,
EmberNodeId  messageDestination,
uint8_t  tag 
)

Mailbox Server Message Delivered Callback.

This callback is invoked at the server when a message submitted locally by the server was successfully delivered or when it timed-out.

Parameters
[in]statusAn EmberAfMailboxStatus value of:
[in]messageDestinationThe node ID of the destination.
[in]tagThe tag value passed in the emberAfPluginMailboxServerAddMessage() API.
See also
emberAfPluginMailboxClientMessageDeliveredCallback()