Digi XBee(R) ANSI C Host Library
Files | Macros | Functions

        Code for the Programmable XBee to receive over-the-air firmware
        updates.
More...

Files

file  pxbee_ota_server.h
 Code to add an OTA Server Cluster to a device.
 
file  pxbee_ota_server.c
 Code to add an OTA Server Cluster to a device.
 

Macros

#define PXBEE_OTA_CMD_SERVER_CLUST_ENTRY(flag)
 Macro to add the OTA cluster to the Digi Data Endpoint. More...
 

Functions

int pxbee_ota_server_cmd (const wpan_envelope_t FAR *envelope, void FAR *context)
 Cluster command to initiate firmware updates. More...
 
const char * xbee_update_firmware_ota (const wpan_envelope_t FAR *envelope, void FAR *context)
 Application needs to provide this function as a method of receiving firmware updates over-the-air with Xmodem protocol. More...
 

Detailed Description

        Code for the Programmable XBee to receive over-the-air firmware
        updates.

Macro Definition Documentation

#define PXBEE_OTA_CMD_SERVER_CLUST_ENTRY (   flag)
Value:
int pxbee_ota_server_cmd(const wpan_envelope_t FAR *envelope, void FAR *context)
Cluster command to initiate firmware updates.
Definition: pxbee_ota_server.c:30
Start OTA update of PXBee App.
Definition: aps.h:143
#define WPAN_CLUST_FLAG_SERVER
alias name for input cluster (uses ZCL terminology)
Definition: aps.h:234
#define WPAN_CLUST_FLAG_NOT_ZCL
this cluster is NOT using the ZigBee Cluster Library (ZCL)
Definition: aps.h:248

Macro to add the OTA cluster to the Digi Data Endpoint.

Parameters
[in]flagset to WPAN_CLUST_FLAG_NONE or WPAN_CLUST_FLAG_ENCRYPT

Function Documentation

int pxbee_ota_server_cmd ( const wpan_envelope_t FAR envelope,
void FAR context 
)

Cluster command to initiate firmware updates.

Verifies that APS encryption was used (if cluster is configured as such) before handing off to implementation-provided function xbee_update_firmware_ota().

See also
wpan_aps_handler_fn

References EINVAL, wpan_envelope_t::length, wpan_envelope_t::payload, WPAN_CLUST_FLAG_ENCRYPT, wpan_envelope_reply(), WPAN_ENVELOPE_RX_APS_ENCRYPT, wpan_envelope_send(), and xbee_update_firmware_ota().

const char* xbee_update_firmware_ota ( const wpan_envelope_t FAR envelope,
void FAR context 
)

Application needs to provide this function as a method of receiving firmware updates over-the-air with Xmodem protocol.

See xbee/pxbee_ota_client.h for details on sending updates.

Your application can support password-protected updates by checking the payload of the request. If the payload is a valid request to initiate an update, this function should enter an "XMODEM receive" mode and start sending 'C' to the sender of the request, indicating that it should start sending 64-byte XMODEM packets with the new firmware.

On Digi's Programmable XBee platform, this function would exit to the bootloader so it can receive the new application firmware.

Parameters
[in]envelopecommand sent to start update – function may want to use the payload for some sort of password verification
[in,out]contextuser context (from cluster table)
Return values
NULLdo not respond to request
!NULLrespond to request with error message

Referenced by pxbee_ota_server_cmd().