9#import <Foundation/Foundation.h>
10#import <ExternalAccessory/ExternalAccessory.h>
11#import "CustomPrinter.h"
13#import <CoreBluetooth/CoreBluetooth.h>
17@interface CommPort : NSObject <NSStreamDelegate>
30 NSInteger readTimeout;
31 NSInteger writeTimeout;
32 NSInteger connectTimeout;
45- (void) Close:(NSError**)error;
48- (enum CommPortType) GetPortType;
51- (NSInteger) GetPortMaxPacketSize;
54- (bool) IsCommunicationOpen:(NSError**)error;
57- (void) WriteDataToDevice:(NSData *)data :(NSError**)error;
60- (void) WriteDataToDeviceGR:(NSData *)data :(NSError**)error;
63- (void) ClearReadBuffer:(NSError**)error;
66- (NSData *) ReadDataFromDevice:(NSError**)error;
69- (NSData *) WriteDataForResponse:(NSData *)data :(NSInteger)readSize :(NSError**)error;
72- (NSInteger) GetPrinterId:(NSError**)error;
75- (NSInteger) GetPrinterId5:(NSError**)error;
78- (NSInteger)GetWriteTimeout;
81- (void)SetWriteTimeout:(NSInteger)msec;
84- (NSInteger)GetReadTimeout;
87- (void)SetReadTimeout:(NSInteger)msec;
92- (int) BluetoothConnect:(EAAccessory *)btdevice :(NSError**)error;
97- (int) WIFIConnect:(NSString*)printerIpAddr :(NSInteger)printerIpPort :(NSError**)error;
103- (int) BluetoothLowEnergyConnect:(CBPeripheral *)bleperipheral :(NSInteger)iBleTxMaxSize :(NSInteger)iBleTxSleep :(NSString *)strBleGattServiceUUID :(NSString *)strGattCarTx :(NSString *)strGattCarRx :(NSError**)error;