UniPRT SDK  v1.0.0.0
com.UniPRT.Sdk.Comm.IComm Interface Reference
Inheritance diagram for com.UniPRT.Sdk.Comm.IComm:
com.UniPRT.Sdk.Comm.AComm com.UniPRT.Sdk.Comm.TcpConnection

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...
 

Member Function Documentation

◆ BytesAvailable()

int com.UniPRT.Sdk.Comm.IComm.BytesAvailable ( )

Get the number of bytes available to read.

Returns
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().

◆ Close()

void com.UniPRT.Sdk.Comm.IComm.Close ( )

◆ Connected()

boolean com.UniPRT.Sdk.Comm.IComm.Connected ( )

Check if connection is established.

Returns
true if connection is established, otherwise false.

Implemented in com.UniPRT.Sdk.Comm.TcpConnection.

Referenced by com.UniPRT.Sdk.Json.JsonComm.SendAndWaitForMsgFrame().

◆ Descriptor()

String com.UniPRT.Sdk.Comm.IComm.Descriptor ( )

Get the string descriptor of the connection.

Returns
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().

◆ Open()

void com.UniPRT.Sdk.Comm.IComm.Open ( )

◆ Read() [1/2]

byte [] com.UniPRT.Sdk.Comm.IComm.Read ( )

Read all available bytes.

Returns
Array of bytes read.

Implemented in com.UniPRT.Sdk.Comm.TcpConnection.

Referenced by com.UniPRT.Sdk.Comm.AComm.Read(), and com.UniPRT.Sdk.Comm.AComm.WriteAndWaitForResponse().

◆ Read() [2/2]

void com.UniPRT.Sdk.Comm.IComm.Read ( OutputStream  binDataIn) throws IOException

Read all available bytes into the stream passed in.

Parameters
binDataInData input stream.
Exceptions
IOException

Implemented in com.UniPRT.Sdk.Comm.AComm.

◆ WaitForData()

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.

Parameters
[in]msTimeOutMillisecond timeout before return if no data received.

Implemented in com.UniPRT.Sdk.Comm.AComm.

◆ Write() [1/2]

void com.UniPRT.Sdk.Comm.IComm.Write ( byte[]  dataOut)

Write all bytes from the array passed in.

Parameters
dataOutByte array to write.

Implemented in com.UniPRT.Sdk.Comm.TcpConnection.

◆ Write() [2/2]

void com.UniPRT.Sdk.Comm.IComm.Write ( InputStream  binReader) throws IOException

Write from input stream to output stream.

Parameters
[in]binReaderSource data to send

Implemented in com.UniPRT.Sdk.Comm.AComm.

◆ WriteAndWaitForResponse() [1/2]

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.

Return values
byte[]Array of bytes received from connection. Data returned is any data received or up to completetionToken if token received
Parameters
[in]dataOutSource byte array to write to connection.
[in]responseStartTimeOutTimeout to wait for first data to be received. Time to first byte.
[in]responseEndTimeOutTimeout of no new data received. Time after last byte.
[in]completetionTokenString 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.

◆ WriteAndWaitForResponse() [2/2]

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.

Parameters
[out]binDataInDestination stream to store response received from connection.
[in]binDataOutSource stream data to write to connection.
[in]responseStartTimeOutTimeout to wait for first data to be received. Time to first byte.
[in]responseEndTimeOutTimeout of no new data received. Time after last byte.
[in]completetionTokenString 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().


The documentation for this interface was generated from the following file: