seven365-zyprinter 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +43 -0
- package/README.md +186 -0
- package/Seven365Zyprinter.podspec +27 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/mycompany/plugins/example/Example.java +342 -0
- package/android/src/main/java/com/mycompany/plugins/example/ExamplePlugin.java +161 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +229 -0
- package/dist/esm/definitions.d.ts +56 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +49 -0
- package/dist/esm/web.js +40 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +54 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +57 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Seven365Zyprinter.podspec +28 -0
- package/ios/Sources/Plugin/ZyprintPlugin.swift +161 -0
- package/ios/Sources/Plugin/ZywellSDK.swift +358 -0
- package/ios/Sources/Seven365Zyprinter-Umbrella.h +16 -0
- package/ios/Sources/module.modulemap +12 -0
- package/ios/Sources/sources/BLEManager.h +658 -0
- package/ios/Sources/sources/BLEManager.m +2842 -0
- package/ios/Sources/sources/GCD/Documentation.html +47 -0
- package/ios/Sources/sources/GCD/GCDAsyncSocket.h +1226 -0
- package/ios/Sources/sources/GCD/GCDAsyncSocket.m +8560 -0
- package/ios/Sources/sources/GCD/GCDAsyncUdpSocket.h +1036 -0
- package/ios/Sources/sources/GCD/GCDAsyncUdpSocket.m +5632 -0
- package/ios/Sources/sources/GCD/PrinterManager.h +91 -0
- package/ios/Sources/sources/GCD/PrinterManager.m +513 -0
- package/ios/Sources/sources/GCD/WifiManager.h +91 -0
- package/ios/Sources/sources/GCD/WifiManager.m +510 -0
- package/ios/Sources/sources/ImageTranster.h +38 -0
- package/ios/Sources/sources/ImageTranster.m +389 -0
- package/ios/Sources/sources/POSBLEManager.h +759 -0
- package/ios/Sources/sources/POSBLEManager.m +834 -0
- package/ios/Sources/sources/POSSDK.h +93 -0
- package/ios/Sources/sources/POSWIFIManager.h +116 -0
- package/ios/Sources/sources/POSWIFIManager.m +260 -0
- package/ios/Sources/sources/POSWIFIManagerAsync.h +745 -0
- package/ios/Sources/sources/POSWIFIManagerAsync.m +1847 -0
- package/ios/Sources/sources/PosCommand.h +633 -0
- package/ios/Sources/sources/PosCommand.m +1019 -0
- package/ios/Sources/sources/TscCommand.h +723 -0
- package/ios/Sources/sources/TscCommand.m +566 -0
- package/ios/Tests/ExamplePluginTests/ExamplePluginTests.swift +15 -0
- package/package.json +339 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PosWIFIManager.h
|
|
3
|
+
// Printer
|
|
4
|
+
//
|
|
5
|
+
// Created by apple on 16/4/5.
|
|
6
|
+
// Copyright © 2016年 Admin. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <UIKit/UIKit.h>
|
|
11
|
+
@class POSWIFIManager;
|
|
12
|
+
typedef void(^POSWIFIBlock)(BOOL isConnect);
|
|
13
|
+
typedef void(^POSWIFICallBackBlock)(NSData *data);
|
|
14
|
+
enum {
|
|
15
|
+
SocketOfflineByServerAsync,// 服务器掉线,默认为0
|
|
16
|
+
SocketOfflineByUserAsync, // 用户主动cut
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
*Connect multiple devices.
|
|
22
|
+
*Use POSWIFIManager *manager = [[POSWIFIManager alloc] init] to instantiate the object,
|
|
23
|
+
*Save the manager and specify the corresponding manager when sending the command to send the command
|
|
24
|
+
*/
|
|
25
|
+
@protocol POSWIFIManagerDelegate <NSObject>
|
|
26
|
+
|
|
27
|
+
/// Successfully connected to the host
|
|
28
|
+
/// @param managerWiFi connection object management
|
|
29
|
+
/// @param host ip address
|
|
30
|
+
/// @param port The port number
|
|
31
|
+
- (void)POSWIFIManager:(POSWIFIManager *)manager didConnectedToHost:(NSString *)host port:(UInt16)port;
|
|
32
|
+
/// Disconnect
|
|
33
|
+
/// @param manager WiFi connection object management
|
|
34
|
+
/// @param error error
|
|
35
|
+
- (void)POSWIFIManager:(POSWIFIManager *)manager willDisconnectWithError:(NSError *)error;
|
|
36
|
+
// Data written successfully
|
|
37
|
+
- (void)POSWIFIManager:(POSWIFIManager *)manager didWriteDataWithTag:(long)tag;
|
|
38
|
+
/// Receive the data returned by the printer
|
|
39
|
+
/// @param manager Management object
|
|
40
|
+
/// @param data Returned data
|
|
41
|
+
/// @param tag tag
|
|
42
|
+
- (void)POSWIFIManager:(POSWIFIManager *)manager didReadData:(NSData *)data tag:(long)tag;
|
|
43
|
+
// 断开连接
|
|
44
|
+
- (void)POSWIFIManagerDidDisconnected:(POSWIFIManager *)manager;
|
|
45
|
+
@end
|
|
46
|
+
|
|
47
|
+
@interface POSWIFIManager : NSObject
|
|
48
|
+
{
|
|
49
|
+
int commandSendMode; //命令发送模式 0:立即发送 1:批量发送
|
|
50
|
+
}
|
|
51
|
+
#pragma mark - 基本属性
|
|
52
|
+
// 主机地址
|
|
53
|
+
@property (nonatomic,copy) NSString *hostStr;
|
|
54
|
+
// 端口
|
|
55
|
+
@property (nonatomic,assign) UInt16 port;
|
|
56
|
+
// 是否连接成功
|
|
57
|
+
@property (nonatomic,assign) BOOL connectOK;
|
|
58
|
+
// 是自动断开连接 还是 手动断开
|
|
59
|
+
@property (nonatomic,assign) BOOL isAutoDisconnect;
|
|
60
|
+
|
|
61
|
+
@property (nonatomic,weak) id<POSWIFIManagerDelegate> delegate;
|
|
62
|
+
// 连接回调
|
|
63
|
+
@property (nonatomic,copy) POSWIFIBlock callBack;
|
|
64
|
+
// 接收服务端返回的数据
|
|
65
|
+
@property (nonatomic,copy) POSWIFICallBackBlock callBackBlock;
|
|
66
|
+
@property (nonatomic,strong) NSMutableArray *commandBuffer;
|
|
67
|
+
//发送队列数组
|
|
68
|
+
#pragma mark - 基本方法
|
|
69
|
+
+ (instancetype)shareWifiManager;
|
|
70
|
+
//连接主机
|
|
71
|
+
-(void)POSConnectWithHost:(NSString *)hostStr port:(UInt16)port completion:(POSWIFIBlock)block;
|
|
72
|
+
// 断开主机
|
|
73
|
+
- (void)POSDisConnect;
|
|
74
|
+
|
|
75
|
+
//修改版本的推荐使用发送数据的两个方法
|
|
76
|
+
-(void)POSWriteCommandWithData:(NSData *)data;
|
|
77
|
+
|
|
78
|
+
-(void)POSWriteCommandWithData:(NSData *)data withResponse:(POSWIFICallBackBlock)block;
|
|
79
|
+
|
|
80
|
+
// 发送TSC完整指令
|
|
81
|
+
- (void)POSSendMSGWith:(NSString *)str;
|
|
82
|
+
// 发送POS完整指令
|
|
83
|
+
//- (void)PosWritePOSCommandWithData:(NSData *)data withResponse:(PosWIFICallBackBlock)block;
|
|
84
|
+
//#pragma mark - 打印机指令
|
|
85
|
+
//#pragma mark - ====================TSC指令===================
|
|
86
|
+
///**
|
|
87
|
+
// * 1.设置标签尺寸
|
|
88
|
+
// * width : 标签宽度
|
|
89
|
+
// * height : 标签高度
|
|
90
|
+
// */
|
|
91
|
+
//- (void)PosaddSizeWidth:(int)width height:(int)height;
|
|
92
|
+
///**
|
|
93
|
+
// * 2.设置间隙长度
|
|
94
|
+
// * gap : 间隙长度
|
|
95
|
+
// */
|
|
96
|
+
//- (void)PosaddGap:(int)gap;
|
|
97
|
+
///**
|
|
98
|
+
// * 3.产生钱箱控制脉冲
|
|
99
|
+
// * m : 钱箱引脚号
|
|
100
|
+
// * t1 : 高电平时间
|
|
101
|
+
// * t2 : 低电平时间
|
|
102
|
+
// */
|
|
103
|
+
//- (void)PosaddCashDrwer:(int)m t1:(int)t1 t2:(int)t2;
|
|
104
|
+
///**
|
|
105
|
+
// * 4.控制每张标签的停止位置
|
|
106
|
+
// * offset : 停止偏移量
|
|
107
|
+
// */
|
|
108
|
+
//- (void)PosaddOffset:(float)offset;
|
|
109
|
+
///**
|
|
110
|
+
// * 5.设置打印速度
|
|
111
|
+
// * speed : 打印速度
|
|
112
|
+
// */
|
|
113
|
+
//- (void)PosaddSpeed:(float)speed;
|
|
114
|
+
///**
|
|
115
|
+
// * 6.设置打印浓度
|
|
116
|
+
// * n : 打印浓度
|
|
117
|
+
// */
|
|
118
|
+
//- (void)PosaddDensity:(int)n;
|
|
119
|
+
///**
|
|
120
|
+
// * 7.设置打印方向和镜像
|
|
121
|
+
// * n : 打印方向
|
|
122
|
+
// */
|
|
123
|
+
//- (void)PosaddDirection:(int)n;
|
|
124
|
+
///**
|
|
125
|
+
// * 8.设置原点坐标
|
|
126
|
+
// * x : 原点横坐标
|
|
127
|
+
// * y : 原点纵坐标
|
|
128
|
+
// */
|
|
129
|
+
//- (void)PosaddReference:(int)x y:(int)y;
|
|
130
|
+
///**
|
|
131
|
+
// * 9.清除打印缓冲区数据
|
|
132
|
+
// */
|
|
133
|
+
//- (void)PosaddCls;
|
|
134
|
+
///**
|
|
135
|
+
// * 10.走纸
|
|
136
|
+
// * feed : 走纸长度
|
|
137
|
+
// */
|
|
138
|
+
//- (void)PosaddFeed:(int)feed;
|
|
139
|
+
///**
|
|
140
|
+
// * 11.退纸
|
|
141
|
+
// * feed : 退纸长度
|
|
142
|
+
// */
|
|
143
|
+
//- (void)PosaddBackFeed:(int)feed;
|
|
144
|
+
///**
|
|
145
|
+
// * 12.走一张标签纸距离
|
|
146
|
+
// */
|
|
147
|
+
//- (void)PosaddFormFeed;
|
|
148
|
+
///**
|
|
149
|
+
// * 13.标签位置进行一次校准
|
|
150
|
+
// */
|
|
151
|
+
//- (void)PosaddHome;
|
|
152
|
+
///**
|
|
153
|
+
// * 14.打印标签
|
|
154
|
+
// * m : 打印的标签份数
|
|
155
|
+
// */
|
|
156
|
+
//- (void)PosaddPrint:(int)m;
|
|
157
|
+
///**
|
|
158
|
+
// * 15.设置国际代码页
|
|
159
|
+
// * page : 国际代码页
|
|
160
|
+
// */
|
|
161
|
+
//- (void)PosaddCodePage:(int)page;
|
|
162
|
+
///**
|
|
163
|
+
// * 16.设置蜂鸣器
|
|
164
|
+
// * level: 声音阶级
|
|
165
|
+
// * interval : 声音长短
|
|
166
|
+
// */
|
|
167
|
+
//- (void)PosaddSound:(int)level interval:(int)interval;
|
|
168
|
+
///**
|
|
169
|
+
// * 17.设置打印机报错
|
|
170
|
+
// * feed : 走纸长度
|
|
171
|
+
// */
|
|
172
|
+
//- (void)PosaddLimitFeed:(int)feed;
|
|
173
|
+
///**
|
|
174
|
+
// * 18.在打印缓冲区绘制黑块
|
|
175
|
+
// * x : 其实横坐标
|
|
176
|
+
// * y : 起始纵坐标
|
|
177
|
+
// * width: 线宽
|
|
178
|
+
// * height: 线高
|
|
179
|
+
// */
|
|
180
|
+
//- (void)PosaddBar:(int)x y:(int)y width:(int)width height:(int)height;
|
|
181
|
+
///**
|
|
182
|
+
// * 19.在打印缓冲区绘制一维条码
|
|
183
|
+
// * x : 其实横坐标
|
|
184
|
+
// * y : 起始纵坐标
|
|
185
|
+
// * type : 条码类型
|
|
186
|
+
// * height : 条码高度
|
|
187
|
+
// * readable : 是否打印可识别字符
|
|
188
|
+
// * rotation : 条码旋转角度0,90,180,270
|
|
189
|
+
// * conten: 条码数据,数据需参考条码规则输入
|
|
190
|
+
// */
|
|
191
|
+
//- (void)Posadd1DBarcodeX:(int)x
|
|
192
|
+
// y:(int)y
|
|
193
|
+
// type:(NSString *)type
|
|
194
|
+
// height:(int)height
|
|
195
|
+
// readable:(int)readable
|
|
196
|
+
// rotation:(int)rotation
|
|
197
|
+
// narrow:(int)narrow
|
|
198
|
+
// wide:(int)wide
|
|
199
|
+
// content:(NSString *)content;
|
|
200
|
+
///**
|
|
201
|
+
// * 20.在打印缓冲区绘制矩形
|
|
202
|
+
// * x : 其实横坐标
|
|
203
|
+
// * y : 起始纵坐标
|
|
204
|
+
// * xend : 终点横坐标
|
|
205
|
+
// * yend : 终点纵坐标
|
|
206
|
+
// */
|
|
207
|
+
//- (void)PosaddBox:(int)x y:(int)y xend:(int)xend yend:(int)yend;
|
|
208
|
+
///**
|
|
209
|
+
// * 21.在打印缓冲区绘制位图
|
|
210
|
+
// * x : 起始横坐标
|
|
211
|
+
// * y : 起始纵坐标
|
|
212
|
+
// * width: 位图打印宽度
|
|
213
|
+
// * height: 高度
|
|
214
|
+
// */
|
|
215
|
+
//- (void)PosaddBitmap:(int)x
|
|
216
|
+
// y:(int)y
|
|
217
|
+
// width:(int)width
|
|
218
|
+
// height:(int)height
|
|
219
|
+
// mode:(int)mode data:(int)data;
|
|
220
|
+
///**
|
|
221
|
+
// * 22.擦除打印缓冲区中指定区域的数据
|
|
222
|
+
// * x : 起始横坐标
|
|
223
|
+
// * y : 起始纵坐标
|
|
224
|
+
// * xwidth : 横向宽度
|
|
225
|
+
// * yheight : 纵向高度
|
|
226
|
+
// */
|
|
227
|
+
//- (void)PosaddErase:(int)x y:(int)y xwidth:(int)xwidth yheight:(int)yheight;
|
|
228
|
+
///**
|
|
229
|
+
// * 23.将指定区域的数据黑白反色
|
|
230
|
+
// * x : 起始横坐标
|
|
231
|
+
// * y : 起始纵坐标
|
|
232
|
+
// * xwidth : 横向宽度
|
|
233
|
+
// * yheight : 纵向高度
|
|
234
|
+
// */
|
|
235
|
+
//- (void)PosaddReverse:(int)x y:(int)y xwidth:(int)xwidth yheight:(int)yheight;
|
|
236
|
+
///**
|
|
237
|
+
// * 24.在打印缓冲区中绘制文字
|
|
238
|
+
// * x : 起始横坐标
|
|
239
|
+
// * y : 起始纵坐标
|
|
240
|
+
// * font : 字体类型
|
|
241
|
+
// * rotation : 旋转角度
|
|
242
|
+
// * xmul : 横向放大系数1-10倍
|
|
243
|
+
// * ymul : 纵向放大系数1-10倍
|
|
244
|
+
// * content : 文字字符串
|
|
245
|
+
// */
|
|
246
|
+
//- (void)PosaddText:(int)x y:(int)y font:(NSString *)font rotation:(int)rotation x_mul:(int)xmul y_mul:(int)ymul content:(NSString *)content;
|
|
247
|
+
///**
|
|
248
|
+
// * 25.在打印缓冲区中绘制文字
|
|
249
|
+
// * x : 起始横坐标
|
|
250
|
+
// * y : 起始纵坐标
|
|
251
|
+
// * level : 纠错级别
|
|
252
|
+
// * cellWidth : 单元大小
|
|
253
|
+
// * totation : 旋转角度
|
|
254
|
+
// * dataStr : 打印文字
|
|
255
|
+
// */
|
|
256
|
+
//- (void)PosaddQRCode:(int)x y:(int)y level:(int)level cellWidth:(int)cellWidth rotation:(int)totation data:(NSString *)dataStr;
|
|
257
|
+
///**
|
|
258
|
+
// * 26.设置剥离功能是否开启
|
|
259
|
+
// * enable : 是否使能
|
|
260
|
+
// */
|
|
261
|
+
//- (void)PosaddPeel:(NSString *)enable;
|
|
262
|
+
///**
|
|
263
|
+
// * 27.设置撕离功能是否开启
|
|
264
|
+
// * enable : 是否使能
|
|
265
|
+
// */
|
|
266
|
+
//- (void)PosaddTear:(NSString *)enable;
|
|
267
|
+
//
|
|
268
|
+
///**
|
|
269
|
+
// * 28.设置切刀功能是否开启
|
|
270
|
+
// * enable : 是否使能
|
|
271
|
+
// */
|
|
272
|
+
//- (void)PosaddCut:(NSString *)enable;
|
|
273
|
+
///**
|
|
274
|
+
// * 29.设置打印机出错时,是否打印上一张内容
|
|
275
|
+
// * enable : 是否使能
|
|
276
|
+
// */
|
|
277
|
+
//- (void)PosaddReprint:(NSString *)enable;
|
|
278
|
+
///**
|
|
279
|
+
// * 30.设置是否按走纸键打印最近一张标签
|
|
280
|
+
// * enable : 是否使能
|
|
281
|
+
// */
|
|
282
|
+
//- (void)PosaddPrintKeyEnable:(NSString *)enable;
|
|
283
|
+
///**
|
|
284
|
+
// * 31.设置按走纸键打印最近一张标签的份数
|
|
285
|
+
// * m : 打印份数
|
|
286
|
+
// */
|
|
287
|
+
//- (void)PosaddPrintKeyNum:(int)m;
|
|
288
|
+
//
|
|
289
|
+
//
|
|
290
|
+
//#pragma mark - ================POS指令====================
|
|
291
|
+
///**
|
|
292
|
+
// *1.水平定位
|
|
293
|
+
// */
|
|
294
|
+
//- (void)PoshorizontalPosition;
|
|
295
|
+
///**
|
|
296
|
+
// * 2.打印并换行
|
|
297
|
+
// */
|
|
298
|
+
//- (void)PosprintAndFeed;
|
|
299
|
+
///**
|
|
300
|
+
// * 3.打印并回到标准模式
|
|
301
|
+
// */
|
|
302
|
+
//- (void)PosPrintAndBackToNormalModel;
|
|
303
|
+
///**
|
|
304
|
+
// * 4.页模式下取消打印数据
|
|
305
|
+
// */
|
|
306
|
+
//- (void)PosCancelPrintData;
|
|
307
|
+
///**
|
|
308
|
+
// * 5.实时状态传送
|
|
309
|
+
// * param:指定所要传送的打印状态
|
|
310
|
+
// * 1 <= param <= 4
|
|
311
|
+
// * callBlock : 打印机返回的相关状态
|
|
312
|
+
// */
|
|
313
|
+
//- (void)PosUpdataPrinterState:(int)param completion:(PosWIFICallBackBlock)callBlock;
|
|
314
|
+
///**
|
|
315
|
+
// * 6.实时对打印机请求
|
|
316
|
+
// * param : 表示对打印机发送的请求
|
|
317
|
+
// * 1 <= param <= 2
|
|
318
|
+
// */
|
|
319
|
+
//- (void)PosUpdataPrinterAnswer:(int)param;
|
|
320
|
+
///**
|
|
321
|
+
// * 7.实时产生钱箱开启脉冲
|
|
322
|
+
// * m : 指定钱箱插座的引脚
|
|
323
|
+
// * t : 电平时间
|
|
324
|
+
// * n = 1
|
|
325
|
+
// * m = 0,1
|
|
326
|
+
// * 1 <= t <= 8
|
|
327
|
+
// */
|
|
328
|
+
//- (void)PosOpenBoxAndPulse:(int) n m:(int) m t:(int) t;
|
|
329
|
+
///**
|
|
330
|
+
// * 8.页模式下打印
|
|
331
|
+
// */
|
|
332
|
+
//- (void)PosPrintOnPageModel;
|
|
333
|
+
///**
|
|
334
|
+
// * 9.设置字符右间距
|
|
335
|
+
// * n : 表示字符间距
|
|
336
|
+
// * 0 <= n <= 255
|
|
337
|
+
// */
|
|
338
|
+
//- (void)PosSetCharRightMargin:(int)n;
|
|
339
|
+
///**
|
|
340
|
+
// * 10.选择打印模式
|
|
341
|
+
// * n : 根据n的值设置字符打印模式
|
|
342
|
+
// * 0 <= n <= 255
|
|
343
|
+
// */
|
|
344
|
+
//- (void)PosSelectPrintModel:(int)n;
|
|
345
|
+
///**
|
|
346
|
+
// * 11.设置绝对打印位置
|
|
347
|
+
// * 0 <= nL <= 255
|
|
348
|
+
// * 0 <= nh <= 255
|
|
349
|
+
// */
|
|
350
|
+
//- (void)PosSetPrintLocationWithParam:(int)nL nH:(int)nH;
|
|
351
|
+
///**
|
|
352
|
+
// * 12.选择/取消用户自定义字符
|
|
353
|
+
// * 0 <= n <= 255
|
|
354
|
+
// */
|
|
355
|
+
//- (void)PosSelectOrCancelCustomCharacter:(int)n;
|
|
356
|
+
//
|
|
357
|
+
///**
|
|
358
|
+
// * 13.定义用户自定义字符
|
|
359
|
+
// * y=3
|
|
360
|
+
// * 32<=c1<=c2<=127
|
|
361
|
+
// * 0<=x<=12 标准ASCII码字体A(12 x 24)
|
|
362
|
+
// * 0<=x<=9 压缩SCII码字体(9 x 17)
|
|
363
|
+
// * 0<=d1 ... d(y*xk)<=255
|
|
364
|
+
// * points : 点矩阵数组,数组元素位字符串类型
|
|
365
|
+
// */
|
|
366
|
+
//- (void)PosDefinCustomCharacter:(int)y c1:(int)c1 c2:(int)c2 dx:(NSArray *)points;
|
|
367
|
+
///**
|
|
368
|
+
// * 14.选择位图模式
|
|
369
|
+
// * 选择由m指定的一种位图模式,位图点数由nL和nH确定
|
|
370
|
+
// * m=0,1,32,33
|
|
371
|
+
// * 0<=nL<=255
|
|
372
|
+
// * 0<=nH<=3
|
|
373
|
+
// * 0<=d<=255
|
|
374
|
+
// */
|
|
375
|
+
//- (void)PosSelectBitmapModel:(int)m nL:(int)nL nH:(int)nH dx:(NSArray *)points;
|
|
376
|
+
//
|
|
377
|
+
///**
|
|
378
|
+
// * 15.取消下划线模式
|
|
379
|
+
// * 0<=n<=2,48<=n<=50
|
|
380
|
+
// * 根据n的值选择或取消下划线模式
|
|
381
|
+
// */
|
|
382
|
+
//- (void)PosCancelUnderLineModelWith:(int)n;
|
|
383
|
+
///**
|
|
384
|
+
// * 16.设置默认行间距
|
|
385
|
+
// */
|
|
386
|
+
//- (void)PosSetDefaultLineMargin;
|
|
387
|
+
///**
|
|
388
|
+
// * 17.设置行间距
|
|
389
|
+
// * 0<=n<=255
|
|
390
|
+
// * 设置行间距位【n*纵向或横向移动单位】
|
|
391
|
+
// */
|
|
392
|
+
//- (void)PosSetLineMarginWith:(int)n;
|
|
393
|
+
///**
|
|
394
|
+
// * 18.选择打印机
|
|
395
|
+
// * 0<=n<=1
|
|
396
|
+
// */
|
|
397
|
+
//- (void)PosSelectPrinterWith:(int)n;
|
|
398
|
+
///**
|
|
399
|
+
// * 19.取消用户自定义字符
|
|
400
|
+
// * 32<=n<=127
|
|
401
|
+
// */
|
|
402
|
+
//- (void)PosCancelCustomCharacterWith:(int)n;
|
|
403
|
+
///**
|
|
404
|
+
// * 20.初始化打印机
|
|
405
|
+
// *
|
|
406
|
+
// */
|
|
407
|
+
//- (void)PosInitializePrinter;
|
|
408
|
+
///**
|
|
409
|
+
// * 21.设置横向跳格位置
|
|
410
|
+
// * 1<=n<=255
|
|
411
|
+
// * 0<=k<=32
|
|
412
|
+
// */
|
|
413
|
+
//- (void)PosSetTabLocationWith:(NSArray *)points;
|
|
414
|
+
///**
|
|
415
|
+
// * 22.选择/取消加粗模式
|
|
416
|
+
// * 0<=n<=255
|
|
417
|
+
// * n最低位为0时,取消加粗模式,位1时,选择加粗模式
|
|
418
|
+
// */
|
|
419
|
+
//- (void)PosSelectOrCancelBoldModelWith:(int)n;
|
|
420
|
+
///**
|
|
421
|
+
// * 23.选择/取消双重打印模式
|
|
422
|
+
// * 0<=n<=255
|
|
423
|
+
// * n最低位:0 取消
|
|
424
|
+
// * 1 加粗
|
|
425
|
+
// */
|
|
426
|
+
//- (void)PosSelectOrCancelDoublePrintModel:(int)n;
|
|
427
|
+
///**
|
|
428
|
+
// * 24.打印并走纸
|
|
429
|
+
// * 0<=n<=255
|
|
430
|
+
// * 打印缓冲区数据并走纸【n*纵向或横向移动单位】
|
|
431
|
+
// */
|
|
432
|
+
//- (void)PosPrintAndPushPageWith:(int)n;
|
|
433
|
+
///**
|
|
434
|
+
// * 25.选择页模式
|
|
435
|
+
// */
|
|
436
|
+
//- (void)PosSelectPageModel;
|
|
437
|
+
///**
|
|
438
|
+
// * 26.选择字体
|
|
439
|
+
// * n = 0,1,48,49
|
|
440
|
+
// */
|
|
441
|
+
//- (void)PosSelectFontWith:(int)n;
|
|
442
|
+
///**
|
|
443
|
+
// * 27.选择国际字符集
|
|
444
|
+
// * 0<=n<=15
|
|
445
|
+
// */
|
|
446
|
+
//- (void)PosSelectINTL_CHAR_SETWith:(int)n;
|
|
447
|
+
///**
|
|
448
|
+
// * 28.选择标准模式
|
|
449
|
+
// */
|
|
450
|
+
//- (void)PosSelectNormalModel;
|
|
451
|
+
///**
|
|
452
|
+
// * 29.在页模式下选择打印区域方向
|
|
453
|
+
// * 0<=n<=3 48<=n<=51
|
|
454
|
+
// * n指定打印区域的方向和起始位置
|
|
455
|
+
// */
|
|
456
|
+
//- (void)PosSelectPrintDirectionOnPageModel:(int)n;
|
|
457
|
+
///**
|
|
458
|
+
// * 30.选择/取消顺时针旋转90度
|
|
459
|
+
// * 0<=n<=1 48<=n<=49
|
|
460
|
+
// * 0,48 : 取消
|
|
461
|
+
// * 1,49 : 选择
|
|
462
|
+
// */
|
|
463
|
+
//- (void)PosSelectOrCancelRotationClockwise:(int)n;
|
|
464
|
+
///**
|
|
465
|
+
// * 31.页模式下设置打印区域
|
|
466
|
+
// * 范围:0<=xL,xH,yL,yH,dxL,dxH,dyL,dyH<=255
|
|
467
|
+
// */
|
|
468
|
+
//- (void)PosSetprintLocationOnPageModelWithXL:(int)xL
|
|
469
|
+
// xH:(int)xH
|
|
470
|
+
// yL:(int)yL
|
|
471
|
+
// yH:(int)yH
|
|
472
|
+
// dxL:(int)dxL
|
|
473
|
+
// dxH:(int)dxH
|
|
474
|
+
// dyL:(int)dyL
|
|
475
|
+
// dyH:(int)dyH;
|
|
476
|
+
//
|
|
477
|
+
///**
|
|
478
|
+
// * 32.设置横向打印位置
|
|
479
|
+
// * 范围: nL 0 - 255
|
|
480
|
+
// nH 0 - 255
|
|
481
|
+
// */
|
|
482
|
+
//- (void)PosSetHorizonLocationWith:(int)nL nH:(int)nH;
|
|
483
|
+
///**
|
|
484
|
+
// * 33.选择对齐方式
|
|
485
|
+
// * 范围: n 0 - 2
|
|
486
|
+
// 48 - 50
|
|
487
|
+
// */
|
|
488
|
+
//- (void)PosSelectAlignmentWithN:(int)n;
|
|
489
|
+
///**
|
|
490
|
+
// * 34.选择打印纸传感器以输出信号
|
|
491
|
+
// * 范围: n 0 - 255
|
|
492
|
+
// */
|
|
493
|
+
//- (void)PosSelectSensorForOutputSignal:(int)n;
|
|
494
|
+
///**
|
|
495
|
+
// * 35.选择打印纸传感器以停止打印
|
|
496
|
+
// * 范围: n 0 - 255
|
|
497
|
+
// */
|
|
498
|
+
//- (void)PosSelectSensorForStopPrint:(int)n;
|
|
499
|
+
///**
|
|
500
|
+
// * 36.允许/禁止按键
|
|
501
|
+
// * 范围: n 0 - 255
|
|
502
|
+
// */
|
|
503
|
+
//- (void)PosAllowOrDisableKeypress:(int)n;
|
|
504
|
+
///**
|
|
505
|
+
// * 37.打印并向前走纸 N 行
|
|
506
|
+
// * 范围: n 0 - 255
|
|
507
|
+
// */
|
|
508
|
+
//- (void)PosPrintAndPushPageRow:(int)n;
|
|
509
|
+
///**
|
|
510
|
+
// * 38.产生钱箱控制脉冲
|
|
511
|
+
// * 范围:m 0 , 1 , 48 , 49
|
|
512
|
+
// t1 0 - 255
|
|
513
|
+
// t2 0 - 255
|
|
514
|
+
// */
|
|
515
|
+
//- (void)PosMakePulseWithCashboxWithM:(int)m t1:(int)t1 t2:(int)t2;
|
|
516
|
+
///**
|
|
517
|
+
// * 39.选择字符代码表
|
|
518
|
+
// * 范围: n 0 - 10 或 16 - 19
|
|
519
|
+
// */
|
|
520
|
+
//- (void)PosSelectCharacterTabN:(int)n;
|
|
521
|
+
///**
|
|
522
|
+
// * 40.选择/取消倒置打印模式
|
|
523
|
+
// * 范围: n 0 - 255
|
|
524
|
+
// */
|
|
525
|
+
//- (void)PosSelectOrCancelInversionPrintModel:(int)n;
|
|
526
|
+
///**
|
|
527
|
+
// * 41.打印下载到FLASH中的位图
|
|
528
|
+
// * 范围:n 1 - 255
|
|
529
|
+
// m 0 - 3 , 48 - 51
|
|
530
|
+
// */
|
|
531
|
+
//- (void)PosPrintFlashBitmapWithN:(int)n m:(int)m;
|
|
532
|
+
///**
|
|
533
|
+
// * 42.定义FLASH位图
|
|
534
|
+
// *范围:n 1 - 255
|
|
535
|
+
// * points : 位图的横向点数和纵向点数
|
|
536
|
+
// */
|
|
537
|
+
//- (void)PosDefinFlashBitmapWithN:(int)n Points:(NSArray *)points;
|
|
538
|
+
///**
|
|
539
|
+
// * 43.选择字符大小
|
|
540
|
+
// * 范围:n 0 - 255
|
|
541
|
+
// */
|
|
542
|
+
//- (void)PosSelectCharacterSize:(int)n;
|
|
543
|
+
///**
|
|
544
|
+
// * 44.页模式下设置纵向绝对位置
|
|
545
|
+
// * 范围:nL 1 - 255
|
|
546
|
+
// nH 0 - 255
|
|
547
|
+
// */
|
|
548
|
+
//- (void)PosSetVertLocationOnPageModelWithnL:(int)nL nH:(int)nH;
|
|
549
|
+
///**
|
|
550
|
+
// * 45.定义下载位图
|
|
551
|
+
// * 范围:x 1 - 255
|
|
552
|
+
// y 1 - 48
|
|
553
|
+
// x * y <= 912
|
|
554
|
+
// d 0 - 255
|
|
555
|
+
// */
|
|
556
|
+
//- (void)PosDefineLoadBitmapWithX:(int)x Y:(int)y Points:(NSArray *)points;
|
|
557
|
+
///**
|
|
558
|
+
// * 46.执行打印数据十六进制转储
|
|
559
|
+
// * 范围:pL = 2
|
|
560
|
+
// pH = 0
|
|
561
|
+
// n = 0,48
|
|
562
|
+
// m = 1,49
|
|
563
|
+
// */
|
|
564
|
+
//- (void)PosPrintDataAndSaveAsHexWithpL:(int)pL pH:(int)pH n:(int)n m:(int)m;
|
|
565
|
+
///**
|
|
566
|
+
// * 47.打印下载位图
|
|
567
|
+
// * 范围:m 0 - 3 或 48 - 51
|
|
568
|
+
// */
|
|
569
|
+
//- (void)PosPrintLoadBitmapM:(int)m;
|
|
570
|
+
///**
|
|
571
|
+
// * 48.开始/结束宏定义
|
|
572
|
+
// */
|
|
573
|
+
//- (void)PosBeginOrEndDefine;
|
|
574
|
+
///**
|
|
575
|
+
// * 49.选择/取消黑白反显打印模式
|
|
576
|
+
// * 范围:n 0 - 255
|
|
577
|
+
// */
|
|
578
|
+
//- (void)PosSelectORCancelBWPrintModel:(int)n;
|
|
579
|
+
///**
|
|
580
|
+
// * 50.选择HRI字符的打印位置
|
|
581
|
+
// * 范围:n 0 - 3 或 48 - 51
|
|
582
|
+
// */
|
|
583
|
+
//- (void)PosSelectHRIPrintLocation:(int)n;
|
|
584
|
+
///**
|
|
585
|
+
// * 51.设置左边距
|
|
586
|
+
// * 范围:nL 0 - 255
|
|
587
|
+
// nH 0 - 255
|
|
588
|
+
// */
|
|
589
|
+
//- (void)PosSetLeftMarginWithnL:(int)nL nH:(int)nH;
|
|
590
|
+
///**
|
|
591
|
+
// * 52.设置横向和纵向移动单位
|
|
592
|
+
// * 范围:x 0 - 255
|
|
593
|
+
// y 0 - 255
|
|
594
|
+
// */
|
|
595
|
+
//- (void)PosSetHoriAndVertUnitXWith:(int)x y:(int)y;
|
|
596
|
+
///**
|
|
597
|
+
// * 53.选择切纸模式并切纸
|
|
598
|
+
// * model : 0,1 选择模式1 和 模式2
|
|
599
|
+
// * 模式1范围 : m = 0,48,1,49
|
|
600
|
+
// * 模式2范围 : m = 66, n = 0-255
|
|
601
|
+
// */
|
|
602
|
+
//- (void)PosSelectCutPaperModelAndCutPaperWith:(int)m n:(int)n selectedModel:(int)model;
|
|
603
|
+
///**
|
|
604
|
+
// * 54.设置打印区域宽高
|
|
605
|
+
// * 范围:nL 0 - 255
|
|
606
|
+
// nH 0 - 255
|
|
607
|
+
// */
|
|
608
|
+
//- (void)PosSetPrintLocationWith:(int)nL nH:(int)nH;
|
|
609
|
+
///**
|
|
610
|
+
// * 55.页模式下设置纵向相对位置
|
|
611
|
+
// * 范围:nL 0 - 255
|
|
612
|
+
// nH 0 - 255
|
|
613
|
+
// */
|
|
614
|
+
//- (void)PosSetVertRelativeLocationOnPageModelWith:(int)nL nH:(int)nH;
|
|
615
|
+
///**
|
|
616
|
+
// * 56.执行宏命令
|
|
617
|
+
// * 范围:r 0 - 255
|
|
618
|
+
// t 0 - 255
|
|
619
|
+
// m 0,1
|
|
620
|
+
// */
|
|
621
|
+
//- (void)PosRunMacroMommandWith:(int)r t:(int)t m:(int)m;
|
|
622
|
+
///**
|
|
623
|
+
// * 57.打开/关闭自动状态反传功能(ASB)
|
|
624
|
+
// * 范围:n 0 - 255
|
|
625
|
+
// */
|
|
626
|
+
//- (void)PosOpenOrCloseASB:(int)n;
|
|
627
|
+
///**
|
|
628
|
+
// * 58.选择HRI使用字体
|
|
629
|
+
// * 范围:n 0,1,48,49
|
|
630
|
+
// */
|
|
631
|
+
//- (void)PosSelectHRIFontToUse:(int)n;
|
|
632
|
+
///**
|
|
633
|
+
// * 59. 选择条码高度
|
|
634
|
+
// * 范围:n 1 - 255
|
|
635
|
+
// */
|
|
636
|
+
//- (void)PosSelectBarcodeHeight:(int)n;
|
|
637
|
+
///**
|
|
638
|
+
// * 60.打印条码
|
|
639
|
+
// * model : 0,1 代表两种类型 0:表示类型1 1:表示类型2
|
|
640
|
+
// * 类型1: m 0-6
|
|
641
|
+
// * 类型2: m 65-73
|
|
642
|
+
// */
|
|
643
|
+
//- (void)PosPrintBarCodeWithPoints:(int)m n:(int)n points:(NSArray *)points selectModel:(int)model;
|
|
644
|
+
///**
|
|
645
|
+
// * 61.返回状态
|
|
646
|
+
// * 范围:n 1,2,49,50
|
|
647
|
+
// */
|
|
648
|
+
//- (void)PosCallBackStatus:(int)n completion:(PosWIFICallBackBlock)block;
|
|
649
|
+
///**
|
|
650
|
+
// * 62.打印光栅位图
|
|
651
|
+
// * 范围:m 0 - 3 或 48 - 51
|
|
652
|
+
// xL 0 - 255
|
|
653
|
+
// xH 0 - 255
|
|
654
|
+
// yL 0 - 255
|
|
655
|
+
// yH 0 - 255
|
|
656
|
+
// points 表示位图数据
|
|
657
|
+
// */
|
|
658
|
+
//- (void)PosPrintRasterBitmapWith:(int)m
|
|
659
|
+
// xL:(int)xL
|
|
660
|
+
// xH:(int)xH
|
|
661
|
+
// yl:(int)yL
|
|
662
|
+
// yh:(int)yH
|
|
663
|
+
// points:(NSArray *)points;
|
|
664
|
+
///**
|
|
665
|
+
// * 63.设置条码宽度
|
|
666
|
+
// * 范围:n 2 - 6
|
|
667
|
+
// */
|
|
668
|
+
//- (void)PosSetBarcodeWidth:(int)n;
|
|
669
|
+
//#pragma mark - ============汉字字符控制命令============
|
|
670
|
+
///**
|
|
671
|
+
// * 64.设置汉字字符模式
|
|
672
|
+
// * 范围:n 0 - 255
|
|
673
|
+
// */
|
|
674
|
+
//- (void)PosSetChineseCharacterModel:(int)n;
|
|
675
|
+
///**
|
|
676
|
+
// * 65.选择汉字模式
|
|
677
|
+
// */
|
|
678
|
+
//- (void)PosSelectChineseCharacterModel;
|
|
679
|
+
///**
|
|
680
|
+
// * 66.选择/取消汉字下划线模式
|
|
681
|
+
// * 范围:n 0 - 2 或 48 - 50
|
|
682
|
+
// */
|
|
683
|
+
//- (void)PosSelectOrCancelChineseUderlineModel:(int)n;
|
|
684
|
+
///**
|
|
685
|
+
// * 67.取消汉字模式
|
|
686
|
+
// */
|
|
687
|
+
//- (void)PosCancelChineseModel;
|
|
688
|
+
///**
|
|
689
|
+
// * 68.定义用户自定义汉字
|
|
690
|
+
// * c1,c2代表字符编码
|
|
691
|
+
// * points 表示汉子矩阵
|
|
692
|
+
// */
|
|
693
|
+
//- (void)PosDefineCustomChinesePointsC1:(int)c1 c2:(int)c2 points:(NSArray *)points;
|
|
694
|
+
///**
|
|
695
|
+
// * 69.设置汉字字符左右间距
|
|
696
|
+
// * 范围:n1 0 - 255
|
|
697
|
+
// n2 0 - 255
|
|
698
|
+
// */
|
|
699
|
+
//- (void)PosSetChineseMarginWithLeftN1:(int)n1 n2:(int)n2;
|
|
700
|
+
///**
|
|
701
|
+
// * 70.选择/取消汉字倍高倍宽
|
|
702
|
+
// * 范围:n 0 - 255
|
|
703
|
+
// */
|
|
704
|
+
//- (void)PosSelectOrCancelChineseHModelAndWModel:(int)n;
|
|
705
|
+
//#pragma mark - ============打印机提示命令============
|
|
706
|
+
///**
|
|
707
|
+
// * 72.打印机来单打印蜂鸣提示
|
|
708
|
+
// * 范围:n 1 - 9
|
|
709
|
+
// t 1 - 9
|
|
710
|
+
// */
|
|
711
|
+
//- (void)PosPrinterSound:(int)n t:(int)t;
|
|
712
|
+
///**
|
|
713
|
+
// * 73.打印机来单打印蜂鸣提示及报警灯闪烁
|
|
714
|
+
// * 范围:m 1 - 20
|
|
715
|
+
// t 1 - 20
|
|
716
|
+
// n 0 - 3
|
|
717
|
+
// */
|
|
718
|
+
//- (void)PosPrinterSoundAndAlarmLight:(int)m t:(int)t n:(int)n;
|
|
719
|
+
|
|
720
|
+
- (void)POSSetCommandMode:(BOOL)Mode;
|
|
721
|
+
|
|
722
|
+
/*
|
|
723
|
+
* 74.设置打印机发送命令模式
|
|
724
|
+
* 范围:0,1
|
|
725
|
+
* 0:立即发送
|
|
726
|
+
* 1:批量发送
|
|
727
|
+
*/
|
|
728
|
+
|
|
729
|
+
-(NSArray*)POSGetBuffer;
|
|
730
|
+
/*
|
|
731
|
+
* 75.返回等待发送指令队列
|
|
732
|
+
*/
|
|
733
|
+
|
|
734
|
+
-(void)POSClearBuffer;
|
|
735
|
+
/*
|
|
736
|
+
* 76.清空等待发送指令队列
|
|
737
|
+
*/
|
|
738
|
+
|
|
739
|
+
-(void)POSSendCommandBuffer;
|
|
740
|
+
/*
|
|
741
|
+
* 77.发送指令队列
|
|
742
|
+
*/
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
@end
|