UniPRT SDK v1.0.0.0
 
Loading...
Searching...
No Matches
AComm Class Reference

A base class for communication interfaces, conforming to the IComm protocol. More...

#include <AComm.h>

Inheritance diagram for AComm:
<IComm> TcpComm

Instance Methods

(void) - close
 Closes the communication interface.
 
(void) - open
 Opens the communication interface.
 
(NSData *) - read
 Reads data from the communication interface.
 
(void) - write:
 Writes data to the communication interface.
 
(void) - readToBinaryWriter:
 Reads data into a binary writer (output stream).
 
(void) - waitForDataWithTimeout:
 Waits for data to be available within a specified timeout.
 
(void) - writeFromBinaryReader:
 Writes data from a binary reader (input stream) to the communication interface.
 
(void) - writeAndWaitForResponseToBinaryWriter:fromBinaryReader:responseStartTimeout:responseEndTimeout:completionToken:
 Writes data to the communication interface and waits for a response, using binary streams.
 
(NSData *) - writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:
 Writes data to the communication interface and waits for a response.
 

Properties

int maxPacketSize
 The maximum packet size for communication.
 
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.
 
- Properties inherited from <IComm>
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.
 

Detailed Description

A base class for communication interfaces, conforming to the IComm protocol.

Method Documentation

◆ close

- (void) close

Closes the communication interface.

Reimplemented from <IComm>.

Reimplemented in TcpComm.

◆ open

- (void) open

Opens the communication interface.

Reimplemented from <IComm>.

Reimplemented in TcpComm.

◆ read

- (NSData *) read

Reads data from the communication interface.

Returns
The data read from the interface.

Reimplemented from <IComm>.

Reimplemented in TcpComm.

◆ readToBinaryWriter:

- (void) readToBinaryWriter: (NSOutputStream *) binDataIn

Reads data into a binary writer (output stream).

Parameters
binDataInThe output stream to write the data into.

Reimplemented from <IComm>.

◆ waitForDataWithTimeout:

- (void) waitForDataWithTimeout: (NSTimeInterval) msTimeOut

Waits for data to be available within a specified timeout.

Parameters
msTimeOutThe timeout interval in milliseconds.

Reimplemented from <IComm>.

◆ write:

- (void) write: (NSData *) dataOut

Writes data to the communication interface.

Parameters
dataOutThe data to write to the interface.

Reimplemented from <IComm>.

Reimplemented in TcpComm.

◆ writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:

- (NSData *) writeAndWaitForResponse: (NSData *) text
responseStartTimeOut: (NSTimeInterval) responseStartTimeOut
responseEndTimeOut: (NSTimeInterval) responseEndTimeOut
completionToken: (NSString *) completionToken 

Writes data to the communication interface and waits for a response.

Parameters
textThe data to write to the interface.
responseStartTimeOutThe timeout interval for the start of the response.
responseEndTimeOutThe timeout interval for the end of the response.
completionTokenA token indicating the completion of the response.
Returns
The data received in response from the interface.

Reimplemented from <IComm>.

Reimplemented in TcpComm.

◆ writeAndWaitForResponseToBinaryWriter:fromBinaryReader:responseStartTimeout:responseEndTimeout:completionToken:

- (void) writeAndWaitForResponseToBinaryWriter: (NSOutputStream *) binDataIn
fromBinaryReader: (NSInputStream *) binDataOut
responseStartTimeout: (int) responseStartTimeOut
responseEndTimeout: (int) responseEndTimeOut
completionToken: (NSString *) completionToken 

Writes data to the communication interface and waits for a response, using binary streams.

Parameters
binDataInThe output stream to write the data into.
binDataOutThe input stream to read the response from.
responseStartTimeOutThe timeout interval for the start of the response.
responseEndTimeOutThe timeout interval for the end of the response.
completionTokenA token indicating the completion of the response.

Reimplemented from <IComm>.

◆ writeFromBinaryReader:

- (void) writeFromBinaryReader: (NSInputStream *) binReader

Writes data from a binary reader (input stream) to the communication interface.

Parameters
binReaderThe input stream to read the data from.

Reimplemented from <IComm>.

Property Documentation

◆ bytesAvailable

- (int) bytesAvailable
readnonatomicassign

The number of bytes available to read.

◆ descriptor

- (NSString*) descriptor
readnonatomicassign

The descriptor for the communication interface.

◆ isConnected

- (BOOL) isConnected
readwritenonatomicassign

A flag indicating whether the connection is established.

◆ maxPacketSize

- (int) maxPacketSize
readnonatomicassign

The maximum packet size for communication.


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