XBee Firmware Library  1.6.0
Files | Data Structures | Typedefs | Functions | Variables

Files

file  ota_client.h
 
file  xbee_ota_client.c
 

Data Structures

struct  xbee_ota_t
 Structure for tracking state of over-the-air update. More...
 

Typedefs

typedef struct xbee_ota_t xbee_ota_t
 Structure for tracking state of over-the-air update. More...
 

Functions

int _xbee_ota_transparent_rx (const wpan_envelope_t FAR *envelope, void FAR *context)
 
int _xbee_ota_xmodem_read (void FAR *context, void FAR *buffer, int16_t bytes)
 
int _xbee_ota_xmodem_write (void FAR *context, const void FAR *buffer, int16_t bytes)
 
int xbee_ota_init (xbee_ota_t *ota, wpan_dev_t *dev, const addr64 *target)
 Initialize an xbee_ota_t structure to send firmware updates to target using dev. More...
 

Variables

uint8_t auth_data [XBEE_OTA_MAX_AUTH_LENGTH]
 Payload used to initiate update. More...
 
uint8_t auth_length
 Number of bytes in auth_data. More...
 
xbee_cbuf_t   cbuf
 
wpan_dev_tdev
 local device to send updates through More...
 
uint16_t flags
 
uint8_t   raw [255+XBEE_CBUF_OVERHEAD]
 buffer for xbee_cbuf_t structure and bytes received from target More...
 
union {
   xbee_cbuf_t   cbuf
 
   uint8_t   raw [255+XBEE_CBUF_OVERHEAD]
 buffer for xbee_cbuf_t structure and bytes received from target More...
 
rxbuf
 
addr64 target
 network device to update More...
 
xbee_xmodem_state_t xbxm
 track state of Xmodem transfer More...
 

Detailed Description

Code for a device to send over-the-air firmware updates to a Programmable XBee.

Typedef Documentation

typedef struct xbee_ota_t xbee_ota_t

Structure for tracking state of over-the-air update.

Function Documentation

int _xbee_ota_transparent_rx ( const wpan_envelope_t FAR *  envelope,
void FAR *  context 
)
int _xbee_ota_xmodem_read ( void FAR *  context,
void FAR *  buffer,
int16_t  bytes 
)
int _xbee_ota_xmodem_write ( void FAR *  context,
const void FAR *  buffer,
int16_t  bytes 
)
int xbee_ota_init ( xbee_ota_t ota,
wpan_dev_t dev,
const addr64 target 
)

Initialize an xbee_ota_t structure to send firmware updates to target using dev.

Calls xbee_xmodem_tx_init and xbee_xmodem_set_stream (therefore unnecessary to do so in main program).

Note that when performing OTA updates, you MUST use XBEE_XMODEM_FLAG_64 (64-byte xmodem blocks) if calling xbee_xmodem_tx_init directly.

Sends frames to the target to have it start the update cycle.

Parameters
[in,out]otastate-tracking structure for sending update
[in]devdevice to use for sending update
[in]target64-bit address of target device
Return values
0successfully initialized
-EINVALinvalid parameter passed in

Variable Documentation

uint8_t auth_data[XBEE_OTA_MAX_AUTH_LENGTH]

Payload used to initiate update.

uint8_t auth_length

Number of bytes in auth_data.

track state of circular buffer

track state of circular buffer

wpan_dev_t* dev

local device to send updates through

uint16_t flags

combination of XBEE_OTA_FLAG_* values

uint8_t raw[255+XBEE_CBUF_OVERHEAD]

buffer for xbee_cbuf_t structure and bytes received from target

uint8_t raw[255+XBEE_CBUF_OVERHEAD]

buffer for xbee_cbuf_t structure and bytes received from target

union { ... } rxbuf
addr64 target

network device to update

track state of Xmodem transfer