A protocol defining the interface for communication classes.
More...
#include <IComm.h>
|
NSString * | descriptor |
| The descriptor for the communication interface.
|
|
int | bytesAvailable |
| The number of bytes available to read.
|
|
BOOL | isConnected |
| A flag indicating whether the connection is established.
|
|
A protocol defining the interface for communication classes.
◆ close
Closes the communication interface.
Reimplemented in AComm, and TcpComm.
◆ open
Opens the communication interface.
Reimplemented in AComm, and TcpComm.
◆ read
Reads data from the communication interface.
- Returns
- The data read from the interface.
Reimplemented in AComm, and TcpComm.
◆ readToBinaryWriter:
- (void) readToBinaryWriter: |
|
(NSOutputStream *) | binDataIn |
|
Writes data from a binary reader (input stream) to the output stream.
- Parameters
-
binDataIn | The output stream to write the data into. |
Reimplemented in AComm.
◆ waitForDataWithTimeout:
- (void) waitForDataWithTimeout: |
|
(NSTimeInterval) | msTimeOut |
|
Waits until data is available in the current thread. The current thread sleeps until data is received or the timeout is reached. This is a blocking call.
- Parameters
-
msTimeOut | The timeout interval in milliseconds before returning if no data is received. |
Reimplemented in AComm.
◆ write:
- (void) write: |
|
(NSData *) | dataOut |
|
Writes data to the communication interface.
- Parameters
-
dataOut | The data to write to the interface. |
Reimplemented in AComm, and TcpComm.
◆ writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:
- (NSData *) writeAndWaitForResponse: |
|
(NSData *) | text |
responseStartTimeOut: |
|
(NSTimeInterval) | responseStartTimeOut |
responseEndTimeOut: |
|
(NSTimeInterval) | responseEndTimeOut |
completionToken: |
|
(NSString *) | completionToken |
Writes byte data to the output stream and returns the data received. The data returned is any data received or up to the completion token if received. Waits for a response timeout before returning.
- Parameters
-
text | The source byte array to write to the connection. |
responseStartTimeOut | The timeout interval to wait for the first data to be received (time to first byte). |
responseEndTimeOut | The timeout interval after the last byte if no new data is received (time after last byte). |
completionToken | The string token denoting the end of the expected response. This can be an empty string if simply waiting for a response after writing data to the connection. |
- Returns
- The array of bytes received from the connection.
Reimplemented in AComm, and TcpComm.
◆ writeAndWaitForResponseToBinaryWriter:fromBinaryReader:responseStartTimeout:responseEndTimeout:completionToken:
- (NSData *) writeAndWaitForResponseToBinaryWriter: |
|
(NSOutputStream *) | binDataIn |
fromBinaryReader: |
|
(NSInputStream *) | binDataOut |
responseStartTimeout: |
|
(int) | responseStartTimeOut |
responseEndTimeout: |
|
(int) | responseEndTimeOut |
completionToken: |
|
(NSString *) | completionToken |
Writes data from the input stream to the output stream and returns the data received in the output stream. The data returned is any data received or up to the completion token if received. Waits for a response timeout before returning.
- Parameters
-
binDataIn | The output stream to store the response received from the connection. |
binDataOut | The input stream data to write to the connection. |
responseStartTimeOut | The timeout interval to wait for the first data to be received (time to first byte). |
responseEndTimeOut | The timeout interval after the last byte if no new data is received (time after last byte). |
completionToken | The string token denoting the end of the expected response. This can be an empty string if simply waiting for a response after writing data to the connection. |
- Returns
- The data received from the connection.
Reimplemented in AComm.
◆ writeFromBinaryReader:
- (void) writeFromBinaryReader: |
|
(NSInputStream *) | binReader |
|
Writes all bytes from the array passed in.
- Parameters
-
binReader | The input stream to read the data from. |
Reimplemented in AComm.
◆ bytesAvailable
The number of bytes available to read.
◆ descriptor
The descriptor for the communication interface.
◆ isConnected
A flag indicating whether the connection is established.
The documentation for this protocol was generated from the following file:
- /Users/realbuber/Documents/Project/sdk_json_Objective-C/AutoIdSDK/Comm/IComm.h