Digi XBee(R) ANSI C Host Library
Macros | Functions
xbee_xmodem.c File Reference

Xmodem send implementation, used for XBee firmware updates. More...

#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "xbee/platform.h"
#include "xbee/xmodem.h"
#include "xbee/xmodem_crc16.h"

Functions

int _xbee_xmodem_ser_read (void FAR *context, void FAR *buffer, int16_t bytes)
 
int _xbee_xmodem_ser_write (void FAR *context, const void FAR *buffer, int16_t bytes)
 
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_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_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_getchar (xbee_xmodem_state_t *xbxm)
 
int _xbee_xmodem_putchar (xbee_xmodem_state_t *xbxm, uint8_t ch)
 
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 _assemble_packet (xbee_xmodem_state_t *xbxm, uint16_t block_size)
 
uint16_t _block_size (xbee_xmodem_state_t *xbxm)
 
int xbee_xmodem_tx_tick (xbee_xmodem_state_t *xbxm)
 Function to drive the Xmodem send state machine. More...
 

Detailed Description

Xmodem send implementation, used for XBee firmware updates.

Todo:
Have timeout values adjust based on link latency. Start out with a high timeout (10 seconds?) and adjust down based on actual response time (maybe 150% of last ACK's delay?) Timeout for EOT should start at timeout value from last block.