Ember Connect APIs and handlers for sending and receiving messages. See Messaging for documentation. More...

Macros

#define EMBER_MAX_UNSECURED_APPLICATION_PAYLOAD_LENGTH
 
#define EMBER_MAX_SECURED_APPLICATION_PAYLOAD_LENGTH
 
#define EMBER_MAX_ENDPOINT
 The maximum allowed endpoint value. More...
 

Handlers

void emberMessageSentHandler (EmberStatus status, EmberOutgoingMessage *message)
 A callback invoked when the stack has completed sending a message. More...
 
void emberMacMessageSentHandler (EmberStatus status, EmberOutgoingMacMessage *message)
 A callback 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)
 A callback invoked when a packet has been received. More...
 
void emberIncomingMacMessageHandler (EmberIncomingMacMessage *message)
 A callback 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)
 Sends a message to the passed destination short ID. More...
 
EmberStatus emberMacMessageSend (EmberMacFrame *macFrame, uint8_t messageTag, EmberMessageLength messageLength, uint8_t *message, EmberMessageOptions options)
 Creates 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)
 Sends 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)
 Sets 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)
 Purges all indirect transmissions from the indirect message queue. More...
 
uint8_t emberGetMaximumPayloadLength (EmberMacAddressMode srcAddressMode, EmberMacAddressMode dstAddressMode, bool interpan, bool secured)
 Returns 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

Ember Connect APIs and handlers for sending and receiving messages. See Messaging for documentation.

License

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

Ember Connect APIs sending and receiving messages.

See message.h for source code.

Macro Definition Documentation

#define EMBER_MAX_ENDPOINT

The maximum allowed endpoint value.

Definition at line 43 of file message.h.

#define EMBER_MAX_SECURED_APPLICATION_PAYLOAD_LENGTH
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 39 of file message.h.

#define EMBER_MAX_UNSECURED_APPLICATION_PAYLOAD_LENGTH
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 33 of file message.h.

Function Documentation

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

Returns 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]srcAddressModeAn 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]dstAddressModeAn 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]intrapanIndicates 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]securedIndicates whether the frame should be secured or not.
Returns
an invalid value of 0xFF if the node is currently active on a network or any of the passed parameters are invalid. Otherise, it returns the maximum payload length achievable according to the passed parameters.
void emberIncomingMacMessageHandler ( EmberIncomingMacMessage message)

A callback invoked when a node of EMBER_MAC_MODE_DEVICE type or EMBER_MAC_MODE_SLEEPY_DEVICE has received a MAC frame.

Parameters
[in]messageAn ::EmberMacIncomingMessage describing the incoming packet.
void emberIncomingMessageHandler ( EmberIncomingMessage message)

A callback invoked when a packet has been received.

Parameters
[in]messageAn EmberIncomingMessage describing the incoming packet.
EmberStatus emberMacMessageSend ( EmberMacFrame macFrame,
uint8_t  messageTag,
EmberMessageLength  messageLength,
uint8_t *  message,
EmberMessageOptions  options 
)

Creates 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]macFrameA 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]messageTagA value chosen by the application. This value will be passed in the corresponding emberMacMessageSentHandler() call.
[in]messageLengthThe 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]messageA pointer to an array of bytes containing the message payload.
[in]optionsSpecifies the EmberMessageOptions for the outgoing message.
Returns
an EmberStatus value of:
void emberMacMessageSentHandler ( EmberStatus  status,
EmberOutgoingMacMessage message 
)

A callback 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]statusAn EmberStatus value of:
[in]messageAn EmberOutgoingMacMessage describing the outgoing MAC frame.
EmberStatus emberMessageSend ( EmberNodeId  destination,
uint8_t  endpoint,
uint8_t  messageTag,
EmberMessageLength  messageLength,
uint8_t *  message,
EmberMessageOptions  options 
)

Sends a message to the passed destination short ID.

Parameters
[in]destinationThe destination node short ID.
[in]endpointThe destination endpoint of the outgoing message. This value can't exceed EMBER_MAX_ENDPOINT.
[in]messageTagA value chosen by the application. This value will be passed in the corresponding emberMessageSentHandler() call.
[in]messageLengthThe size in bytes of the message payload. Use the emberGetMaximumPayloadLength() API to determine the maximum message length allowed.
[in]messageA pointer to an array of bytes containing the message payload.
[in]optionsSpecifies the EmberMessageOptions for the outgoing message.
Returns
an EmberStatus value of:
void emberMessageSentHandler ( EmberStatus  status,
EmberOutgoingMessage message 
)

A callback invoked when the stack has completed sending a message.

Parameters
[in]statusAn EmberStatus value of:
[in]messageAn EmberOutgoingMessage describing the outgoing packet.
EmberStatus emberPollForData ( void  )

Sends 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:
EmberStatus emberPurgeIndirectMessages ( void  )

Purges all indirect transmissions from the indirect message queue.

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

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