A class for TCP communication, inheriting from AComm and conforming to the NSStreamDelegate protocol.
More...
#include <TcpComm.h>
|
BOOL | connected |
| A flag indicating whether the connection is established.
|
|
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.
|
|
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 class for TCP communication, inheriting from AComm and conforming to the NSStreamDelegate protocol.
◆ close
Closes the connection to the TCP server.
Reimplemented from AComm.
◆ descriptorUseIp:descriptorUsePort:
- (NSString *) descriptorUseIp: |
|
(NSString *) | ip |
descriptorUsePort: |
|
(NSString *) | port |
Returns a descriptor string using the specified IP and port.
- Parameters
-
ip | The IP address to use in the descriptor. |
port | The port to use in the descriptor. |
- Returns
- A descriptor string.
◆ initWithIPAddress:port:
- (instancetype) initWithIPAddress: |
|
(NSString *) | ipAddress |
port: |
|
(NSUInteger) | port |
Initializes a new instance with the given IP address and port.
- Parameters
-
ipAddress | The IP address of the TCP server. |
port | The port number of the TCP server. |
- Returns
- An initialized instance of TcpComm, or nil if the object could not be created.
◆ NS_ENUM
- (typedef) NS_ENUM |
|
(NSInteger) | |
|
|
(DescriptorPortType) | |
Types of descriptor ports.
This enum defines the types of descriptor ports used in the system.
Example usage:
DescriptorPortType portType = DescriptorPortTypeData;
switch (portType) {
case DescriptorPortTypeData:
break;
case DescriptorPortTypeMGMT:
break;
case DescriptorPortTypeStatus:
break;
}
◆ open
Opens the connection to the TCP server.
Reimplemented from AComm.
◆ read
Reads data from the TCP server.
- Returns
- The data read from the server.
Reimplemented from AComm.
◆ sendPrintFile:fileName:
- (void) sendPrintFile: |
|
(NSString *) | ipAddress |
fileName: |
|
(NSString *) | fileName |
Sends a print file to the specified IP address.
- Parameters
-
ipAddress | The IP address of the printer. |
fileName | The name of the file to print. |
◆ sendPrintString:data:
- (void) sendPrintString: |
|
(NSString *) | ipAddress |
data: |
|
(NSData *) | data |
Sends a print string using TSPL or PGL to the specified IP address.
- Parameters
-
ipAddress | The IP address of the printer. |
data | The data to print. |
◆ validateDescriptor:withPortType:
- (NSString *) validateDescriptor: |
|
(NSString *) | descriptorHint |
withPortType: |
|
(DescriptorPortType) | portTypeHint |
Validates the descriptor with the specified hint and port type.
- Parameters
-
descriptorHint | A hint for the descriptor. |
portTypeHint | The type of port to validate. |
- Returns
- A validated descriptor string.
◆ write:
- (void) write: |
|
(NSData *) | text |
|
Writes data to the TCP server.
- Parameters
-
text | The data to write to the server. |
Reimplemented from AComm.
◆ writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:
- (NSData *) writeAndWaitForResponse: |
|
(NSData *) | text |
responseStartTimeOut: |
|
(NSTimeInterval) | responseStartTimeOut |
responseEndTimeOut: |
|
(NSTimeInterval) | responseEndTimeOut |
completionToken: |
|
(NSString *) | completionToken |
Writes data to the TCP server and waits for a response.
- Parameters
-
text | The data to write to the server. |
responseStartTimeOut | The timeout interval for the start of the response. |
responseEndTimeOut | The timeout interval for the end of the response. |
completionToken | A token indicating the completion of the response. |
- Returns
- The data received in response from the server.
Reimplemented from AComm.
◆ writeAndWaitForResponseJson:responseStartTimeOut:responseEndTimeOut:completionToken:
- (NSData *) writeAndWaitForResponseJson: |
|
(NSData *) | text |
responseStartTimeOut: |
|
(NSTimeInterval) | responseStartTimeOut |
responseEndTimeOut: |
|
(NSTimeInterval) | responseEndTimeOut |
completionToken: |
|
(NSString *) | completionToken |
Writes JSON data to the TCP server and waits for a response.
- Parameters
-
text | The JSON data to write to the server. |
responseStartTimeOut | The timeout interval for the start of the response. |
responseEndTimeOut | The timeout interval for the end of the response. |
completionToken | A token indicating the completion of the response. |
- Returns
- The data received in response from the server.
◆ writePrinterFile:
- (void) writePrinterFile: |
|
(NSString *) | fileName |
|
Writes a file to the printer.
- Parameters
-
fileName | The name of the file to write to the printer. |
◆ connected
A flag indicating whether the connection is established.
The documentation for this class was generated from the following file:
- /Users/realbuber/Documents/Project/sdk_json_Objective-C/AutoIdSDK/Comm/TcpComm.h