Connect APIs and handlers for sending and receiving messages. More...

Macros

#define EMBER_MAX_UNSECURED_APPLICATION_PAYLOAD_LENGTH 111
#define EMBER_MAX_SECURED_APPLICATION_PAYLOAD_LENGTH 102
#define EMBER_MAX_ENDPOINT 0xF
The maximum allowed endpoint value. More...

Handlers

The Application Framework implements all handlers, directly calling their associated callbacks. By default, Connect projects declare such callbacks as stubs in flex-callbacks-stubs.c. Hence, to use an enabled Connect feature, applications should replace the stub with their own implementation of the associated callback (typically in flex-callbacks.c). See UG235.04 for more info.

void emberMessageSentHandler ( EmberStatus status, EmberOutgoingMessage *message)
This handler is invoked when the stack has completed sending a message. More...
void emberMacMessageSentHandler ( EmberStatus status, EmberOutgoingMacMessage *message)
This handler is invoked when a node of EMBER_MAC_MODE_DEVICE type or EMBER_MAC_MODE_SLEEPY_DEVICE type has completed sending a MAC frame. More...
void emberIncomingMessageHandler ( EmberIncomingMessage *message)
This handler is invoked when a packet has been received from a node type other than EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE . More...
void emberIncomingMacMessageHandler ( EmberIncomingMacMessage *message)
This handler is invoked when a node of EMBER_MAC_MODE_DEVICE type or EMBER_MAC_MODE_SLEEPY_DEVICE has received a MAC frame. More...

APIs

EmberStatus emberMessageSend ( EmberNodeId destination, uint8_t endpoint, uint8_t messageTag, EmberMessageLength messageLength, uint8_t *message, EmberMessageOptions options)
Send a message to the passed destination short ID. More...
EmberStatus emberMacMessageSend ( EmberMacFrame *macFrame, uint8_t messageTag, EmberMessageLength messageLength, uint8_t *message, EmberMessageOptions options)
Create a MAC level frame and sends it to the passed destination. This API can only be used for nodes of EMBER_MAC_MODE_DEVICE node type or EMBER_MAC_MODE_SLEEPY_DEVICE node type. More...
EmberStatus emberPollForData (void)
Send a data request command to the parent node. Note that if the node short ID is a value of EMBER_USE_LONG_ADDRESS , the node shall use its long ID as source address. More...
EmberStatus emberSetPollDestinationAddress ( EmberMacAddress *destination)
Set data polls destination address for nodes of EMBER_MAC_MODE_DEVICE node type or EMBER_MAC_MODE_SLEEPY_DEVICE node type. More...
EmberStatus emberPurgeIndirectMessages (void)
Purge all indirect transmissions from the indirect message queue. More...
EmberStatus emberSetIndirectQueueTimeout (uint32_t timeoutMs)
Set indirect queue timeout value. The indirect queue timeout is set by default to EMBER_INDIRECT_TRANSMISSION_TIMEOUT_MS . More...
uint8_t emberGetMaximumPayloadLength ( EmberMacAddressMode srcAddressMode, EmberMacAddressMode dstAddressMode, bool interpan, bool secured)
Return the maximum payload according to the passed source and destination addressing modes, the passed secured flag, and the current configuration of the node. More...

Detailed Description

Connect APIs and handlers for sending and receiving messages.

Note that MAC mode and Extended star/direct mode use different APIs for messaging.

See message.h for source code.

Macro Definition Documentation

EMBER_MAX_ENDPOINT

#define EMBER_MAX_ENDPOINT 0xF

The maximum allowed endpoint value.

Definition at line 45 of file message.h .

EMBER_MAX_SECURED_APPLICATION_PAYLOAD_LENGTH

#define EMBER_MAX_SECURED_APPLICATION_PAYLOAD_LENGTH 102
Deprecated:
The maximum length in bytes of the application payload for a secured message. This define has been deprecated, you should use the emberGetMaximumPayloadLength API instead.

Definition at line 41 of file message.h .

EMBER_MAX_UNSECURED_APPLICATION_PAYLOAD_LENGTH

#define EMBER_MAX_UNSECURED_APPLICATION_PAYLOAD_LENGTH 111
Deprecated:
The maximum length in bytes of the application payload for an unsecured message. This define has been deprecated, you should use the emberGetMaximumPayloadLength API instead.

Definition at line 35 of file message.h .

Function Documentation

emberGetMaximumPayloadLength()

uint8_t emberGetMaximumPayloadLength ( EmberMacAddressMode srcAddressMode,
EmberMacAddressMode dstAddressMode,
bool interpan,
bool secured
)

Return the maximum payload according to the passed source and destination addressing modes, the passed secured flag, and the current configuration of the node.

Parameters
[in] srcAddressMode An EmberMacAddressMode value indicating the mode of the source address. Note, this parameter is only meaningful if the node was started as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE .
[in] dstAddressMode An EmberMacAddressMode value indicating the mode of the destination address. Note, this parameter is only meaningful if the node was started as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE .
[in] interpan Indicates whether the frame is an interpan frame or not. Note, this parameter is only meaningful if the node was started as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE .
[in] secured Indicates whether the frame should be secured or not.
Returns
The maximum payload length in bytes achievable according to the passed parameters or 0xFF if the node is currently active on a network or any of the passed parameters are invalid.

emberIncomingMacMessageHandler()

void emberIncomingMacMessageHandler ( EmberIncomingMacMessage * message )

This handler is invoked when a node of EMBER_MAC_MODE_DEVICE type or EMBER_MAC_MODE_SLEEPY_DEVICE has received a MAC frame.

Parameters
[in] message An EmberIncomingMacMessage describing the incoming packet.
Warning
Implement associated callback emberAfIncomingMacMessageCallback() to use. See Handlers for additional information.

emberIncomingMessageHandler()

void emberIncomingMessageHandler ( EmberIncomingMessage * message )

This handler is invoked when a packet has been received from a node type other than EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE .

Parameters
[in] message An EmberIncomingMessage describing the incoming packet.
Warning
Implement associated callback emberAfIncomingMessageCallback() to use. See Handlers for additional information.

emberMacMessageSend()

EmberStatus emberMacMessageSend ( EmberMacFrame * macFrame,
uint8_t messageTag,
EmberMessageLength messageLength,
uint8_t * message,
EmberMessageOptions options
)

Create a MAC level frame and sends it to the passed destination. This API can only be used for nodes of EMBER_MAC_MODE_DEVICE node type or EMBER_MAC_MODE_SLEEPY_DEVICE node type.

Parameters
[in] macFrame A pointer to an EmberMacFrame struct that specifies the source and destination addresses and the source and destination PAN IDs for the message to be sent. Note that if the source/destination PAN ID is not specified, it defaults to the node's PAN ID. Also, the destination address mode must be either EMBER_MAC_ADDRESS_MODE_SHORT or EMBER_MAC_ADDRESS_MODE_LONG .
[in] messageTag A value chosen by the application. This value will be passed in the corresponding emberMacMessageSentHandler() call.
[in] messageLength The size in bytes of the message payload. The application can use the emberGetMaximumPayloadLength() API to determine the maximum allowable payload, given a permutation of source and destination addressing and other TX options.
[in] message A pointer to an array of bytes containing the message payload.
[in] options Specifies the EmberMessageOptions for the outgoing message.
Returns
an EmberStatus value of:

emberMacMessageSentHandler()

void emberMacMessageSentHandler ( EmberStatus status,
EmberOutgoingMacMessage * message
)

This handler is invoked when a node of EMBER_MAC_MODE_DEVICE type or EMBER_MAC_MODE_SLEEPY_DEVICE type has completed sending a MAC frame.

Parameters
[in] status An EmberStatus value of:
[in] message An EmberOutgoingMacMessage describing the outgoing MAC frame.
Warning
Implement associated callback emberAfMacMessageSentCallback() to use. See Handlers for additional information.

emberMessageSend()

EmberStatus emberMessageSend ( EmberNodeId destination,
uint8_t endpoint,
uint8_t messageTag,
EmberMessageLength messageLength,
uint8_t * message,
EmberMessageOptions options
)

Send a message to the passed destination short ID.

Parameters
[in] destination The destination node short ID.
[in] endpoint The destination endpoint of the outgoing message. This value can't exceed EMBER_MAX_ENDPOINT .
[in] messageTag A value chosen by the application. This value will be passed in the corresponding emberMessageSentHandler() call.
[in] messageLength The size of the message payload in bytes. Use the emberGetMaximumPayloadLength() API to determine the maximum message length allowed.
[in] message A pointer to an array of bytes containing the message payload.
[in] options Specifies the EmberMessageOptions for the outgoing message.
Returns
an EmberStatus value of:

emberMessageSentHandler()

void emberMessageSentHandler ( EmberStatus status,
EmberOutgoingMessage * message
)

This handler is invoked when the stack has completed sending a message.

Parameters
[in] status An EmberStatus value of:
[in] message An EmberOutgoingMessage describing the outgoing packet.
Warning
Implement associated callback emberAfMessageSentCallback() to use. See Handlers for additional information.

emberPollForData()

EmberStatus emberPollForData ( void )

Send a data request command to the parent node. Note that if the node short ID is a value of EMBER_USE_LONG_ADDRESS , the node shall use its long ID as source address.

Returns
and EmberStatus value of:

emberPurgeIndirectMessages()

EmberStatus emberPurgeIndirectMessages ( void )

Purge all indirect transmissions from the indirect message queue.

Returns
an EmberStatus value of EMBER_SUCCESS if all indirect messages were purged, or another EmberStatus value indicating the reason of failure.

emberSetIndirectQueueTimeout()

EmberStatus emberSetIndirectQueueTimeout ( uint32_t timeoutMs )

Set indirect queue timeout value. The indirect queue timeout is set by default to EMBER_INDIRECT_TRANSMISSION_TIMEOUT_MS .

Parameters
timeoutMs The timeout in milliseconds to be set.
Returns
an EmberStatus value of EMBER_SUCCESS if the passed timeout was successfully set, or a value of EMBER_INVALID_CALL if the passed value is invalid.

emberSetPollDestinationAddress()

EmberStatus emberSetPollDestinationAddress ( EmberMacAddress * destination )

Set data polls destination address for nodes of EMBER_MAC_MODE_DEVICE node type or EMBER_MAC_MODE_SLEEPY_DEVICE node type.

Returns
and EmberStatus value of EMBER_SUCCESS if the data poll destination was correctly set, a value of EMBER_INVALID_CALL otherwise.