13#import <Foundation/Foundation.h>
14#import <UniPRT/AComm.h>
26#define DEFAULT_DATA_PORT 9100
38#define DEFAULT_MGMT_PORT 3007
83#define DEFAULT_STATUS_PORT 3002
114@property (nonatomic, readonly) NSInputStream *inputStream;
126@property (nonatomic, readonly) NSOutputStream *outputStream;
164- (instancetype)initWithIPAddress:(NSString *)ipAddress port:(NSUInteger)port;
206- (void)write:(NSData *)text;
248- (NSString *)descriptorUseIp:(NSString *)ip descriptorUsePort:(NSString *)port;
278- (NSData *)writeAndWaitForResponse:(NSData *)text
279 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
280 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
281 completionToken:(NSString *)completionToken;
311- (NSData *)writeAndWaitForResponseJson:(NSData *)text
312 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
313 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
314 completionToken:(NSString *)completionToken;
380typedef NS_ENUM(NSInteger, DescriptorPortType) {
381 DescriptorPortTypeData,
382 DescriptorPortTypeMGMT,
383 DescriptorPortTypeStatus,
406- (void)connectionSettingsWithIP:(NSString *)ip port:(NSUInteger)port;
431- (NSString *)validateDescriptor:(NSString *)descriptorHint withPortType:(DescriptorPortType)portTypeHint;
452- (void)sendPrintFile:(NSString *)ipAddress fileName:(NSString *)fileName;
473- (void)sendPrintString:(NSString *)ipAddress data:(NSData *)data;
491- (void)writePrinterFile:(NSString *)fileName;
一个用于通信接口的基类,符合 IComm 协议。
Definition AComm.h:29
一个用于 TCP 通信的类,继承自 AComm 并符合 NSStreamDelegate 协议。
Definition TcpComm.h:101
void close()
关闭与 TCP 服务器的连接。
BOOL connected
指示连接是否已建立的标志。
Definition TcpComm.h:140
typedef NS_ENUM(NSInteger, DescriptorPortType)
描述符端口的类型。
Definition TcpComm.h:380
void open()
打开与 TCP 服务器的连接。
NSData * read()
从 TCP 服务器读取数据。