|
XBee Firmware Library
1.6.0
|
Files | |
| file | firmware.h |
| file | xbee_firmware.c |
Data Structures | |
| struct | xbee_fw_buffer_t |
| struct | xbee_fw_oem_state_t |
| struct | xbee_fw_source_t |
Typedefs | |
| typedef PACKED_STRUCT | _xbee_oem_header |
| typedef XBEE_BEGIN_DECLS struct xbee_fw_oem_state_t | xbee_fw_oem_state_t |
| typedef struct xbee_fw_source_t | xbee_fw_source_t |
Functions | |
| _xbee_firmware_debug int | _xbee_fw_buffer_read (void FAR *context, void FAR *buffer, int16_t bytes) |
| _xbee_firmware_debug int | _xbee_fw_buffer_seek (void FAR *context, uint32_t offset) |
| _xbee_firmware_debug int | _xbee_fw_send_request (xbee_fw_source_t *source, const FAR char *request, int next_state) |
| _xbee_firmware_debug int | _xbee_oem_verify (xbee_fw_source_t *source) |
| int | xbee_fw_buffer_init (xbee_fw_buffer_t *fw, uint32_t length, const char FAR *address) |
| Helper function for setting up an xbee_fw_buffer_t for use with a source firmware image held entirely in a buffer. More... | |
| _xbee_firmware_debug uint16_t | xbee_fw_hex2word (const char *pString) |
| unsigned int | xbee_fw_install_ebl_state (xbee_fw_source_t *source) |
| Returns a unique value indicating the state of the .EBL install process. More... | |
| int | xbee_fw_install_ebl_tick (xbee_fw_source_t *source) |
| Drive the firmware update process for boards that use .EBL files to store their firmware. More... | |
| int | xbee_fw_install_hcs08_tick (xbee_fw_source_t *source) |
| Drive the firmware update process for the HCS08 application on Programmable XBee modules. More... | |
| int | xbee_fw_install_init (xbee_dev_t *xbee, const wpan_address_t FAR *target, xbee_fw_source_t *source) |
| Prepare to install new firmware on an attached XBee module. More... | |
| int | xbee_fw_install_oem_tick (xbee_fw_source_t *source) |
| Install the firmware image stored in source. More... | |
| _xbee_firmware_debug int | xbee_fw_read_byte (xbee_fw_source_t *source) |
| check return value of source->read here and in _uint16 and _uint32? More... | |
| _xbee_firmware_debug uint16_t | xbee_fw_read_uint16 (xbee_fw_source_t *source) |
| _xbee_firmware_debug uint32_t | xbee_fw_read_uint32 (xbee_fw_source_t *source) |
| char FAR * | xbee_fw_status_ebl (xbee_fw_source_t *source, char FAR *buffer) |
| Update buffer with the current install status of source. Note that this string will only change if the return value of xbee_fw_install_ebl_state() has changed. More... | |
| char FAR * | xbee_fw_status_oem (xbee_fw_source_t *source, char FAR *buffer) |
| Update buffer with the current install status of source. More... | |
Variables | |
| const char FAR * | address |
| uint16_t | block_length |
| uint32_t | block_offset |
| char | bootloader_cmd |
| char | buffer [128+5] |
| uint16_t | checksum |
| void FAR * | context |
| uint32_t | cur_offset |
| uint32_t | firmware_length |
| uint16_t | header_len |
| uint32_t | image_len |
| uint32_t | length |
| uint8_t | module_id |
| int | next_state |
| xbee_fw_oem_state_t oem | |
| uint32_t | offset |
| int(* | read )(void FAR *context, void FAR *buffer, int16_t bytes) |
| int(* | seek )(void FAR *context, uint32_t offset) |
| uint8_t | software_id |
| xbee_fw_source_t | source |
| int | state |
| uint32_t | timer |
| int | tries |
| union { | |
| xbee_fw_oem_state_t oem | |
| xbee_xmodem_state_t xbxm | |
| } | u |
| xbee_dev_t * | xbee |
| xbee_oem_header_t | |
| xbee_xmodem_state_t xbxm | |
This layer makes use of lower layers to perform updates on XBee modules. Both file formats are supported – .ebl (ZNet, ZigBee, Smart Energy) and .oem (DigiMesh).
| typedef PACKED_STRUCT _xbee_oem_header |
| typedef XBEE_BEGIN_DECLS struct xbee_fw_oem_state_t xbee_fw_oem_state_t |
| typedef struct xbee_fw_source_t xbee_fw_source_t |
| anonymous enum |
| _xbee_firmware_debug int _xbee_fw_buffer_read | ( | void FAR * | context, |
| void FAR * | buffer, | ||
| int16_t | bytes | ||
| ) |
| _xbee_firmware_debug int _xbee_fw_buffer_seek | ( | void FAR * | context, |
| uint32_t | offset | ||
| ) |
| _xbee_firmware_debug int _xbee_fw_send_request | ( | xbee_fw_source_t * | source, |
| const FAR char * | request, | ||
| int | next_state | ||
| ) |
| _xbee_firmware_debug int _xbee_oem_verify | ( | xbee_fw_source_t * | source | ) |
| _xbee_firmware_debug int xbee_fw_buffer_init | ( | xbee_fw_buffer_t * | fw, |
| uint32_t | length, | ||
| const char FAR * | address | ||
| ) |
Helper function for setting up an xbee_fw_buffer_t for use with a source firmware image held entirely in a buffer.
| [out] | fw | structure to configure for reading firmware from a buffer |
| [in] | length | number of bytes in firmware image |
| [in] | address | address of buffer containing firmware |
| 0 | success |
| -EINVAL | invalid parameter |
| _xbee_firmware_debug uint16_t xbee_fw_hex2word | ( | const char * | pString | ) |
| _xbee_firmware_debug unsigned int xbee_fw_install_ebl_state | ( | xbee_fw_source_t * | source | ) |
Returns a unique value indicating the state of the .EBL install process.
| [in] | source | object used to track state of transfer |
| _xbee_firmware_debug int xbee_fw_install_ebl_tick | ( | xbee_fw_source_t * | source | ) |
Drive the firmware update process for boards that use .EBL files to store their firmware.
| [in,out] | source | object used to track state of transfer |
| 0 | update is in progress |
| 1 | update completed successfully |
| -EINVAL | source is invalid |
| -EIO | general failure |
| -ETIMEDOUT | connection timed out waiting for data from target |
| _xbee_firmware_debug int xbee_fw_install_hcs08_tick | ( | xbee_fw_source_t * | source | ) |
Drive the firmware update process for the HCS08 application on Programmable XBee modules.
| [in,out] | source | object used to track state of transfer |
| 0 | update is in progress |
| 1 | update completed successfully |
| -EINVAL | source is invalid |
| -EIO | general failure |
| -ETIMEDOUT | connection timed out waiting for data from target |
| _xbee_firmware_debug int xbee_fw_install_init | ( | xbee_dev_t * | xbee, |
| const wpan_address_t FAR * | target, | ||
| xbee_fw_source_t * | source | ||
| ) |
Prepare to install new firmware on an attached XBee module.
The host must be able to control the reset pin of the XBee module.
| [in] | xbee | XBee device to install firmware on. Must have been set up with xbee_dev_init(). |
| [in] | target | The current version of this library can only update the local XBee module, so this parameter should always be NULL. When over-the-air (OTA) updating is supported, this paramter will be the address of a remote module to update. |
| [in] | source | Structure with function pointers for seeking and reading from the new firmware image. |
@retval 0 success
@retval -EINVAL NULL parameter passed to function
@retval -EIO XBee device passed to function doesn't have a
callback for controlling the reset pin on the XBee
module.
| _xbee_firmware_debug int xbee_fw_install_oem_tick | ( | xbee_fw_source_t * | source | ) |
Install the firmware image stored in source.
You must call xbee_fw_install_init() on the source before calling this tick function.
If successful, XBee will be running the new firmware at 115,200 baud.
| [in] | source | Firmware source initialized with seek and read functions. |
| 1 | Successfully installed new firmware. |
| 0 | Firmware installation in progress (incomplete). |
| -EILSEQ | firmware does not contain a valid firmware image. |
| -EBADMSG | Firmware checksum failed, image is bad. |
| -EIO | Couldn't establish communications with XBee module. |
| -ENOTSUP | Firmware is not compatible with this hardware. |
| _xbee_firmware_debug int xbee_fw_read_byte | ( | xbee_fw_source_t * | source | ) |
check return value of source->read here and in _uint16 and _uint32?
| _xbee_firmware_debug uint16_t xbee_fw_read_uint16 | ( | xbee_fw_source_t * | source | ) |
| _xbee_firmware_debug uint32_t xbee_fw_read_uint32 | ( | xbee_fw_source_t * | source | ) |
| _xbee_firmware_debug char FAR * xbee_fw_status_ebl | ( | xbee_fw_source_t * | source, |
| char FAR * | buffer | ||
| ) |
Update buffer with the current install status of source. Note that this string will only change if the return value of xbee_fw_install_ebl_state() has changed.
| [in] | source | State variable to generate status string for. |
| [out] | buffer | Buffer (at least 80 bytes) to receive dynamic status string. |
| _xbee_firmware_debug char FAR * xbee_fw_status_oem | ( | xbee_fw_source_t * | source, |
| char FAR * | buffer | ||
| ) |
Update buffer with the current install status of source.
| [in] | source | State variable to generate status string for. |
| [out] | buffer | Buffer (at least 80 bytes) to receive dynamic status string. |
| const char FAR* address |
| uint16_t block_length |
| uint32_t block_offset |
| char bootloader_cmd |
| char buffer[128+5] |
| uint16_t checksum |
| void FAR* context |
| uint32_t cur_offset |
| uint32_t firmware_length |
| uint16_t header_len |
| uint32_t image_len |
| uint32_t length |
| uint8_t module_id |
| int next_state |
| uint32_t offset |
| int(* read) (void FAR *context, void FAR *buffer, int16_t bytes) |
| int(* seek) (void FAR *context, uint32_t offset) |
| uint8_t software_id |
| xbee_fw_source_t source |
| int state |
| uint32_t timer |
| int tries |
| union { ... } u |
| xbee_dev_t* xbee |
| xbee_oem_header_t |
| xbee_xmodem_state_t xbxm |
| xbee_xmodem_state_t xbxm |
1.8.10