Digi XBee(R) ANSI C Host Library
|
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... | |
Code for the Programmable XBee to receive over-the-air firmware updates.
#define PXBEE_OTA_CMD_SERVER_CLUST_ENTRY | ( | flag | ) |
Macro to add the OTA cluster to the Digi Data Endpoint.
[in] | flag | set to WPAN_CLUST_FLAG_NONE or WPAN_CLUST_FLAG_ENCRYPT |
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().
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.
[in] | envelope | command sent to start update – function may want to use the payload for some sort of password verification |
[in,out] | context | user context (from cluster table) |
NULL | do not respond to request |
!NULL | respond to request with error message |
Referenced by pxbee_ota_server_cmd().