S.F.T. XMODEM Library
1.0
|
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) |
high-level API functions
short XReceive | ( | SDClass * | pSD, |
HardwareSerial * | pSer, | ||
const char * | szFilename | ||
) |
Receive a file using XMODEM protocol (ARDUINO version)
pSD | A pointer to an SDClass object, such as &SD (the default SD library object is 'SD') |
pSer | A pointer to a HardwareSerial object, such as &Serial |
szFilename | A pointer to a (const) 0-byte terminated string containing the file name |
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.
int XSend | ( | SDClass * | pSD, |
HardwareSerial * | pSer, | ||
const char * | szFilename | ||
) |
Send a file using XMODEM protocol (ARDUINO version)
pSD | A pointer to an SDClass object, such as &SD (the default SD library object is 'SD') |
pSer | A pointer to a HardwareSerial object, such as &Serial |
szFilename | A pointer to a (const) 0-byte terminated string containing the file name |
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.