| CustomiOSApi 1.06

- Main Page
- Classes

All Classes Functions Enumerations Enumerator Pages
CommPort.h
1 //
2 // CommPort.h
3 // CustomiOSApi
4 //
5 // Created by CUSTOM on 03/07/13.
6 // Copyright (c) 2013 CUSTOM. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <ExternalAccessory/ExternalAccessory.h>
11 #import "CustomPrinter.h"
12 #import "LibConst.h"
13
14 //Hide it in the documentation
15 // @cond PRIVATE
16 @interface CommPort : NSObject <NSStreamDelegate>
17 {
18 @public
19
23 enum CommPortStatus
24 {
25 CPORT_STS_CLOSED = 0,
26 CPORT_STS_OPEN = 1,
27 };
28
29 NSInteger readTimeout; // READ Timeout
30 NSInteger writeTimeout; // WRITE Timeout
31 NSInteger connectTimeout; // CONNECT Timeout
32
33 @protected
34
35 @private
36
37 }
38
39 //***********************************************
40 // COMMON FUNCTIONS
41 //***********************************************
42
43 //@Override
44 - (void) Close:(NSError**)error;
45
46 //@Override
47 - (enum CommPortType) GetPortType;
48
49 //@Override
50 - (NSInteger) GetPortMaxPacketSize;
51
52 //@Override
53 - (bool) IsCommunicationOpen:(NSError**)error;
54
55 //@Override
56 - (void) WriteDataToDevice:(NSData *)data :(NSError**)error;
57
58 //@Override
59 - (void) WriteDataToDeviceGR:(NSData *)data :(NSError**)error;
60
61 //@Override
62 - (void) ClearReadBuffer:(NSError**)error;
63
64 //@Override
65 - (NSData *) ReadDataFromDevice:(NSError**)error;
66
67 //@Override
68 - (NSData *) WriteDataForResponse:(NSData *)data :(NSInteger)readSize :(NSError**)error;
69
70 //@Override
71 - (NSInteger) GetPrinterId:(NSError**)error;
72
73 //@Override
74 - (NSInteger)GetWriteTimeout;
75
76 //@Override
77 - (void)SetWriteTimeout:(NSInteger)msec;
78
79 //@Override
80 - (NSInteger)GetReadTimeout;
81
82 //@Override
83 - (void)SetReadTimeout:(NSInteger)msec;
84
85 //***********************************************
86 // BLUETOOTH FUNCTIONS
87 //***********************************************
88 - (int) BluetoothConnect:(EAAccessory *)btdevice :(NSError**)error;
89
90 //***********************************************
91 // ETHERNET/WIFI FUNCTIONS
92 //***********************************************
93 - (int) WIFIConnect:(NSString*)printerIpAddr :(NSInteger)printerIpPort :(NSError**)error;
94
95 @end