22 #ifndef XBEE_BL_GEN3_H 23 #define XBEE_BL_GEN3_H 30 typedef enum xbee_gen3_state {
32 XBEE_GEN3_STATE_ENTER_BOOTLOADER,
33 XBEE_GEN3_STATE_GET_BL_VERSION,
34 XBEE_GEN3_STATE_BL_VERSION,
35 XBEE_GEN3_STATE_BL_PROTOCOL,
36 XBEE_GEN3_STATE_BAUD_RATE,
37 XBEE_GEN3_STATE_EXT_VERSION,
38 XBEE_GEN3_STATE_START_TRANSFER,
39 XBEE_GEN3_STATE_SEND_PAGE,
40 XBEE_GEN3_STATE_LOAD_PAGE,
41 XBEE_GEN3_STATE_VERIFY,
43 XBEE_GEN3_STATE_SUCCESS,
44 XBEE_GEN3_STATE_FAILURE
47 #define XBEE_GEN3_UPLOAD_PAGE_SIZE 512 64 xbee_gen3_state_t state;
65 xbee_gen3_state_t next_state;
67 #define XBEE_GEN3_BL_FLAG_RETRY_MASK (0xFF) 68 #define XBEE_GEN3_BL_FLAG_QUERY_ONLY (1<<8) 69 #define XBEE_GEN3_BL_FLAG_PROTO1 (1<<9) 70 #define XBEE_GEN3_BL_FLAG_EOF (1<<10) 84 char buffer[XBEE_GEN3_UPLOAD_PAGE_SIZE];
95 #define XBEE_GEN3_FW_LOAD_TIMEOUT_MS 10000 166 #define XBEE_GEN3_STATUS_BUF_SIZE 60 186 #endif // XBEE_BL_GEN3_H unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
WPAN datatypes and support functions, valid for ZigBee and DigiMesh.
const char * xbee_bl_gen3_install_status(xbee_gen3_update_t *source, char buffer[XBEE_GEN3_STATUS_BUF_SIZE])
Return a string describing the current state of the firmware update.
Definition: xbee_bl_gen3.c:493
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
uint16_t xbee_bl_gen3_install_state(xbee_gen3_update_t *source)
Return a unique value identifying the install state.
Definition: xbee_bl_gen3.c:112
uint16_t bl_version
parsed response from 'B' cmd
Definition: bl_gen3.h:72
int16_t page_offset
Current offset into buffer (0 - <n-1>); -1 if sending page header; <n> if sending checksum/CRC16 (whe...
Definition: bl_gen3.h:77
int xbee_bl_gen3_install_init(xbee_dev_t *xbee, xbee_gen3_update_t *source)
Prepare to install new firmware on an attached XBee module.
Definition: xbee_bl_gen3.c:96
uint16_t page_num
page we're sending to BL
Definition: bl_gen3.h:73
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
xbee_gen3_extended_ver_t ext_ver
parsed response from 'V' cmd
Definition: bl_gen3.h:79
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
int xbee_bl_gen3_install_tick(xbee_gen3_update_t *source)
Install the firmware image stored in source.
Definition: xbee_bl_gen3.c:225
int(* read)(void *context, void *buffer, int16_t bytes)
Function to read firmware image contents.
Definition: bl_gen3.h:89
char buffer[XBEE_GEN3_UPLOAD_PAGE_SIZE]
buffer for upload page, must persist for duration of update
Definition: bl_gen3.h:84
short int16_t
16-bit signed integer
Definition: platform_config.h:40
Typedef used to hold a 64-bit IEEE address, represented as 8 bytes, 4 16-bit values or 2 32-bit value...
Definition: types.h:34
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
void * context
context passed to .read() function
Definition: bl_gen3.h:92
#define XBEE_GEN3_STATUS_BUF_SIZE
Minimum size of buffer passed to xbee_bl_gen3_install_status()
Definition: bl_gen3.h:166