public class CmdExecuter extends java.lang.Object implements AnswerComm_ifc
Modifier and Type | Field and Description |
---|---|
private byte[] |
bufferAnswerData
This reference is used to refer the answer buffer.
|
private CmdConsumer_ifc |
cmdConsumer |
private Comm |
comm |
private int |
ctFailedTelgPart |
private byte[] |
data_bufferAnswerData
Buffer for the answer telegram.
|
(package private) InspcDataExchangeAccess.InspcDatagram |
datagramCmd |
(package private) InspcDataExchangeAccess.Inspcitem |
infoCmd |
private int |
maxNrofAnswerBytes |
private InspcDataExchangeAccess.InspcDatagram |
myAnswerData |
private int |
nrofBytesAnswer |
private int |
nrofSentBytes |
private boolean |
useTelgHead
true than the myAnswerdata is of type DataExchangeTelg_Inspc,
false: older form: without head.
|
static java.lang.String |
version
Version, history and license.
|
Constructor and Description |
---|
CmdExecuter(CmdConsumer_ifc commandConsumer) |
Modifier and Type | Method and Description |
---|---|
void |
completeConstruction(Comm comm) |
(package private) boolean |
executeCmd(byte[] buffer,
int nrofBytesReceived)
Executes the given command received with this datagram
|
int |
txAnswer(int nrofAnswerBytesPart,
boolean bLastTelg)
Send the current answer datagram as answer.
|
public static final java.lang.String version
final InspcDataExchangeAccess.InspcDatagram datagramCmd
final InspcDataExchangeAccess.Inspcitem infoCmd
private final CmdConsumer_ifc cmdConsumer
private final int maxNrofAnswerBytes
private int nrofBytesAnswer
private int nrofSentBytes
private int ctFailedTelgPart
private Comm comm
private final byte[] data_bufferAnswerData
private final byte[] bufferAnswerData
private final InspcDataExchangeAccess.InspcDatagram myAnswerData
private boolean useTelgHead
public CmdExecuter(CmdConsumer_ifc commandConsumer)
public void completeConstruction(Comm comm)
boolean executeCmd(byte[] buffer, int nrofBytesReceived)
buffer
- contains the datagramnrofBytesReceived
- public int txAnswer(int nrofAnswerBytesPart, boolean bLastTelg)
InspcDataExchangeAccess.InspcDatagram#incrAnswerNr()
was invoked, therewith an answer starts with 1. That increment is important for more as one answer datagrams.
The head is initialized only one time with the data from the request telegram, the answerNr is incremented always.
The length of the datagram is set to the head using InspcDataExchangeAccess.InspcDatagram#setLengthDatagram(int)
txAnswer
in interface AnswerComm_ifc
nrofAnswerBytesPart
- Number of bytes of a part, which is prepared new
and not returned from executeMonitorCmd_CmdConsumer_ifcInspc(...) yet.
This parameter is meanfull if a telegram will be sent
while executeMonitorCmd_CmdConsumer_ifcInspc(...) is running.
If the last telegramm will be sent, it should be 0.bLastTelg
- true than the bit for last telg in the sequence counter is set.
false than the last-telg-bit isn't set and a new telg will be prepared.AnswerComm_ifc.txAnswer(int, boolean)