S.F.T. XMODEM Library
1.0
|
Functions | |
int | XReceive (SERIAL_TYPE hSer, const char *szFilename, int nMode) |
Receive a file using XMODEM protocol. | |
int | XSend (SERIAL_TYPE hSer, const char *szFilename) |
Send a file using XMODEM protocol. |
high-level API functions
int XReceive | ( | SERIAL_TYPE | hSer, |
const char * | szFilename, | ||
int | nMode | ||
) |
Receive a file using XMODEM protocol.
hSer | A 'HANDLE' for the open serial connection |
szFilename | A pointer to a (const) 0-byte terminated string containing the file name |
nMode | The file mode to be used on create (RWX bits) |
Call this function to receive a file, passing the handle to the open serial connection, and the name and mode 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.
int XSend | ( | SERIAL_TYPE | hSer, |
const char * | szFilename | ||
) |
Send a file using XMODEM protocol.
hSer | A 'HANDLE' for the open serial connection |
szFilename | A pointer to a (const) 0-byte terminated string containing the file name |
Call this function to receive a file, passing the handle to the open serial connection, and the name and mode 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.