Abstract class that implements default functionality for IComm interface class. More...
Public Member Functions | |
void | Read (OutputStream binDataIn) throws IOException |
void | WaitForData (int msTimeOut) |
Waits until data available BytesAvailable in current thread. Current thread sleeps until data received or timeout reached. Blocking call. More... | |
void | Write (InputStream binReader) throws IOException |
Write from input stream to output stream. More... | |
void | WriteAndWaitForResponse (OutputStream binDataIn, InputStream binDataOut, int responseStartTimeOut, int responseEndTimeOut, String completetionToken) throws IOException |
Write binDataOut stream data to output stream and return data received in binDataIn stream. Data returned is any data received or up to completion token if received. Wait for response timeout before returning. More... | |
byte[] | WriteAndWaitForResponse (byte[] dataOut, int responseStartTimeOut, int responseEndTimeOut, String completetionToken) throws IOException |
Write byte data to output stream and return data received. Data returned is any data received or up to completion token if received. Wait for response timeout before returning. More... | |
![]() | |
String | Descriptor () |
int | BytesAvailable () |
boolean | Connected () |
void | Close () |
void | Open () |
byte[] | Read () |
void | Write (byte[] dataOut) |
Private Attributes | |
final int | MAX_PACKET_SIZE = 1024 * 4 |
Abstract class that implements default functionality for IComm interface class.
void com.UniPRT.Sdk.Comm.AComm.Read | ( | OutputStream | binDataIn | ) | throws IOException |
Read all available bytes into the stream passed in.
binDataIn | Data input stream. |
IOException |
Implements com.UniPRT.Sdk.Comm.IComm.
References com.UniPRT.Sdk.Comm.IComm.Read().
void com.UniPRT.Sdk.Comm.AComm.WaitForData | ( | int | msTimeOut | ) |
Waits until data available BytesAvailable in current thread. Current thread sleeps until data received or timeout reached. Blocking call.
[in] | msTimeOut | Millisecond timeout before return if no data received. |
Implements com.UniPRT.Sdk.Comm.IComm.
References com.UniPRT.Sdk.Comm.IComm.BytesAvailable().
Referenced by com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().
void com.UniPRT.Sdk.Comm.AComm.Write | ( | InputStream | binReader | ) | throws IOException |
Write from input stream to output stream.
[in] | binReader | Source data to send |
Implements com.UniPRT.Sdk.Comm.IComm.
References com.UniPRT.Sdk.Comm.AComm.MAX_PACKET_SIZE.
Referenced by com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().
byte [] com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse | ( | byte[] | dataOut, |
int | responseStartTimeOut, | ||
int | responseEndTimeOut, | ||
String | completionToken | ||
) | throws IOException |
Write byte data to output stream and return data received. Data returned is any data received or up to completion token if received. Wait for response timeout before returning.
byte[] | Array of bytes received from connection. Data returned is any data received or up to completetionToken if token received |
[in] | dataOut | Source byte array to write to connection. |
[in] | responseStartTimeOut | Timeout to wait for first data to be received. Time to first byte. |
[in] | responseEndTimeOut | Timeout of no new data received. Time after last byte. |
[in] | completetionToken | String token denoting the end of the response expected. This can be empty string if simply want to wait for response after writing data to connection. |
Implements com.UniPRT.Sdk.Comm.IComm.
References com.UniPRT.Sdk.Comm.IComm.BytesAvailable(), com.UniPRT.Sdk.Comm.IComm.Read(), com.UniPRT.Sdk.Comm.AComm.WaitForData(), and com.UniPRT.Sdk.Comm.AComm.Write().
void com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse | ( | OutputStream | binDataIn, |
InputStream | binDataOut, | ||
int | responseStartTimeOut, | ||
int | responseEndTimeOut, | ||
String | completionToken | ||
) | throws IOException |
Write binDataOut stream data to output stream and return data received in binDataIn stream. Data returned is any data received or up to completion token if received. Wait for response timeout before returning.
[out] | binDataIn | Destination stream to store response received from connection. |
[in] | binDataOut | Source stream data to write to connection. |
[in] | responseStartTimeOut | Timeout to wait for first data to be received. Time to first byte. |
[in] | responseEndTimeOut | Timeout of no new data received. Time after last byte. |
[in] | completetionToken | String token denoting the end of the response expected. This can be empty string if simply want to wait for response after writing data to connection. |
Implements com.UniPRT.Sdk.Comm.IComm.
References com.UniPRT.Sdk.Comm.IComm.BytesAvailable(), com.UniPRT.Sdk.Comm.IComm.Read(), com.UniPRT.Sdk.Comm.AComm.WaitForData(), and com.UniPRT.Sdk.Comm.AComm.Write().
|
private |
Referenced by com.UniPRT.Sdk.Comm.AComm.Write().