public class AutorunCommand extends AsciiSelfResponderCommandBase implements ICommandParameters
Modifier and Type | Field and Description |
---|---|
static int |
FILE_INDEX_INTERNAL
The index for internal Autorun file - limited to 256 bytes, if available
|
static int |
FILE_INDEX_SD_CARD
The index for SD Card Autorun storage, if fitted
|
LibraryCommandId
Constructor and Description |
---|
AutorunCommand() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildCommandLine(java.lang.StringBuilder line)
Builds the command line to send to the reader to execute the command
|
void |
clearLastResponse()
Clears the response ready to receive a new one
|
IAsciiCommand |
getAutorunCommand() |
DeleteConfirmation |
getDeleteFile() |
TriState |
getExecuteAutorun()
Gets or sets a value indicating whether the current Autorun file will be executed
|
java.lang.Integer |
getFileIndex() |
IFileLineReceivedDelegate |
getFileLineReceivedDelegate() |
TriState |
getReadAutorun()
Gets or sets a value indicating whether the current Autorun file will be read
|
TriState |
getReadParameters()
Gets or sets a value indicating whether the command should include a list of supported parameters and their current values
|
TriState |
getResetParameters()
Gets or sets a value indicating whether the command should reset all its parameters to default values
|
TriState |
getTakeNoAction()
Gets or sets a value indicating whether the command primary action should not be performed
(e.g.
|
java.lang.String |
getValue() |
boolean |
implementsReadParameters()
Gets a value indicating whether the implementing command uses the ReadParameters property
|
boolean |
implementsResetParameters()
Gets a value indicating whether the implementing command uses the ResetParameters property
|
boolean |
implementsTakeNoAction()
Gets a value indicating whether the implementing command uses the TakeNoAction property
|
protected boolean |
processReceivedLine(java.lang.String fullLine,
java.lang.String header,
java.lang.String value,
boolean moreAvailable)
Each correctly terminated line from the device is passed to this method for processing
|
protected void |
responseDidFinish(boolean async)
The is called when the responder received a line with an OK: or an ER: header.
|
void |
setAutorunCommand(IAsciiCommand command)
If set then this will be written to the current Autorun file even if the Value property has been set
Also, if set this will prevent the Read and Execute operations
|
void |
setDeleteFile(DeleteConfirmation deleteFile) |
void |
setExecuteAutorun(TriState executeAutorun) |
void |
setFileIndex(java.lang.Integer fileIndex)
Sets the autorun file that is affected by this command
|
void |
setFileLineReceivedDelegate(IFileLineReceivedDelegate fileLineReceivedDelegate) |
void |
setReadAutorun(TriState readAutorun) |
void |
setReadParameters(TriState value) |
void |
setResetParameters(TriState value) |
void |
setTakeNoAction(TriState value) |
void |
setValue(java.lang.String value)
If set then this will be written to the current Autorun file UNLESS the AutorunCommand property has been set
Also, if set this will prevent the Read and Execute operations
|
static AutorunCommand |
synchronousCommand()
Returns a new instance of the AutorunCommand class that will execute synchronously (as its own responder)
|
getMaxSynchronousWaitTime, getSynchronousCommandResponder, setMaxSynchronousWaitTime, setSynchronousCommandResponder
captureNonLibraryResponses, setCaptureNonLibraryResponses
getCommandLine, getCommandName, getResponseLifecycleDelegate, getResponseStarted, isResponseFinished, parseParameters, processReceivedLine, responseDidReceiveParameter, responseDidStart, setCommandName, setResponseLifecycleDelegate, setResponseStarted, splitParameters
appendToMessages, appendToParameters, appendToResponse, getErrorCode, getMessages, getParameters, getResponse, isSuccessful, setErrorCode, setIsSuccessful, setResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCommandLine, getCommandName
public static int FILE_INDEX_INTERNAL
public static int FILE_INDEX_SD_CARD
public final boolean implementsReadParameters()
implementsReadParameters
in interface ICommandParameters
public final boolean implementsResetParameters()
implementsResetParameters
in interface ICommandParameters
public final boolean implementsTakeNoAction()
implementsTakeNoAction
in interface ICommandParameters
public final TriState getReadParameters()
ICommandParameters
getReadParameters
in interface ICommandParameters
public final void setReadParameters(TriState value)
setReadParameters
in interface ICommandParameters
public final TriState getResetParameters()
ICommandParameters
getResetParameters
in interface ICommandParameters
public final void setResetParameters(TriState value)
setResetParameters
in interface ICommandParameters
public final TriState getTakeNoAction()
ICommandParameters
getTakeNoAction
in interface ICommandParameters
public final void setTakeNoAction(TriState value)
setTakeNoAction
in interface ICommandParameters
public java.lang.Integer getFileIndex()
public void setFileIndex(java.lang.Integer fileIndex)
fileIndex
- the index of the Autorun file to be usedpublic TriState getReadAutorun()
public void setReadAutorun(TriState readAutorun)
public TriState getExecuteAutorun()
public void setExecuteAutorun(TriState executeAutorun)
public DeleteConfirmation getDeleteFile()
public void setDeleteFile(DeleteConfirmation deleteFile)
deleteFile
- the delete confirmation status to setpublic IFileLineReceivedDelegate getFileLineReceivedDelegate()
public void setFileLineReceivedDelegate(IFileLineReceivedDelegate fileLineReceivedDelegate)
fileLineReceivedDelegate
- the fileLineReceivedDelegate to setpublic java.lang.String getValue()
public void setValue(java.lang.String value)
value
- the new autorun command line as a stringpublic IAsciiCommand getAutorunCommand()
public void setAutorunCommand(IAsciiCommand command)
command
- the new autorun command line as an AsciiCommandpublic static AutorunCommand synchronousCommand()
protected void buildCommandLine(java.lang.StringBuilder line)
buildCommandLine
in class AsciiSelfResponderCommandBase
line
- The command line to append to
When overriding this method call the base class to construct the command line as known to the base class and
then append the additional parameters to the end of the linepublic void clearLastResponse()
clearLastResponse
in interface IAsciiCommandResponder
clearLastResponse
in class AsciiCommandResponderBase
protected void responseDidFinish(boolean async)
responseDidFinish
in class AsciiCommandResponderBase
async
- True if the command finished asynchronouslyprotected boolean processReceivedLine(java.lang.String fullLine, java.lang.String header, java.lang.String value, boolean moreAvailable) throws java.lang.Exception
processReceivedLine
in class AsciiCommandLibraryResponderBase
fullLine
- The line to be processedheader
- The response line header excluding the colon e.g. 'CS' for a command started responsevalue
- The response line following the colon e.g. '.iv'moreAvailable
- When true indicates there are additional lines to be processed (and will also be passed to this method)java.lang.Exception