Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# XModem Transmit/Receive Implementation with CRC and 1K support (xmodem.c)
[General Libraries]

## Detailed Description

     #include "xmodem.h"

Overview
  This XModem implementation supports both 128b and 1K packets with or without CRC checking. The xmodem library must be initialized to use a particular I/O stream by passing appropriate getbyte() and sendbyte() functions to xmodemInit(). The xmodem transfer routines also expect function pointers to read and write data blocks on the local system. While this use of function pointers increases code size, it has great adaptability. The generalized read/write data functions mean that it is easy to pipe data to/from any storage device like EEPROMs or flash cards, rather than being limited to just processor RAM.

## Defines
#define | SOH 0x01
#define | STX 0x02
#define | EOT 0x04
#define | ACK 0x06
#define | NAK 0x15
#define | CAN 0x18
#define | CTRLZ 0x1A
#define | XMODEM_TIMEOUT_DELAY 1000
#define | XMODEM_RETRY_LIMIT 16
#define | XMODEM_ERROR_REMOTECANCEL -1
#define | XMODEM_ERROR_OUTOFSYNC -2
#define | XMODEM_ERROR_RETRYEXCEED -3
## Functions
void | xmodemInit (void(*sendbyte_func)(unsigned char c), int(*getbyte_func)(void))
| initialize xmodem stream I/O routines
long | xmodemReceive (int(*write)(unsigned char *buffer, int size))
| xmodem receive
long | xmodemTransmit (int(*read)(unsigned char *buffer, int size))
| xmodem transmit
int | xmodemCrcCheck (int crcflag, const unsigned char *buffer, int size)
| xmodem CRC/checksum error checking
int | xmodemInTime (unsigned short timeout)
| get incoming character (wait for timeout)
void | xmodemInFlush (void)
| flush incoming character stream