Digi XBee(R) ANSI C Host Library
|
Makes use of xbee/serial.h API for sending and receiving serial data. More...
Go to the source code of this file.
Data Structures | |
struct | xbee_xmodem_state_t |
Structure used to track the state of an Xmodem send. More... | |
Typedefs | |
typedef int(* | xbee_xmodem_read_fn) (void FAR *context, void FAR *buffer, int16_t bytes) |
Function to assign to file.read or stream.read member of an xbee_xmodem_state_t object. More... | |
typedef int(* | xbee_xmodem_write_fn) (void FAR *context, const void FAR *buffer, int16_t bytes) |
Function to assign to stream.write member of an xbee_xmodem_state_t object. More... | |
Enumerations | |
enum | xbee_xmodem_state { XBEE_XMODEM_STATE_FLUSH, XBEE_XMODEM_STATE_START, XBEE_XMODEM_STATE_SEND, XBEE_XMODEM_STATE_RESEND, XBEE_XMODEM_STATE_SENDING, XBEE_XMODEM_STATE_WAIT_ACK, XBEE_XMODEM_STATE_EOF, XBEE_XMODEM_STATE_FINAL_ACK, XBEE_XMODEM_STATE_SUCCESS, XBEE_XMODEM_STATE_FAILURE } |
Values for state member of xbee_xmodem_state_t. More... | |
Functions | |
int | xbee_xmodem_use_serport (xbee_xmodem_state_t *xbxm, xbee_serial_t *serport) |
Used for xmodem transfers over a simple serial port. More... | |
int | xbee_xmodem_set_source (xbee_xmodem_state_t *xbxm, void FAR *buffer, xbee_xmodem_read_fn read, const void FAR *context) |
Configure the data source for the Xmodem send. More... | |
int | xbee_xmodem_set_stream (xbee_xmodem_state_t *xbxm, xbee_xmodem_read_fn read, xbee_xmodem_write_fn write, const void FAR *context) |
Configure the stream used to communicate with the target. More... | |
int | xbee_xmodem_tx_init (xbee_xmodem_state_t *xbxm, uint16_t flags) |
Initialize state structure for use with xbee_xmodem_tx_tick() to send a file via Xmodem. More... | |
int | xbee_xmodem_tx_tick (xbee_xmodem_state_t *xbxm) |
Function to drive the Xmodem send state machine. More... | |
Xmodem Control Characters | |
#define | XMODEM_NAK 0x15 |
receiver requests XMODEM (with checksum), or did not receive last block | |
#define | XMODEM_CRC 'C' |
receiver requests XMODEM-CRC | |
#define | XMODEM_SOH 0x01 |
start of 128-byte block | |
#define | XMODEM_STX 0x02 |
start of 1024-byte block | |
#define | XMODEM_ACK 0x06 |
acknowledge receipt of block | |
#define | XMODEM_CAN 0x18 |
cancel transmission | |
#define | XMODEM_EOT 0x04 |
sender is ending transmission | |
Values for \c flags member of xbee_xmodem_state_t | |
#define | XBEE_XMODEM_FLAG_NONE 0x0000 |
macro for "no flags", used when calling xbee_xmodem_tx_init | |
#define | XBEE_XMODEM_FLAG_CHECKSUM 0x0001 |
blocks end with a 1-byte checksum | |
#define | XBEE_XMODEM_FLAG_CRC 0x0002 |
blocks end with a 16-bit CRC | |
#define | XBEE_XMODEM_FLAG_FORCE_CRC 0x0008 |
force use of XMODEM-CRC (by ignoring NAK at start of transfer) | |
#define | XBEE_XMODEM_MASK_BLOCKSIZE 0x0300 |
mask for determining block size | |
#define | XBEE_XMODEM_FLAG_128 0x0000 |
128-byte blocks (default setting) | |
#define | XBEE_XMODEM_FLAG_64 0x0100 |
64-byte blocks – non-standard block size used for OTA updates | |
#define | XBEE_XMODEM_FLAG_1K 0x0200 |
1KB blocks | |
#define | XBEE_XMODEM_FLAG_1024 XBEE_XMODEM_FLAG_1K |
alternate macro name for XBEE_XMODEM_FLAG_1K | |
#define | XBEE_XMODEM_FLAG_USER (XBEE_XMODEM_MASK_BLOCKSIZE | XBEE_XMODEM_FLAG_FORCE_CRC) |
mask of user-settable flags that can be passed to xbee_xmodem_tx_init | |
Makes use of xbee/serial.h API for sending and receiving serial data.