public final class SerialComXModem extends Object
Implements XMODEM-128/XMODEM-CHECKSUM file transfer protocol state machine in Java.
| Constructor and Description |
|---|
SerialComXModem(SerialComManager scm,
long handle,
File fileToProcess,
boolean textMode,
ISerialComXmodemProgress progressListener,
SerialComFTPCMDAbort transferState,
int osType)
Allocates a new SerialComXModem object with given details and associate it with the given
instance of SerialComManager class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
receiveFileX()
Represents actions to execute in state machine to implement xmodem protocol for receiving files.
|
boolean |
sendFileX()
Represents actions to execute in state machine to implement xmodem protocol for sending files.
|
public SerialComXModem(SerialComManager scm, long handle, File fileToProcess, boolean textMode, ISerialComXmodemProgress progressListener, SerialComFTPCMDAbort transferState, int osType)
Allocates a new SerialComXModem object with given details and associate it with the given instance of SerialComManager class.
scm - SerialComManager instance associated with this handle.handle - of the port on which file is to be communicated.fileToProcess - File instance representing file to be communicated.textMode - if true file will be sent as text file (ASCII mode), if false file will be sent
as binary file.progressListener - object of class which implements ISerialComXmodemProgress interface and is
interested in knowing how many blocks have been sent/received till now.transferState - if application wish to abort sending/receiving file at instant of time due to
any reason, it can call abortTransfer method on this object. It can be null if application
does not wish to abort sending/receiving file explicitly.osType - operating system on which this application is running.public boolean sendFileX()
throws IOException
Represents actions to execute in state machine to implement xmodem protocol for sending files.
SecurityException - if unable to read from file to be sent.IOException - if any I/O error occurs.com.serialpundit.core.SerialComException - if any I/0 error on serial port communication occurs.public boolean receiveFileX()
throws IOException
Represents actions to execute in state machine to implement xmodem protocol for receiving files.
IOException - if any I/O error occurs.com.serialpundit.core.SerialComException - if any I/0 error on serial port communication occurs.Copyright © 2017. All rights reserved.