S.F.T. XMODEM Library  1.0
XModem API

Functions

short XReceive (SDClass *pSD, HardwareSerial *pSer, const char *szFilename)
 Receive a file using XMODEM protocol (ARDUINO version)
int XSend (SDClass *pSD, HardwareSerial *pSer, const char *szFilename)
 Send a file using XMODEM protocol (ARDUINO version)

Detailed Description

high-level API functions


Function Documentation

short XReceive ( SDClass *  pSD,
HardwareSerial *  pSer,
const char *  szFilename 
)

Receive a file using XMODEM protocol (ARDUINO version)

Parameters:
pSDA pointer to an SDClass object, such as &SD (the default SD library object is 'SD')
pSerA pointer to a HardwareSerial object, such as &Serial
szFilenameA pointer to a (const) 0-byte terminated string containing the file name
Returns:
A value of zero on success, negative on failure, positive if canceled

Call this function to receive a file, passing the SD card's initialized SDClass object pointer, and the pointer to the 'HardwareSerial' object to be used for serial communication, and the name of the file to create from the XMODEM stream. The function will return a value of zero on success. On failure or cancelation, the file will be deleted.
If the specified file exists before calling this function, it will be overwritten. If you do not want to unconditionally overwrite an existing file, you should test to see if it exists first using the SD library.

Definition at line 1369 of file xmodem.c.

int XSend ( SDClass *  pSD,
HardwareSerial *  pSer,
const char *  szFilename 
)

Send a file using XMODEM protocol (ARDUINO version)

Parameters:
pSDA pointer to an SDClass object, such as &SD (the default SD library object is 'SD')
pSerA pointer to a HardwareSerial object, such as &Serial
szFilenameA pointer to a (const) 0-byte terminated string containing the file name
Returns:
A value of zero on success, negative on failure, positive if canceled

Call this function to send a file, passing the SD card's initialized SDClass object pointer, and the pointer to the 'HardwareSerial' object to be used for serial communication, and the name of the file to send via the XMODEM stream. The function will return a value of zero on success. If the file does not exist, the function will return a 'failure' value and cancel the transfer.

Definition at line 1403 of file xmodem.c.