Public Member Functions | |
String | Descriptor () |
int | BytesAvailable () |
boolean | Connected () |
void | Close () |
void | Open () |
byte[] | Read () |
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 | Write (byte[] dataOut) |
void | 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. More... | |
byte[] | 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. More... | |
int com.UniPRT.Sdk.Comm.IComm.BytesAvailable | ( | ) |
Get the number of bytes available to read.
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
Referenced by com.UniPRT.Sdk.Comm.AComm.WaitForData(), and com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().
void com.UniPRT.Sdk.Comm.IComm.Close | ( | ) |
Close the connection.
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
Referenced by com.UniPRT.Sdk.Json.JsonCommController.JsonConnection.Dispose().
boolean com.UniPRT.Sdk.Comm.IComm.Connected | ( | ) |
Check if connection is established.
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
Referenced by com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForMsgFrame().
String com.UniPRT.Sdk.Comm.IComm.Descriptor | ( | ) |
Get the string descriptor of the connection.
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
Referenced by com.UniPRT.Sdk.Json.JsonCommController.CreateMgmtComm(), com.UniPRT.Sdk.Json.JsonComm.Dispose(), and com.UniPRT.Sdk.Json.JsonCommController.JsonConnection.JsonConnection().
void com.UniPRT.Sdk.Comm.IComm.Open | ( | ) |
Open the connection.
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
Referenced by com.UniPRT.Sdk.Json.JsonCommController.JsonConnection.JsonConnection().
byte [] com.UniPRT.Sdk.Comm.IComm.Read | ( | ) |
Read all available bytes.
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
Referenced by com.UniPRT.Sdk.Comm.AComm.Read(), and com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().
void com.UniPRT.Sdk.Comm.IComm.Read | ( | OutputStream | binDataIn | ) | throws IOException |
Read all available bytes into the stream passed in.
binDataIn | Data input stream. |
IOException |
Implemented in com.UniPRT.Sdk.Comm.AComm.
void com.UniPRT.Sdk.Comm.IComm.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. |
Implemented in com.UniPRT.Sdk.Comm.AComm.
void com.UniPRT.Sdk.Comm.IComm.Write | ( | byte[] | dataOut | ) |
Write all bytes from the array passed in.
dataOut | Byte array to write. |
Implemented in com.UniPRT.Sdk.Comm.TcpConnection.
void com.UniPRT.Sdk.Comm.IComm.Write | ( | InputStream | binReader | ) | throws IOException |
Write from input stream to output stream.
[in] | binReader | Source data to send |
Implemented in com.UniPRT.Sdk.Comm.AComm.
byte [] com.UniPRT.Sdk.Comm.IComm.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. |
Implemented in com.UniPRT.Sdk.Comm.AComm.
void com.UniPRT.Sdk.Comm.IComm.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. |
Implemented in com.UniPRT.Sdk.Comm.AComm.
Referenced by com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForMsgFrame().