EmberZNet API for sending and receiving messages. See Sending and Receiving Messages 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.

/***************************************************************************/
#ifndef SILABS_MESSAGE_H
#define SILABS_MESSAGE_H

uint8_t emberMaximumApsPayloadLength(void);

#define EMBER_APSC_MAX_ACK_WAIT_HOPS_MULTIPLIER_MS     50

#define EMBER_APSC_MAX_ACK_WAIT_TERMINAL_SECURITY_MS  100

extern uint16_t emberApsAckTimeoutMs;

EmberStatus emberSendMulticastWithAlias(EmberApsFrame *apsFrame,
                                        uint8_t radius,
                                        uint8_t nonmemberRadius,
                                        EmberMessageBuffer message,
                                        EmberNodeId alias,
                                        uint8_t sequence);

EmberStatus emberSendMulticast(EmberApsFrame *apsFrame,
                               uint8_t radius,
                               uint8_t nonmemberRadius,
                               EmberMessageBuffer message);

EmberStatus emberSendUnicast(EmberOutgoingMessageType type,
                             uint16_t indexOrDestination,
                             EmberApsFrame *apsFrame,
                             EmberMessageBuffer message);

EmberStatus emberSendBroadcast(EmberNodeId destination,
                               EmberApsFrame *apsFrame,
                               uint8_t radius,
                               EmberMessageBuffer message);

EmberStatus emberProxyBroadcast(EmberNodeId source,
                                EmberNodeId destination,
                                uint8_t sequence,
                                EmberApsFrame *apsFrame,
                                uint8_t radius,
                                EmberMessageBuffer message);

EmberStatus emberProxyNextBroadcastFromLong(uint8_t* euiSource);

EmberStatus emberSendManyToOneRouteRequest(uint16_t concentratorType,
                                           uint8_t radius);

EmberStatus emberGetSourceRouteTableEntry(uint8_t index,
                                          EmberNodeId *destination,
                                          uint8_t *closerIndex);

uint8_t emberGetSourceRouteTableFilledSize(void);

uint8_t emberGetSourceRouteTableTotalSize(void);

void emberIncomingManyToOneRouteRequestHandler(EmberNodeId source,
                                               EmberEUI64 longId,
                                               uint8_t cost);

void emberIncomingRouteErrorHandler(EmberStatus status,
                                    EmberNodeId target);

void emberIncomingNetworkStatusHandler(uint8_t errorCode,
                                       EmberNodeId target);

void emberOverrideIncomingRouteRecordHandler(EmberNodeId source,
                                             EmberEUI64 sourceEui,
                                             uint8_t relayCount,
                                             EmberMessageBuffer header,
                                             uint8_t relayListIndex,
                                             bool* consumed);

uint8_t emberOverrideAppendSourceRouteHandler(EmberNodeId destination,
                                              EmberMessageBuffer* header,
                                              bool* consumed);

void emberIncomingRouteRecordHandler(EmberNodeId source,
                                     EmberEUI64 sourceEui,
                                     uint8_t relayCount,
                                     EmberMessageBuffer header,
                                     uint8_t relayListIndex);

uint8_t emberAppendSourceRouteHandler(EmberNodeId destination,
                                      EmberMessageBuffer header);
EmberStatus emberCancelMessage(EmberMessageBuffer message);

void emberMessageSentHandler(EmberOutgoingMessageType type,
                             uint16_t indexOrDestination,
                             EmberApsFrame *apsFrame,
                             EmberMessageBuffer message,
                             EmberStatus status);

void emberIncomingMessageHandler(EmberIncomingMessageType type,
                                 EmberApsFrame *apsFrame,
                                 EmberMessageBuffer message);

EmberStatus emberGetLastHopLqi(uint8_t *lastHopLqi);

EmberStatus emberGetLastHopRssi(int8_t *lastHopRssi);

EmberStatus emberGetLastHopTimestamp(uint32_t *lastHopTimestamp);

EmberNodeId emberGetSender(void);

EmberStatus emberGetSenderEui64(EmberEUI64 senderEui64);

EmberStatus emberSendReply(uint16_t clusterId, EmberMessageBuffer reply);

void emberSetReplyFragmentData(uint16_t fragmentData);

bool emberAddressTableEntryIsActive(uint8_t addressTableIndex);

EmberStatus emberSetAddressTableRemoteEui64(uint8_t addressTableIndex,
                                            EmberEUI64 eui64);

void emberSetAddressTableRemoteNodeId(uint8_t addressTableIndex,
                                      EmberNodeId id);

void emberGetAddressTableRemoteEui64(uint8_t addressTableIndex,
                                     EmberEUI64 eui64);

EmberNodeId emberGetAddressTableRemoteNodeId(uint8_t addressTableIndex);

void emberSetExtendedTimeout(EmberEUI64 remoteEui64, bool extendedTimeout);

bool emberGetExtendedTimeout(EmberEUI64 remoteEui64);

void emberIdConflictHandler(EmberNodeId conflictingId);

bool emberPendingAckedMessages(void);

extern EmberMulticastTableEntry emberMulticastTable[];

extern uint8_t emberMulticastTableSize;

EmberStatus sl_zigbee_set_passive_ack_config(sl_passive_ack_config_enum_t config, uint8_t minAcksNeeded);

#define emberBroadcastSetMinAcksNeeded(minAcksNeeded) \
  sl_zigbee_set_passive_ack_config(SL_PASSIVE_ACK_THRESHOLD_WITH_REBROADCAST, minAcksNeeded)

EmberPacketAction emberPacketHandoffIncomingHandler(EmberZigbeePacketType packetType,
                                                    EmberMessageBuffer packetBuffer,
                                                    uint8_t index,
                                                    void *data);

EmberPacketAction emberPacketHandoffOutgoingHandler(EmberZigbeePacketType packetType,
                                                    EmberMessageBuffer packetBuffer,
                                                    uint8_t index,
                                                    void *data);

EmberPacketAction emberAfIncomingPacketFilterCallback(EmberZigbeePacketType packetType,
                                                      uint8_t* packetData,
                                                      uint8_t* size_p,
                                                      void *data);

EmberPacketAction emberAfOutgoingPacketFilterCallback(EmberZigbeePacketType packetType,
                                                      uint8_t* packetData,
                                                      uint8_t* size_p,
                                                      void* data);

EmberStatus slx_zigbee_add_to_incoming_network_queue(int8_t rssi,
                                                     uint8_t lqi,
                                                     const sl_nwk_packet_exchange_t *nwk_packet);

#endif // SILABS_MESSAGE_H

Macros#

#define

The per-hop delay allowed for in the calculation of the APS ACK timeout value. This is defined in the Zigbee specification. This times the maximum number of hops (EMBER_MAX_HOPS) plus the terminal encrypt/decrypt time is the timeout between retries of an APS ACKed message in milliseconds.

#define

The terminal encrypt/decrypt time allowed for in the calculation of the APS ACK timeout value. This is defined in the ZigBee specification.

#define

Set the number of broadcast passive acknowledgments required before terminating a broadcast transmission. A value of 0xFF causes the node to wait for all neighbors to re-broadcast the packet before terminating the transmission. The default value is 0xFF. API is kept for backwards compatibility.

Variables#

uint16_t

The APS ACK timeout value. The stack waits this amount of time between resends of APS retried messages. The default value is:

uint8_t

The number of entries in the multicast table.

Functions#

uint8_t

Return the maximum size of the payload that the Application Support sub-layer will accept.

emberSendMulticastWithAlias(EmberApsFrame *apsFrame, uint8_t radius, uint8_t nonmemberRadius, EmberMessageBuffer message, EmberNodeId alias, uint8_t sequence)

Send a multicast message for an alias source to all endpoints that share a specific multicast ID and are within a specified number of hops of the sender.

emberSendMulticast(EmberApsFrame *apsFrame, uint8_t radius, uint8_t nonmemberRadius, EmberMessageBuffer message)

Send a multicast message to all endpoints that share a specific multicast ID and are within a specified number of hops of the sender.

emberSendUnicast(EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame *apsFrame, EmberMessageBuffer message)

Send a unicast message per the Zigbee specification.

emberSendBroadcast(EmberNodeId destination, EmberApsFrame *apsFrame, uint8_t radius, EmberMessageBuffer message)

Send a broadcast message as per the ZigBee specification.

emberProxyBroadcast(EmberNodeId source, EmberNodeId destination, uint8_t sequence, EmberApsFrame *apsFrame, uint8_t radius, EmberMessageBuffer message)

Proxy a broadcast message for another node.

Proxy a broadcast message for another node.

emberSendManyToOneRouteRequest(uint16_t concentratorType, uint8_t radius)

Send a route request packet that creates routes from every node in the network back to this node.

emberGetSourceRouteTableEntry(uint8_t index, EmberNodeId *destination, uint8_t *closerIndex)

Return the source route table entry fields.

uint8_t

Return the number of filled entries in the source route table.

uint8_t

Return the source route table total size.

void
emberIncomingManyToOneRouteRequestHandler(EmberNodeId source, EmberEUI64 longId, uint8_t cost)

Indicate that a many-to-one route to the concentrator with the given short and long ID is available for use.

void
emberIncomingRouteErrorHandler(EmberStatus status, EmberNodeId target)

Invoke when a route error message is received.

void
emberIncomingNetworkStatusHandler(uint8_t errorCode, EmberNodeId target)

Invoke when a network status message is received that informs the application of the Over-the-Air error codes for the specific destination.

void
emberOverrideIncomingRouteRecordHandler(EmberNodeId source, EmberEUI64 sourceEui, uint8_t relayCount, EmberMessageBuffer header, uint8_t relayListIndex, bool *consumed)

SoC only. It reports the arrival of a route record command frame to the application.

uint8_t
emberOverrideAppendSourceRouteHandler(EmberNodeId destination, EmberMessageBuffer *header, bool *consumed)

SoC only. The application can implement this callback to supply source routes to outgoing messages.

void
emberIncomingRouteRecordHandler(EmberNodeId source, EmberEUI64 sourceEui, uint8_t relayCount, EmberMessageBuffer header, uint8_t relayListIndex)

DEPRECTAED emberOverrideIncomingRouteRecordHandler should be used Reports the arrival of a route record command frame to the application.

uint8_t
emberAppendSourceRouteHandler(EmberNodeId destination, EmberMessageBuffer header)

DEPRECATED emberOverrideAppendSourceRouteHandler should be used The application can implement this callback to supply source routes to outgoing messages.

emberCancelMessage(EmberMessageBuffer message)

DEPRECATED.

void
emberMessageSentHandler(EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame *apsFrame, EmberMessageBuffer message, EmberStatus status)

Invoke by the stack when it has completed sending a message.

void
emberIncomingMessageHandler(EmberIncomingMessageType type, EmberApsFrame *apsFrame, EmberMessageBuffer message)

Invoke by the EmberZNet stack when a message is received.

emberGetLastHopLqi(uint8_t *lastHopLqi)

Get the link quality from the node that last relayed the current message.

emberGetLastHopRssi(int8_t *lastHopRssi)

Get the receive signal strength indication (RSSI) for the current message.

emberGetLastHopTimestamp(uint32_t *lastHopTimestamp)

Get the receive timestamp (value of the MAC timer; ticks since up) of the moment when the Start Frame Delimiter (SFD) was received for the current message.

EmberNodeId

Return the node ID of the sender of the current incoming message.

emberGetSenderEui64(EmberEUI64 senderEui64)

Return the EUI64 of the sender of the current incoming message if the sender chose to include this information in the message. The EMBER_APS_OPTION_SOURCE_EUI64 bit in the options field of the APS frame of the incoming message indicates that the EUI64 is present in the message.

emberSendReply(uint16_t clusterId, EmberMessageBuffer reply)

Send a reply for an application that has received a unicast message.

void
emberSetReplyFragmentData(uint16_t fragmentData)

Set the fragment data to be used when sending a reply to a unicast message.

bool
emberAddressTableEntryIsActive(uint8_t addressTableIndex)

Indicate whether any messages are currently being sent using this address table entry.

emberSetAddressTableRemoteEui64(uint8_t addressTableIndex, EmberEUI64 eui64)

Set the EUI64 of an address table entry.

void
emberSetAddressTableRemoteNodeId(uint8_t addressTableIndex, EmberNodeId id)

Set the short ID of an address table entry.

void
emberGetAddressTableRemoteEui64(uint8_t addressTableIndex, EmberEUI64 eui64)

Get the EUI64 of an address table entry.

EmberNodeId
emberGetAddressTableRemoteNodeId(uint8_t addressTableIndex)

Get the short ID of an address table entry.

void
emberSetExtendedTimeout(EmberEUI64 remoteEui64, bool extendedTimeout)

Tell the stack whether or not the normal interval between retransmissions of a retried unicast message should be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.

bool
emberGetExtendedTimeout(EmberEUI64 remoteEui64)

Indicate whether or not the stack will extend the normal interval between retransmissions of a retried unicast message by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.

void
emberIdConflictHandler(EmberNodeId conflictingId)

Invoke by the EmberZNet stack when an ID conflict is discovered, that is, two different nodes in the network were found to be using the same short ID.

bool

Indicate whether there are pending messages in the APS retry queue.

sl_zigbee_set_passive_ack_config(sl_passive_ack_config_enum_t config, uint8_t minAcksNeeded)

Allows the higher layers to control the broadcast behavior of a routing device. The originating device will rebroadcast the maximum number of times and The configurations below only restrict the number of broadcasts from neighboring routers. The configuration settings must be done on each node.

emberPacketHandoffIncomingHandler(EmberZigbeePacketType packetType, EmberMessageBuffer packetBuffer, uint8_t index, void *data)

Intercept an incoming packet from the stack and hands off to a plugin for further processing.

emberPacketHandoffOutgoingHandler(EmberZigbeePacketType packetType, EmberMessageBuffer packetBuffer, uint8_t index, void *data)

Intercept an outgoing packet from the stack and hands off to a plugin for further processing.

emberAfIncomingPacketFilterCallback(EmberZigbeePacketType packetType, uint8_t *packetData, uint8_t *size_p, void *data)

Call when the stack receives a packet that is meant for one of the protocol layers specified in EmberZigbeePacketType.

emberAfOutgoingPacketFilterCallback(EmberZigbeePacketType packetType, uint8_t *packetData, uint8_t *size_p, void *data)

The stack is preparing to send a protocol layer packet.

slx_zigbee_add_to_incoming_network_queue(int8_t rssi, uint8_t lqi, const sl_nwk_packet_exchange_t *nwk_packet)

Add a network packet into the incoming network queue.

Macro Definition Documentation#

EMBER_APSC_MAX_ACK_WAIT_HOPS_MULTIPLIER_MS#

#define EMBER_APSC_MAX_ACK_WAIT_HOPS_MULTIPLIER_MS
Value:
50

The per-hop delay allowed for in the calculation of the APS ACK timeout value. This is defined in the Zigbee specification. This times the maximum number of hops (EMBER_MAX_HOPS) plus the terminal encrypt/decrypt time is the timeout between retries of an APS ACKed message in milliseconds.


Definition at line 45 of file stack/include/message.h

EMBER_APSC_MAX_ACK_WAIT_TERMINAL_SECURITY_MS#

#define EMBER_APSC_MAX_ACK_WAIT_TERMINAL_SECURITY_MS
Value:
100

The terminal encrypt/decrypt time allowed for in the calculation of the APS ACK timeout value. This is defined in the ZigBee specification.


Definition at line 50 of file stack/include/message.h

emberBroadcastSetMinAcksNeeded#

#define emberBroadcastSetMinAcksNeeded
Value:
(minAcksNeeded)

Set the number of broadcast passive acknowledgments required before terminating a broadcast transmission. A value of 0xFF causes the node to wait for all neighbors to re-broadcast the packet before terminating the transmission. The default value is 0xFF. API is kept for backwards compatibility.

Returns

  • EMBER_SUCCESS if set passive ack success; EMBER_BAD_ARGUMENT when pass wrong config argument


Definition at line 973 of file stack/include/message.h

Variable Documentation#

emberApsAckTimeoutMs#

uint16_t emberApsAckTimeoutMs

The APS ACK timeout value. The stack waits this amount of time between resends of APS retried messages. The default value is:


  ((EMBER_APSC_MAX_ACK_WAIT_HOPS_MULTIPLIER_MS
    * EMBER_MAX_HOPS)
   + EMBER_APSC_MAX_ACK_WAIT_TERMINAL_SECURITY_MS)

Definition at line 61 of file stack/include/message.h

emberMulticastTable#

EmberMulticastTableEntry emberMulticastTable[]

The multicast table.

Each entry contains a multicast ID and an endpoint, indicating that the endpoint is a member of the multicast group. Only devices with an endpoint in a multicast group will receive messages sent to that multicast group.

Entries with with an endpoint of 0 are ignored (the ZDO does not a member of any multicast groups). All endpoints are initialized to 0 on startup.


Definition at line 923 of file stack/include/message.h

emberMulticastTableSize#

uint8_t emberMulticastTableSize

The number of entries in the multicast table.


Definition at line 927 of file stack/include/message.h

Function Documentation#

emberMaximumApsPayloadLength#

uint8_t emberMaximumApsPayloadLength (void )

Return the maximum size of the payload that the Application Support sub-layer will accept.

Parameters
N/A

The size depends on the security level in use. The value is the same as that found in the node descriptor.

Returns

  • The maximum APS payload length.


Definition at line 37 of file stack/include/message.h

emberSendMulticastWithAlias#

EmberStatus emberSendMulticastWithAlias (EmberApsFrame * apsFrame, uint8_t radius, uint8_t nonmemberRadius, EmberMessageBuffer message, EmberNodeId alias, uint8_t sequence)

Send a multicast message for an alias source to all endpoints that share a specific multicast ID and are within a specified number of hops of the sender.

Parameters
N/AapsFrame

The APS frame for the message. The multicast will be sent to the groupId in this frame.

N/Aradius

The message will be delivered to all nodes within this number of hops of the sender. A value of zero is converted to EMBER_MAX_HOPS.

N/AnonmemberRadius

The number of hops that the message will be forwarded by devices that are not members of the group. A value of 7 or greater is treated as infinite.

N/Amessage

A message.

N/Aalias

The alias from which to send the multicast.

N/Asequence

The NWK sequence number for the message.

Returns


Definition at line 96 of file stack/include/message.h

emberSendMulticast#

EmberStatus emberSendMulticast (EmberApsFrame * apsFrame, uint8_t radius, uint8_t nonmemberRadius, EmberMessageBuffer message)

Send a multicast message to all endpoints that share a specific multicast ID and are within a specified number of hops of the sender.

Parameters
N/AapsFrame

The APS frame for the message. The multicast will be sent to the groupId in this frame.

N/Aradius

The message will be delivered to all nodes within this number of hops of the sender. A value of zero is converted to EMBER_MAX_HOPS.

N/AnonmemberRadius

The number of hops that the message will be forwarded by devices that are not members of the group. A value of 7 or greater is treated as infinite.

N/Amessage

A message.

Returns


Definition at line 132 of file stack/include/message.h

emberSendUnicast#

EmberStatus emberSendUnicast (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame * apsFrame, EmberMessageBuffer message)

Send a unicast message per the Zigbee specification.

Parameters
N/Atype

Specifies the outgoing message type. Must be one of EMBER_OUTGOING_DIRECT, EMBER_OUTGOING_VIA_ADDRESS_TABLE, or EMBER_OUTGOING_VIA_BINDING.

N/AindexOrDestination

Depending on the type of addressing used, this is either the EmberNodeId of the destination, an index into the address table, or an index into the binding table.

N/AapsFrame

The APS frame which is to be added to the message.

N/Amessage

Contents of the message.

The message will arrive at its destination only if there is a known route to the destination node. Setting the ::ENABLE_ROUTE_DISCOVERY option will cause a route to be discovered if none is known. Setting the ::FORCE_ROUTE_DISCOVERY option will force route discovery. Routes to end-device children of the local node are always known.

Setting the APS_RETRY option will cause the message to be retransmitted until either a matching acknowledgment is received or three transmissions have been made.

Note

  • Using the ::FORCE_ROUTE_DISCOVERY option will cause the first transmission to be consumed by a route request as part of discovery, so the application payload of this packet will not reach its destination on the first attempt. For the packet to reach its destination, the APS_RETRY option must be set so that another attempt is made to transmit the message with its application payload after the route has been constructed.

Setting the ::DESTINATION_EUI64 option will cause the long ID of the destination to be included in the network header. This is the only way to absolutely guarantee that the message is delivered to the correct node. Without it, a message may on occasion be delivered to the wrong destination in the event of an ID conflict that has not yet been detected and resolved by the network layer.

Note

  • When sending fragmented messages, the stack will only assign a new APS sequence number for the first fragment of the message (i.e., EMBER_APS_OPTION_FRAGMENT is set and the low-order byte of the groupId field in the APS frame is zero). For all subsequent fragments of the same message, the application must set the sequence number field in the APS frame to the sequence number assigned by the stack to the first fragment.

Returns


Definition at line 194 of file stack/include/message.h

emberSendBroadcast#

EmberStatus emberSendBroadcast (EmberNodeId destination, EmberApsFrame * apsFrame, uint8_t radius, EmberMessageBuffer message)

Send a broadcast message as per the ZigBee specification.

Parameters
N/Adestination

The destination to which to send the broadcast. This must be one of three ZigBee broadcast addresses.

N/AapsFrame

The APS frame data to be included in the message.

N/Aradius

The maximum number of hops the message will be relayed.

N/Amessage

The actual message to be sent.

The message will be delivered to all nodes within radius hops of the sender. A radius of zero is converted to EMBER_MAX_HOPS.

Returns


Definition at line 215 of file stack/include/message.h

emberProxyBroadcast#

EmberStatus emberProxyBroadcast (EmberNodeId source, EmberNodeId destination, uint8_t sequence, EmberApsFrame * apsFrame, uint8_t radius, EmberMessageBuffer message)

Proxy a broadcast message for another node.

Parameters
N/Asource

The source from which to send the broadcast.

N/Adestination

The destination to which to send the broadcast. This must be one of three ZigBee broadcast addresses.

N/Asequence

The NWK sequence number for the message.

N/AapsFrame

The APS frame data to be included in the message.

N/Aradius

The maximum number of hops the message will be relayed.

N/Amessage

The actual message to be sent.

The message will be delivered to all nodes within radius hops of the local node. A radius of zero is converted to EMBER_MAX_HOPS.

Returns


Definition at line 240 of file stack/include/message.h

emberProxyNextBroadcastFromLong#

EmberStatus emberProxyNextBroadcastFromLong (uint8_t * euiSource)

Proxy a broadcast message for another node.

Parameters
N/AeuiSource

The long source from which to send the broadcast.

The function is used in conjunction with emberProxyBroadcast, which proxies a message from a short ID. This function is used where a long source is also specified in the NWK frame control.

Returns


Definition at line 257 of file stack/include/message.h

emberSendManyToOneRouteRequest#

EmberStatus emberSendManyToOneRouteRequest (uint16_t concentratorType, uint8_t radius)

Send a route request packet that creates routes from every node in the network back to this node.

Parameters
N/AconcentratorType

Must be either EMBER_HIGH_RAM_CONCENTRATOR or EMBER_LOW_RAM_CONCENTRATOR. The former is used when the caller has enough memory to store source routes for the whole network. In that case, remote nodes stop sending route records once the concentrator has successfully received one. The latter is used when the concentrator has insufficient RAM to store all outbound source routes. In that case, route records are sent to the concentrator prior to every inbound APS unicast.

N/Aradius

The maximum number of hops the route request will be relayed. A radius of zero is converted to EMBER_MAX_HOPS.

This function should be called by an application that wants to communicate with many nodes, for example, a gateway, central monitor, or controller. A device using this function was referred to as an "aggregator" in EmberZNet 2.x and earlier, and is referred to as a "concentrator" in the ZigBee specification and EmberZNet 3.

This function enables large scale networks because the other devices do not have to individually perform bandwidth-intensive route discoveries. Instead, when a remote node sends an APS unicast to a concentrator, its network layer automatically delivers a special route record packet first, which lists the network IDs of all intermediate relays. The concentrator can then use source routing to send outbound APS unicasts. (A source routed message is one in which the entire route is listed in the network layer header.) This allows the concentrator to communicate with thousands of devices without requiring large route tables on neighboring nodes.

This function is only available in ZigBee Pro (stack profile 2), and cannot be called on end devices. Any router can be a concentrator (not just the coordinator), and there can be multiple concentrators on a network.

Note that a concentrator does not automatically obtain routes to all network nodes after calling this function. Remote applications must first initiate an inbound APS unicast.

Many-to-one routes are not repaired automatically. Instead, the concentrator application must call this function to rediscover the routes as necessary, for example, upon failure of a retried APS message. This is necessary because there is no scalable one-size-fits-all route repair strategy. A common and recommended strategy is for the concentrator application to refresh the routes by calling this function periodically.

Returns


Definition at line 311 of file stack/include/message.h

emberGetSourceRouteTableEntry#

EmberStatus emberGetSourceRouteTableEntry (uint8_t index, EmberNodeId * destination, uint8_t * closerIndex)

Return the source route table entry fields.

Parameters
N/Aindex

The index of the source route table entry.

N/Adestination

The value of the destination field in that entry.

N/AcloserIndex

The value of the closer index entry field in that entry.


Definition at line 320 of file stack/include/message.h

emberGetSourceRouteTableFilledSize#

uint8_t emberGetSourceRouteTableFilledSize (void )

Return the number of filled entries in the source route table.

Parameters
N/A

Definition at line 327 of file stack/include/message.h

emberGetSourceRouteTableTotalSize#

uint8_t emberGetSourceRouteTableTotalSize (void )

Return the source route table total size.

Parameters
N/A

Definition at line 332 of file stack/include/message.h

emberIncomingManyToOneRouteRequestHandler#

void emberIncomingManyToOneRouteRequestHandler (EmberNodeId source, EmberEUI64 longId, uint8_t cost)

Indicate that a many-to-one route to the concentrator with the given short and long ID is available for use.

Parameters
N/Asource

The short ID of the concentrator that initiated the many-to-one route request.

N/AlongId

The EUI64 of the concentrator.

N/Acost

The path cost to the concentrator.

The application must define EMBER_APPLICATION_HAS_INCOMING_MANY_TO_ONE_ROUTE_REQUEST_HANDLER in its configuration header to use this.


Definition at line 347 of file stack/include/message.h

emberIncomingRouteErrorHandler#

void emberIncomingRouteErrorHandler (EmberStatus status, EmberNodeId target)

Invoke when a route error message is received.

Parameters
N/Astatus

EMBER_SOURCE_ROUTE_FAILURE, EMBER_MANY_TO_ONE_ROUTE_FAILURE, EMBER_MAC_INDIRECT_TIMEOUT

N/Atarget

The short ID of the remote node.

A status of EMBER_SOURCE_ROUTE_FAILURE indicates that a source-routed unicast sent from this node encountered a broken link. Note that this case occurs only if this node is a concentrator using many-to-one routing for inbound messages and source-routing for outbound messages. The node prior to the broken link generated the route error message and returned it to us along the many-to-one route.

A status of EMBER_MANY_TO_ONE_ROUTE_FAILURE also occurs only if the local device is a concentrator, and indicates that a unicast sent to the local device along a many-to-one route encountered a broken link. The node prior to the broken link generated the route error message and forwarded it to the local device via a randomly chosen neighbor, taking advantage of the many-to-one nature of the route.

A status of EMBER_MAC_INDIRECT_TIMEOUT indicates that a message sent to the target end device could not be delivered by the parent because the indirect transaction timer expired. Upon receipt of the route error, the stack sets the extended timeout for the target node in the address table, if present. It then calls this handler to indicate receipt of the error.

Note that if the original unicast data message is sent using the EMBER_APS_OPTION_RETRY option, a new route error message is generated for each failed retry. Therefore, it is not unusual to receive three route error messages in succession for a single failed retried APS unicast. On the other hand, it is also not guaranteed that any route error messages will be delivered successfully at all. The only sure way to detect a route failure is to use retried APS messages and to check the status of the emberMessageSentHandler().

If the application includes this callback, it must define EMBER_APPLICATION_HAS_INCOMING_ROUTE_ERROR_HANDLER in its configuration header.


Definition at line 396 of file stack/include/message.h

emberIncomingNetworkStatusHandler#

void emberIncomingNetworkStatusHandler (uint8_t errorCode, EmberNodeId target)

Invoke when a network status message is received that informs the application of the Over-the-Air error codes for the specific destination.

Parameters
N/AerrorCode

uint8_t

N/Atarget

The short ID of the remote node.

Note: Network analyzer may flag this message as "route error" which is the old name for the "network status" command.

This handler is a superset of emberIncomingRouteErrorHandler. The old API was only invoking the handler for a couple of the possible error codes and these were being translated into EmberStatus.

To make the API more generic and extensible in future, the new API emberIncomingNetworkStatusHandler simply copies the OTA error code as is. If the application includes this callback, it must define EMBER_APPLICATION_HAS_INCOMING_NETWORK_STATUS_HANDLER in its configuration header.


Definition at line 419 of file stack/include/message.h

emberOverrideIncomingRouteRecordHandler#

void emberOverrideIncomingRouteRecordHandler (EmberNodeId source, EmberEUI64 sourceEui, uint8_t relayCount, EmberMessageBuffer header, uint8_t relayListIndex, bool * consumed)

SoC only. It reports the arrival of a route record command frame to the application.

Parameters
N/Asource

The id of the node that initiated the route record.

N/AsourceEui

The EUI64 of the node that initiated the route record.

N/ArelayCount

The number of relays in the list.

N/Aheader

The message buffer containing the route record frame.

N/ArelayListIndex

The starting index of the relay list. The relay closest to the source is listed first, and the relay closest to us is listed last. Short ids are stored low byte first. Be careful to use buffer-boundary-safe APIs to read the list.

N/Aconsumed

if set to true stack won't process the Incoming route record

The route record command frame lists the short IDs of the relays that were used along the route from the source to us. This information is used by aggregators to be able to initiate source routed messages. The application must define EMBER_APPLICATION_HAS_OVERRIDE_SOURCE_ROUTING in its configuration header to use this.


Definition at line 442 of file stack/include/message.h

emberOverrideAppendSourceRouteHandler#

uint8_t emberOverrideAppendSourceRouteHandler (EmberNodeId destination, EmberMessageBuffer * header, bool * consumed)

SoC only. The application can implement this callback to supply source routes to outgoing messages.

Parameters
N/Adestination

The network destination of the message.

N/Aheader

Pointer to the message buffer containing the partially complete packet header. The application appends the source route frame to this header.

N/Aconsumed

if set to true stack would skip appending the existing source route entry from the table

The application must define :EMBER_APPLICATION_HAS_OVERRIDE_SOURCE_ROUTING in its configuration header to use this. The application uses the supplied destination to look up a source route. If available, the application appends the source route to the supplied header using the proper frame format, as described in section 3.4.1.9 "Source Route Subframe Field" of the ZigBee specification. If a source route is appended, the stack takes care of setting the proper flag in the network frame control field. See app/util/source-route.c for a sample implementation.

If header is :EMBER_NULL_MESSAGE_BUFFER the only action is to return the size of the source route frame needed to the destination.

Returns

  • The size in bytes of the source route frame, or zero if there is not one available.


Definition at line 474 of file stack/include/message.h

emberIncomingRouteRecordHandler#

void emberIncomingRouteRecordHandler (EmberNodeId source, EmberEUI64 sourceEui, uint8_t relayCount, EmberMessageBuffer header, uint8_t relayListIndex)

DEPRECTAED emberOverrideIncomingRouteRecordHandler should be used Reports the arrival of a route record command frame to the application.

Parameters
N/Asource

The id of the node that initiated the route record.

N/AsourceEui

The EUI64 of the node that initiated the route record.

N/ArelayCount

The number of relays in the list.

N/Aheader

The message buffer containing the route record frame.

N/ArelayListIndex

The starting index of the relay list. The relay closest to the source is listed first, and the relay closest to us is listed last. Short ids are stored low byte first. Be careful to use buffer-boundary-safe APIs to read the list.

The route record command frame lists the short IDs of the relays that were used along the route from the source to us. This information is used by aggregators to be able to initiate source routed messages. The application must define EMBER_APPLICATION_HAS_SOURCE_ROUTING in its configuration header to use this.


Definition at line 498 of file stack/include/message.h

emberAppendSourceRouteHandler#

uint8_t emberAppendSourceRouteHandler (EmberNodeId destination, EmberMessageBuffer header)

DEPRECATED emberOverrideAppendSourceRouteHandler should be used The application can implement this callback to supply source routes to outgoing messages.

Parameters
N/Adestination

The network destination of the message.

N/Aheader

The message buffer containing the partially complete packet header. The application appends the source route frame to this header.

The application must define :EMBER_APPLICATION_HAS_SOURCE_ROUTING in its configuration header to use this. The application uses the supplied destination to look up a source route. If available, the application appends the source route to the supplied header using the proper frame format, as described in section 3.4.1.9 "Source Route Subframe Field" of the ZigBee specification. If a source route is appended, the stack takes care of setting the proper flag in the network frame control field. See app/util/source-route.c for a sample implementation.

If header is :EMBER_NULL_MESSAGE_BUFFER the only action is to return the size of the source route frame needed to the destination.

Returns

  • The size in bytes of the source route frame, or zero if there is not one available.


Definition at line 529 of file stack/include/message.h

emberCancelMessage#

EmberStatus emberCancelMessage (EmberMessageBuffer message)

DEPRECATED.

Parameters
N/Amessage

A message.

Returns


Definition at line 537 of file stack/include/message.h

emberMessageSentHandler#

void emberMessageSentHandler (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame * apsFrame, EmberMessageBuffer message, EmberStatus status)

Invoke by the stack when it has completed sending a message.

Parameters
N/Atype

The type of message sent.

N/AindexOrDestination

The destination to which the message was sent. For direct unicasts, the destination to which the message was sent; for other unicasts, the address table or binding index to which the message was sent. The value is unspecified for multicasts and broadcasts.

N/AapsFrame

The APS frame for the message.

N/Amessage

The message that was sent.

N/Astatus

An EmberStatus value of EMBER_SUCCESS if an ACK was received from the destination or EMBER_DELIVERY_FAILED if no ACK was received.


Definition at line 558 of file stack/include/message.h

emberIncomingMessageHandler#

void emberIncomingMessageHandler (EmberIncomingMessageType type, EmberApsFrame * apsFrame, EmberMessageBuffer message)

Invoke by the EmberZNet stack when a message is received.

Parameters
N/Atype

The type of the incoming message. One of the following:

N/AapsFrame

The APS frame from the incoming message.

N/Amessage

The message that was sent.

The following functions may be called from emberIncomingMessageHandler():


Definition at line 590 of file stack/include/message.h

emberGetLastHopLqi#

EmberStatus emberGetLastHopLqi (uint8_t * lastHopLqi)

Get the link quality from the node that last relayed the current message.

Parameters
N/AlastHopLqi

The link quality for the last incoming message processed.

Note

This function is not available from within emberPollHandler() or emberPollCompleteHandler(). The link quality information of interest during the emberPollHandler() is from the data request packet itself. This message must be handled quickly due to strict 15.4 timing requirements, and the link quality information is not recorded by the stack. The link quality information of interest during the emberPollCompleteHandler() is from the ACK to the data request packet. The ACK is handled by the hardware and the link quality information does not make it up to the stack.

Returns

  • This function always returns EMBER_SUCCESS. It is not necessary to check this return value.


Definition at line 624 of file stack/include/message.h

emberGetLastHopRssi#

EmberStatus emberGetLastHopRssi (int8_t * lastHopRssi)

Get the receive signal strength indication (RSSI) for the current message.

Parameters
N/AlastHopRssi

The RSSI for the last incoming message processed.

After a successful call to this function, the quantity referenced by lastHopRssi will contain the energy level (in units of dBm) observed during the last packet received. Note

This function is not available from within emberPollHandler() or emberPollCompleteHandler(). The RSSI information of interest during the emberPollHandler() is from the data request packet itself. This message must be handled quickly due to strict 15.4 timing requirements, and the RSSI information is not recorded by the stack. The RSSI information of interest during the emberPollCompleteHandler() is from the ACK to the data request packet. The ACK is handled by the hardware and the RSSI information does not make it up to the stack.

Returns

  • This function always returns EMBER_SUCCESS. It is not necessary to check this return value.


Definition at line 659 of file stack/include/message.h

emberGetLastHopTimestamp#

EmberStatus emberGetLastHopTimestamp (uint32_t * lastHopTimestamp)

Get the receive timestamp (value of the MAC timer; ticks since up) of the moment when the Start Frame Delimiter (SFD) was received for the current message.

Parameters
N/AlastHopTimestamp

The timestamp for the last incoming message processed.

Note: This API is mainly intended for use on EFR devices.

RAIL timers tick every microsecond. ::RAIL_GetTime can provide the value of the current RAIL timebase (this wraps after ~4095 seconds.)

The timestamp provided by this API is a 24-bit value passed up from the PHY to the MAC layer, with a range of ~16.8 seconds. So, to calculate relative time using this timestamp, make sure to mask off the lower 24 bits provided by ::Rail_GetTime.

(EFR32xG1 ticks every 2us while other EFR32 platforms tick at 0.5us rate. Make sure to adjust the relative timestamp value accordingly.)

After a successful call to this function, the quantity referenced by lastHopTimestamp will contain the value of the MAC timer observed during the last packet received. Note

When this function is called from within one of these handler functions, the timestamp reported corresponds to the header being processed in that handler function. If this function is called outside of these handler functions, the timestamp reported will correspond to a message that was processed earlier.

This function is not available from within emberPollHandler() or emberPollCompleteHandler(). The timestamp of interest during the emberPollHandler() is from the data request packet itself. This message must be handled quickly due to strict 15.4 timing requirements, and the timestamp is not recorded by the stack. The timestamp of interest during the emberPollCompleteHandler() is from the ACK to the data request packet. The ACK is handled by the hardware and the timestamp does not make it up to the stack.

Returns

  • This function always returns EMBER_SUCCESS. It is not necessary to check this return value.


Definition at line 708 of file stack/include/message.h

emberGetSender#

EmberNodeId emberGetSender (void )

Return the node ID of the sender of the current incoming message.

Parameters
N/A

Note

Returns

  • The sender of the current incoming message.


Definition at line 717 of file stack/include/message.h

emberGetSenderEui64#

EmberStatus emberGetSenderEui64 (EmberEUI64 senderEui64)

Return the EUI64 of the sender of the current incoming message if the sender chose to include this information in the message. The EMBER_APS_OPTION_SOURCE_EUI64 bit in the options field of the APS frame of the incoming message indicates that the EUI64 is present in the message.

Parameters
N/AsenderEui64

The EUI64 of the sender.

Note

Returns


Definition at line 737 of file stack/include/message.h

emberSendReply#

EmberStatus emberSendReply (uint16_t clusterId, EmberMessageBuffer reply)

Send a reply for an application that has received a unicast message.

Parameters
N/AclusterId

The cluster ID to use for the reply.

N/Areply

A reply message.

The reply will be included with the ACK that the stack automatically sends back. Note

Returns


Definition at line 765 of file stack/include/message.h

emberSetReplyFragmentData#

void emberSetReplyFragmentData (uint16_t fragmentData)

Set the fragment data to be used when sending a reply to a unicast message.

Parameters
N/AfragmentData

The low byte is the block number of the reply. The high byte is the ACK bitfield of the reply.

Note


Definition at line 775 of file stack/include/message.h

emberAddressTableEntryIsActive#

bool emberAddressTableEntryIsActive (uint8_t addressTableIndex)

Indicate whether any messages are currently being sent using this address table entry.

Parameters
N/AaddressTableIndex

The index of an address table entry.

Note that this function does not indicate whether the address table entry is unused. To determine whether an address table entry is unused, check the remote node ID. The remote node ID will have the value EMBER_TABLE_ENTRY_UNUSED_NODE_ID when the address table entry is not in use.

Returns

  • True if the address table entry is active, false otherwise.


Definition at line 791 of file stack/include/message.h

emberSetAddressTableRemoteEui64#

EmberStatus emberSetAddressTableRemoteEui64 (uint8_t addressTableIndex, EmberEUI64 eui64)

Set the EUI64 of an address table entry.

Parameters
N/AaddressTableIndex

The index of an address table entry.

N/Aeui64

The EUI64 to use for the address table entry.

This function will also check other address table entries, the child table and the neighbor table to see if the node ID for the given EUI64 is already known. If known, this function will also set the node ID. If not known, it will set the node ID to EMBER_UNKNOWN_NODE_ID.

Returns


Definition at line 807 of file stack/include/message.h

emberSetAddressTableRemoteNodeId#

void emberSetAddressTableRemoteNodeId (uint8_t addressTableIndex, EmberNodeId id)

Set the short ID of an address table entry.

Parameters
N/AaddressTableIndex

The index of an address table entry.

N/Aid

The short ID corresponding to the remote node whose EUI64 is stored in the address table at the given index or EMBER_TABLE_ENTRY_UNUSED_NODE_ID which indicates that the entry stored in the address table at the given index is not in use.

Usually the application will not need to set the short ID in the address table. Once the remote EUI64 is set, the stack is capable of figuring out the short ID on its own. However, in cases where the application does set the short ID, the application must set the remote EUI64 prior to setting the short ID.


Definition at line 825 of file stack/include/message.h

emberGetAddressTableRemoteEui64#

void emberGetAddressTableRemoteEui64 (uint8_t addressTableIndex, EmberEUI64 eui64)

Get the EUI64 of an address table entry.

Parameters
N/AaddressTableIndex

The index of an address table entry.

N/Aeui64

The EUI64 of the address table entry is copied to this location.


Definition at line 835 of file stack/include/message.h

emberGetAddressTableRemoteNodeId#

EmberNodeId emberGetAddressTableRemoteNodeId (uint8_t addressTableIndex)

Get the short ID of an address table entry.

Parameters
N/AaddressTableIndex

The index of an address table entry.

Returns

  • One of the following:

    • The short ID corresponding to the remote node whose EUI64 is stored in the address table at the given index.

    • EMBER_UNKNOWN_NODE_ID - Indicates that the EUI64 stored in the address table at the given index is valid but the short ID is currently unknown.

    • EMBER_DISCOVERY_ACTIVE_NODE_ID - Indicates that the EUI64 stored in the address table at the given location is valid and network address discovery is underway.

    • EMBER_TABLE_ENTRY_UNUSED_NODE_ID - Indicates that the entry stored in the address table at the given index is not in use.


Definition at line 854 of file stack/include/message.h

emberSetExtendedTimeout#

void emberSetExtendedTimeout (EmberEUI64 remoteEui64, bool extendedTimeout)

Tell the stack whether or not the normal interval between retransmissions of a retried unicast message should be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.

Parameters
N/AremoteEui64

The address of the node for which the timeout is to be set.

N/AextendedTimeout

True if the retry interval should be increased by EMBER_INDIRECT_TRANSMISSION_TIMEOUT. False if the normal retry interval should be used.

The interval needs to be increased when sending to a sleepy node so that the message is not retransmitted until the destination has had time to wake up and poll its parent. The stack will automatically extend the timeout:

  • For our own sleepy children.

  • When an address response is received from a parent on behalf of its child.

  • When an indirect transaction expiry route error is received.

  • When an end device announcement is received from a sleepy node.


Definition at line 876 of file stack/include/message.h

emberGetExtendedTimeout#

bool emberGetExtendedTimeout (EmberEUI64 remoteEui64)

Indicate whether or not the stack will extend the normal interval between retransmissions of a retried unicast message by EMBER_INDIRECT_TRANSMISSION_TIMEOUT.

Parameters
N/AremoteEui64

The address of the node for which the timeout is to be returned.

Returns


Definition at line 889 of file stack/include/message.h

emberIdConflictHandler#

void emberIdConflictHandler (EmberNodeId conflictingId)

Invoke by the EmberZNet stack when an ID conflict is discovered, that is, two different nodes in the network were found to be using the same short ID.

Parameters
N/AconflictingId

The short ID for which a conflict was detected.

The stack automatically removes the conflicting short ID from its internal tables (address, binding, route, neighbor, and child tables). The application should discontinue any other use of the ID. If the application includes this callback, it must define ::EMBER_APPLICATION_HAS_ID_CONFLICT_HANDLER in its configuration header.


Definition at line 904 of file stack/include/message.h

emberPendingAckedMessages#

bool emberPendingAckedMessages (void )

Indicate whether there are pending messages in the APS retry queue.

Parameters
N/A

Returns

  • True if there is at least a pending message belonging to the current network in the APS retry queue, false otherwise.


Definition at line 911 of file stack/include/message.h

sl_zigbee_set_passive_ack_config#

EmberStatus sl_zigbee_set_passive_ack_config (sl_passive_ack_config_enum_t config, uint8_t minAcksNeeded)

Allows the higher layers to control the broadcast behavior of a routing device. The originating device will rebroadcast the maximum number of times and The configurations below only restrict the number of broadcasts from neighboring routers. The configuration settings must be done on each node.

Parameters
N/Aconfig

The minimum number of acknowledgments (re-broadcasts) to wait for until deeming the broadcast transmission complete.

N/AminAcksNeeded

SL_PASSIVE_ACK_THRESHOLD_NO_REBROADCAST - All non originating configured nodes check for passive acks from minAcksNeeded neighbors. They will not rebroadcast received message if all passive acks have been received. If no passive acks received it will rebroadcast max times. SL_PASSIVE_ACK_THRESHOLD_WITH_REBROADCAST_ALL_NODES - This configuration is for both originating and relaying (non originating nodes). All configured nodes check for passive acks from minAcksNeeded neighbors. They will not rebroadcast received message if all passive acks have been received. If no passive acks received it will rebroadcast max times if minAcksNeeded is not set to 0

Returns

  • EMBER_SUCCESS if set passive ack success; EMBER_BAD_ARGUMENT when pass wrong config argument


Definition at line 959 of file stack/include/message.h

emberPacketHandoffIncomingHandler#

EmberPacketAction emberPacketHandoffIncomingHandler (EmberZigbeePacketType packetType, EmberMessageBuffer packetBuffer, uint8_t index, void * data)

Intercept an incoming packet from the stack and hands off to a plugin for further processing.

Parameters
N/ApacketType

The type of packet and the target stack layer. See EmberZigbeePacketType.

N/ApacketBuffer

The EmberMessageBuffer containing the packet. index The starting index of the relevant packet data. The plugin\ will receive a flat copy of the packet starting from this index.

N/Aindex

Auxiliary data pointer

N/Adata

Returns


Definition at line 988 of file stack/include/message.h

emberPacketHandoffOutgoingHandler#

EmberPacketAction emberPacketHandoffOutgoingHandler (EmberZigbeePacketType packetType, EmberMessageBuffer packetBuffer, uint8_t index, void * data)

Intercept an outgoing packet from the stack and hands off to a plugin for further processing.

Parameters
N/ApacketType

The type of packet and the source stack layer. See EmberZigbeePacketType.

N/ApacketBuffer

The EmberMessageBuffer containing the packet.

N/Aindex

The starting index of the relevant packet data. The plugin\ will receive a flat copy of the packet starting from this index.

N/Adata

Auxiliary data pointer

Returns


Definition at line 1005 of file stack/include/message.h

emberAfIncomingPacketFilterCallback#

EmberPacketAction emberAfIncomingPacketFilterCallback (EmberZigbeePacketType packetType, uint8_t * packetData, uint8_t * size_p, void * data)

Call when the stack receives a packet that is meant for one of the protocol layers specified in EmberZigbeePacketType.

Parameters
N/ApacketType

The type of packet received. See EmberZigbeePacketType.

N/ApacketData

A flat buffer containing the packet contents the buffer starts with the command id followed by the payload

N/Asize_p

a pointer to the size of the packet data

N/Adata

This is a pointer to auxiliary data for the command.

The packetType argument is one of the values of the EmberZigbeePacketType enum. If the stack receives an 802.15.4 MAC beacon, it will call this function with the packetType argument set to EMBER_ZIGBEE_PACKET_TYPE_BEACON.

The implementation of this callback may alter the data contained in packetData, modify options and flags in the axillary data, or consume the packet itself, either sending the message, or discarding it as it sees fit.

Returns

  • a EmberPacketAction indicating what action should be taken for the packet, EMBER_ACCEPT_PACKET, EMBER_DROP_PACKET, or EMBER_MANGLE_PACKET


Definition at line 1034 of file stack/include/message.h

emberAfOutgoingPacketFilterCallback#

EmberPacketAction emberAfOutgoingPacketFilterCallback (EmberZigbeePacketType packetType, uint8_t * packetData, uint8_t * size_p, void * data)

The stack is preparing to send a protocol layer packet.

Parameters
N/ApacketType

The type of packet received. See EmberZigbeePacketType.

N/ApacketData

A flat buffer containing the packet contents the buffer starts with the command id followed by the payload

N/Asize_p

a pointer to the size of the packet data

N/Adata

This is a pointer to auxiliary data for the command. ZDO commands pass the EmberApsFrame associated with the packet here. Otherwise, this value is NULL.

This is called when the stack is preparing to send a packet from one of the protocol layers specified in EmberZigbeePacketType.

The packetType argument is one of the values of the EmberZigbeePacketType enum. If the stack is preparing to send an 802.15.4 MAC beacon, it will call this function with the packetType argument set to EMBER_ZIGBEE_PACKET_TYPE_BEACON.

The implementation of this callback may alter the data contained in packetData, modify options and flags in the axillary data, or consume the packet itself, either sending the message, or discarding it as it sees fit.

Returns

  • a EmberPacketAction indicating what action should be taken for the packet, EMBER_ACCEPT_PACKET, EMBER_DROP_PACKET, or EMBER_MANGLE_PACKET


Definition at line 1066 of file stack/include/message.h

slx_zigbee_add_to_incoming_network_queue#

EmberStatus slx_zigbee_add_to_incoming_network_queue (int8_t rssi, uint8_t lqi, const sl_nwk_packet_exchange_t * nwk_packet)

Add a network packet into the incoming network queue.

Parameters
N/Arssi

The RSSI of the incoming packet.

N/Alqi

The LQI of the incoming packet.

N/Anwk_packet

The network packet, for more information see sl_nwk_packet_exchange_t.

Quality: Experimental API for prototyping.

The content of the networkPacket follows the formats below: -—Encrypted NWK Packet-— NWK Header (8 bytes) NWK Security (14 bytes) APS Header (8 bytes) APS Payload (Variable) NWK MIC (4 bytes)

-—Unencrypted NWK Packet-— NWK Header (8 bytes) APS Header (8 bytes) APS Payload (Variable)

Noted: This function does not free up the memory pointed by the networkPacket pointer. Users may need to free up the memory after calling this function. The network packet should not be larger than 115 bytes (TRANSMIT_BUFFER_SIZE 126 bytes - PACKET_HEADER_OVERHEAD 11 bytes).

Returns


Definition at line 1101 of file stack/include/message.h