Splits long messages into smaller blocks for transmission and reassembles received blocks. See Message Fragmentation for documentation.

DeprecatedThe fragment library is deprecated and will be removed in a future release. Similar functionality is available in the Fragmentation plugin in Application Framework.

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.

/***************************************************************************/
EmberStatus emberFragmentSendUnicast(EmberOutgoingMessageType type,
                                     uint16_t indexOrDestination,
                                     EmberApsFrame *apsFrame,
                                     EmberMessageBuffer payload,
                                     uint8_t maxFragmentSize);

bool emberFragmentMessageSent(EmberApsFrame *apsFrame,
                              EmberMessageBuffer buffer,
                              EmberStatus status);

void emberFragmentMessageSentHandler(EmberStatus status);

bool emberFragmentIncomingMessage(EmberApsFrame *apsFrame,
                                  EmberMessageBuffer *payload);

void emberFragmentTick(void);

Transmitting#

emberFragmentSendUnicast(EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame *apsFrame, EmberMessageBuffer payload, uint8_t maxFragmentSize)
bool
emberFragmentMessageSent(EmberApsFrame *apsFrame, EmberMessageBuffer buffer, EmberStatus status)
void

Receiving#

bool
emberFragmentIncomingMessage(EmberApsFrame *apsFrame, EmberMessageBuffer *payload)

Transmitting Documentation#

emberFragmentSendUnicast#

EmberStatus emberFragmentSendUnicast (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame *apsFrame, EmberMessageBuffer payload, uint8_t maxFragmentSize)
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 for the message.

N/Apayload

The long message to be sent.

N/AmaxFragmentSize

The message will be broken into blocks no larger than this.

Send a long message by splitting it into blocks. Only one long message can be sent at a time. Calling this function a second time aborts the first message.

Returns


Definition at line 78 of file app/util/zigbee-framework/fragment.h

emberFragmentMessageSent#

bool emberFragmentMessageSent (EmberApsFrame *apsFrame, EmberMessageBuffer buffer, EmberStatus status)
Parameters
N/AapsFrame

The APS frame passed to emberMessageSentHandler().

N/Abuffer

The buffer passed to emberMessageSentHandler().

N/Astatus

The status passed to emberMessageSentHandler().

The application must call this function at the start of its emberMessageSentHandler(). If it returns true, the fragmentation code has handled the event and the application must not process it further.

Returns

  • true if the sent message was a block of a long message. The fragmentation code has handled the event so the application must return immediately from its emberMessageSentHandler(). Returns false otherwise. The fragmentation code has not handled the event so the application must continue to process it.


Definition at line 98 of file app/util/zigbee-framework/fragment.h

emberFragmentMessageSentHandler#

void emberFragmentMessageSentHandler (EmberStatus status)
Parameters
N/Astatus

EMBER_SUCCESS if all the blocks of the long message were delivered to the destination, otherwise EMBER_DELIVERY_FAILED, EMBER_NO_BUFFERS, EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY.

The fragmentation code calls this application-defined handler when it finishes sending a long message.


Definition at line 109 of file app/util/zigbee-framework/fragment.h

Receiving Documentation#

emberFragmentIncomingMessage#

bool emberFragmentIncomingMessage (EmberApsFrame *apsFrame, EmberMessageBuffer *payload)
Parameters
N/AapsFrame

The APS frame passed to emberIncomingMessageHandler().

N/Apayload

The payload passed to emberIncomingMessageHandler().

The application must call this function at the start of its emberIncomingMessageHandler(). If it returns true, the fragmentation code has handled the message and the application must not process it further. When the final block of a long message is received, this function replaces the message with the reassembled long message and returns false so that the application processes it.

Returns

  • true if the incoming message was a block of an incomplete long message. The fragmentation code has handled the message so the application must return immediately from its emberIncomingMessageHandler(). Returns false if the incoming message was not part of a long message. The fragmentation code has not handled the message so the application must continue to process it. Returns false if the incoming message was a block that completed a long message. The fragmentation code replaces the message with the reassembled long message so the application must continue to process it.


Definition at line 137 of file app/util/zigbee-framework/fragment.h

emberFragmentTick#

void emberFragmentTick (void)
Parameters
N/A

Used by the fragmentation code to time incoming blocks. The application must call this function regularly.


Definition at line 143 of file app/util/zigbee-framework/fragment.h