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,658 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BLEManage.h
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by apple on 16/4/5.
|
|
6
|
+
// Copyright © 2016年 Admin. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* #define kBLEM [BLEManager sharedBLEManager]
|
|
11
|
+
if (kBLEM.isConnected) {
|
|
12
|
+
[kBLEM writeDataToDevice:@[@(0)] command:1];
|
|
13
|
+
[kBLEM writeDataToDevice:@[@(1),@(2)] command:2];
|
|
14
|
+
}
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#import <Foundation/Foundation.h>
|
|
20
|
+
#import <CoreBluetooth/CoreBluetooth.h>
|
|
21
|
+
@class BLEManager;
|
|
22
|
+
|
|
23
|
+
//扫描发现设备回调
|
|
24
|
+
typedef void (^BleManagerDiscoverPeripheralCallBack) (NSArray *peripherals);
|
|
25
|
+
typedef void (^BleManagerConnectPeripheralCallBack) (BOOL isConnected);
|
|
26
|
+
typedef void (^BleManagerReceiveCallBack) (CBCharacteristic *characteristic );
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
Define the proxy BLEManagerDelegate
|
|
31
|
+
*/
|
|
32
|
+
@protocol BLEManagerDelegate <NSObject>
|
|
33
|
+
/// Discovery of peripherals
|
|
34
|
+
/// @param BLEmanager Bluetooth management object
|
|
35
|
+
/// @param peripherals array of peripherals
|
|
36
|
+
/// @param RSSIArr list of printers' rssi
|
|
37
|
+
- (void)BLEManagerDelegate:(BLEManager *)BLEmanager updatePeripheralList:(NSArray *)peripherals RSSIList:(NSArray *)RSSIArr;
|
|
38
|
+
/// connection succeeded
|
|
39
|
+
/// @param BLEmanager Bluetooth management object
|
|
40
|
+
/// @param peripheral peripheral
|
|
41
|
+
- (void)BLEManagerDelegate:(BLEManager *)BLEmanager connectPeripheral:(CBPeripheral *)peripheral;
|
|
42
|
+
/// Disconnect
|
|
43
|
+
/// @param BLEmanager Bluetooth management object
|
|
44
|
+
/// @param peripheral peripheral
|
|
45
|
+
/// @param isAutoDisconnect Whether to automatically disconnect
|
|
46
|
+
- (void)BLEManagerDelegate:(BLEManager *)BLEmanager disconnectPeripheral:(CBPeripheral *)peripheral isAutoDisconnect:(BOOL)isAutoDisconnect;
|
|
47
|
+
/// Failed to connect to device
|
|
48
|
+
/// @param BLEmanager Bluetooth management object
|
|
49
|
+
/// @param peripheral peripheral
|
|
50
|
+
/// @param error error
|
|
51
|
+
- (void)BLEManagerDelegate:(BLEManager *)BLEmanager didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error;
|
|
52
|
+
// 收到数据
|
|
53
|
+
//- (void)BLEManagerDelegate:(BLEManager *)BLEmanager didReceiveDataFromPrinter:(CBCharacteristic *)characteristic;
|
|
54
|
+
|
|
55
|
+
/// Send data successfully
|
|
56
|
+
/// @param BLEmanager Bluetooth management object
|
|
57
|
+
/// @param character characters of bluetooth device
|
|
58
|
+
/// @param error error
|
|
59
|
+
- (void)BLEManagerDelegate:(BLEManager *)BLEmanager didWriteValueForCharacteristic:(CBCharacteristic *)character error:(NSError *)error;
|
|
60
|
+
@end
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@interface BLEManager : NSObject <CBCentralManagerDelegate, CBPeripheralDelegate> {
|
|
64
|
+
CBCharacteristic *write_characteristic;
|
|
65
|
+
CBCharacteristic *read_characteristic;
|
|
66
|
+
int commandSendMode; //命令发送模式 0:立即发送 1:批量发送
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#pragma mark -
|
|
70
|
+
|
|
71
|
+
@property (nonatomic,assign) id<BLEManagerDelegate> delegate;
|
|
72
|
+
|
|
73
|
+
#pragma mark 基本属性
|
|
74
|
+
|
|
75
|
+
@property (strong, nonatomic) CBCentralManager *manager; //BLE 管理中心
|
|
76
|
+
|
|
77
|
+
@property (strong, nonatomic) CBPeripheral *peripheral; //外设-蓝牙硬件
|
|
78
|
+
|
|
79
|
+
@property (nonatomic,assign ) BOOL isConnected; //连接成功= yes,失败=no
|
|
80
|
+
|
|
81
|
+
@property (nonatomic,assign ) BOOL isAutoDisconnect; //是否自动连接,是=yes,不=no
|
|
82
|
+
|
|
83
|
+
@property (atomic,assign ) BOOL connectStatu;// 蓝牙连接状态
|
|
84
|
+
|
|
85
|
+
@property (strong, nonatomic ) NSMutableArray *peripherals;// 发现的所有 硬件设备
|
|
86
|
+
|
|
87
|
+
@property (strong, nonatomic) NSMutableArray *connectedPeripherals;//连接过的Peripherals
|
|
88
|
+
|
|
89
|
+
@property (strong, nonatomic) NSMutableArray *RSSIArray;// 蓝牙信号数组
|
|
90
|
+
|
|
91
|
+
@property (assign, readonly) BOOL isScaning; //是否正在扫描 是=yes,没有=no
|
|
92
|
+
|
|
93
|
+
// Send data to the specified peripheral
|
|
94
|
+
@property (nonatomic,strong) CBPeripheral *writePeripheral;
|
|
95
|
+
/// Peripheral device scan callback
|
|
96
|
+
@property (copy, nonatomic) BleManagerDiscoverPeripheralCallBack scanBlock;
|
|
97
|
+
@property (nonatomic,strong) NSMutableArray *dataArray;
|
|
98
|
+
@property (nonatomic,strong) NSMutableArray *commandBuffer;
|
|
99
|
+
/// Connect Bluetooth callback
|
|
100
|
+
@property (copy, nonatomic) BleManagerConnectPeripheralCallBack connectBlock;
|
|
101
|
+
/// Receive data callback
|
|
102
|
+
@property (nonatomic,copy) BleManagerReceiveCallBack receiveBlock;
|
|
103
|
+
#pragma mark -
|
|
104
|
+
#pragma mark 基本方法
|
|
105
|
+
/**
|
|
106
|
+
* Singleton method
|
|
107
|
+
*
|
|
108
|
+
* @return self
|
|
109
|
+
*/
|
|
110
|
+
+ (instancetype)sharedBLEManager;
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
* Get mobile phone Bluetooth status
|
|
114
|
+
*/
|
|
115
|
+
- (BOOL)isLECapableHardware;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Turn on Bluetooth scanning
|
|
119
|
+
*/
|
|
120
|
+
- (void)startScan;
|
|
121
|
+
|
|
122
|
+
/*
|
|
123
|
+
* Start scanning and stop after scanInterval seconds
|
|
124
|
+
*/
|
|
125
|
+
- (void)startScanWithInterval:(NSInteger)scanInterval completion:(BleManagerDiscoverPeripheralCallBack)callBack;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Stop scanning
|
|
129
|
+
*/
|
|
130
|
+
- (void)stopScan;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Connect to specified device
|
|
134
|
+
*/
|
|
135
|
+
- (void)connectPeripheral:(CBPeripheral *)peripheral;
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
* Connect Bluetooth device
|
|
139
|
+
*/
|
|
140
|
+
- (void)connectPeripheral:(CBPeripheral *)peripheral completion:(BleManagerConnectPeripheralCallBack)callBack;
|
|
141
|
+
|
|
142
|
+
/*
|
|
143
|
+
* Try to reconnect
|
|
144
|
+
*/
|
|
145
|
+
- (void)reConnectPeripheral:(CBPeripheral *)peripheral;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Disconnect the specified peripheral
|
|
149
|
+
*/
|
|
150
|
+
- (void)disconnectPeripheral:(CBPeripheral *)peripheral;
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
#pragma mark -
|
|
154
|
+
#pragma mark 自定义其他属性
|
|
155
|
+
/**
|
|
156
|
+
* 向设备写入数据
|
|
157
|
+
*
|
|
158
|
+
* @param dataArray 需要写入的数据
|
|
159
|
+
* @param command 命令值,1=消息提醒, 2=跑步目标, 3=跑步完成目标时的灯光提醒, 4=设置低电量灯光提醒, 5=设置灯光常开颜色, 6=灯光常开时间, 7=灯光常开模式, 8=设置设备时间
|
|
160
|
+
*/
|
|
161
|
+
//- (void)writeDataToDevice:(NSArray *)dataArray command:(int)command;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
Send data to the device, the data sent is of type NSString, and the encoding type must be specified
|
|
165
|
+
@param peripheral peripheral
|
|
166
|
+
@param dataString Data sent
|
|
167
|
+
@param EncodingType EncodingType
|
|
168
|
+
*/
|
|
169
|
+
-(void)sendDataWithPeripheral:(CBPeripheral *)peripheral withString:(NSString *)dataString coding:(NSStringEncoding)EncodingType;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
Send instructions to the printer
|
|
173
|
+
@param data Command sent
|
|
174
|
+
*/
|
|
175
|
+
-(void)writeCommadnToPrinterWthitData:(NSData *)data;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
Send instructions to the printer with callback method
|
|
179
|
+
@param data Data sent
|
|
180
|
+
@param block CallBack
|
|
181
|
+
*/
|
|
182
|
+
-(void)writeCommadnToPrinterWthitData:(NSData *)data withResponse:(BleManagerReceiveCallBack)block;
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
//Disconnect rescan of existing devices
|
|
186
|
+
-(void)reScan;
|
|
187
|
+
//Disconnect current device
|
|
188
|
+
-(void)disconnectRootPeripheral;
|
|
189
|
+
|
|
190
|
+
//#pragma mark - ====================POS指令====================
|
|
191
|
+
//#pragma mark - 其他方法
|
|
192
|
+
///**
|
|
193
|
+
// * 1.水平定位
|
|
194
|
+
// */
|
|
195
|
+
//- (void)horizontalPosition;
|
|
196
|
+
///**
|
|
197
|
+
// * 2.打印并换行
|
|
198
|
+
// */
|
|
199
|
+
//- (void)printAndFeed;
|
|
200
|
+
///**
|
|
201
|
+
// * 3.打印并回到标准模式
|
|
202
|
+
// */
|
|
203
|
+
//- (void)printAndBackToNormalModel;
|
|
204
|
+
///**
|
|
205
|
+
// * 4.页模式下取消打印数据
|
|
206
|
+
// */
|
|
207
|
+
//- (void)cancelPrintData;
|
|
208
|
+
///**
|
|
209
|
+
// * 5.实时状态传送
|
|
210
|
+
// */
|
|
211
|
+
//- (void)updataPrinterState:(int)n
|
|
212
|
+
// completion:(BleManagerReceiveCallBack)callBlock;
|
|
213
|
+
///**
|
|
214
|
+
// * 6.实时对打印机请求
|
|
215
|
+
// */
|
|
216
|
+
//- (void)updataPrinterAnswer:(int) n;
|
|
217
|
+
///**
|
|
218
|
+
// * 7.实时产生钱箱开启脉冲
|
|
219
|
+
// */
|
|
220
|
+
//- (void)openBoxAndPulse:(int) n m:(int) m t:(int) t;
|
|
221
|
+
///**
|
|
222
|
+
// * 8.页模式下打印
|
|
223
|
+
// */
|
|
224
|
+
//- (void)printOnPageModel;
|
|
225
|
+
///**
|
|
226
|
+
// * 9.设置字符右间距
|
|
227
|
+
// */
|
|
228
|
+
//- (void)setCharRightMargin:(int)n;
|
|
229
|
+
///**
|
|
230
|
+
// * 10.选择打印模式
|
|
231
|
+
// */
|
|
232
|
+
//- (void)selectPrintModel:(int)n;
|
|
233
|
+
///**
|
|
234
|
+
// * 11.设置绝对打印位置
|
|
235
|
+
// */
|
|
236
|
+
//- (void)setPrintLocationWithParam:(int)nL nH:(int)nH;
|
|
237
|
+
///**
|
|
238
|
+
// * 12.选择/取消用户自定义字符
|
|
239
|
+
// */
|
|
240
|
+
//- (void)selectOrCancelCustomCharacter:(int)n;
|
|
241
|
+
//
|
|
242
|
+
///**
|
|
243
|
+
// * 13.定义用户自定义字符
|
|
244
|
+
// */
|
|
245
|
+
//- (void)definCustomCharacter:(int)y c1:(int)c1 c2:(int)c2 dx:(NSArray *)points;
|
|
246
|
+
///**
|
|
247
|
+
// * 14.选择位图模式
|
|
248
|
+
// */
|
|
249
|
+
//- (void)selectBitmapModel:(int)m nL:(int)nL nH:(int)nH dx:(NSArray *)points;
|
|
250
|
+
//
|
|
251
|
+
///**
|
|
252
|
+
// * 15.取消下划线模式
|
|
253
|
+
// */
|
|
254
|
+
//- (void)cancelUnderLineModel:(int)n;
|
|
255
|
+
///**
|
|
256
|
+
// * 16.设置默认行间距
|
|
257
|
+
// */
|
|
258
|
+
//- (void)setDefaultLineMargin;
|
|
259
|
+
///**
|
|
260
|
+
// * 17.设置行间距
|
|
261
|
+
// */
|
|
262
|
+
//- (void)setLineMargin:(int)n;
|
|
263
|
+
///**
|
|
264
|
+
// * 18.选择打印机
|
|
265
|
+
// */
|
|
266
|
+
//- (void)selectPrinter:(int)n;
|
|
267
|
+
///**
|
|
268
|
+
// * 19.取消用户自定义字符
|
|
269
|
+
// */
|
|
270
|
+
//- (void)cancelCustomCharacter:(int)n;
|
|
271
|
+
///**
|
|
272
|
+
// * 20.初始化打印机
|
|
273
|
+
// */
|
|
274
|
+
//- (void)initializePrinter;
|
|
275
|
+
///**
|
|
276
|
+
// * 21.设置横向跳格位置
|
|
277
|
+
// */
|
|
278
|
+
//- (void)setTabLocationWith:(NSArray *)points;
|
|
279
|
+
///**
|
|
280
|
+
// * 22.选择/取消加粗模式
|
|
281
|
+
// */
|
|
282
|
+
//- (void)selectOrCancelBoldModel:(int)n;
|
|
283
|
+
///**
|
|
284
|
+
// * 23.选择/取消双重打印模式
|
|
285
|
+
// */
|
|
286
|
+
//- (void)selectOrCancelDoublePrintModel:(int)n;
|
|
287
|
+
///**
|
|
288
|
+
// * 24.打印并走纸
|
|
289
|
+
// */
|
|
290
|
+
//- (void)printAndPushPage:(int)n;
|
|
291
|
+
///**
|
|
292
|
+
// * 25.选择页模式
|
|
293
|
+
// */
|
|
294
|
+
//- (void)selectPageModel;
|
|
295
|
+
///**
|
|
296
|
+
// * 26.选择字体
|
|
297
|
+
// */
|
|
298
|
+
//- (void)selectFont:(int)n;
|
|
299
|
+
///**
|
|
300
|
+
// * 27.选择国际字符集
|
|
301
|
+
// */
|
|
302
|
+
//- (void)selectINTL_CHAR_SETWith:(int)n;
|
|
303
|
+
///**
|
|
304
|
+
// * 28.选择标准模式
|
|
305
|
+
// */
|
|
306
|
+
//- (void)selectNormalModel;
|
|
307
|
+
///**
|
|
308
|
+
// * 29.在页模式下选择打印区域方向
|
|
309
|
+
// */
|
|
310
|
+
//- (void)selectPrintDirectionOnPageModel:(int)n;
|
|
311
|
+
///**
|
|
312
|
+
// * 30.选择/取消顺时针旋转90度
|
|
313
|
+
// */
|
|
314
|
+
//- (void)selectOrCancelRotationClockwise:(int)n;
|
|
315
|
+
///**
|
|
316
|
+
// * 31.页模式下设置打印区域
|
|
317
|
+
// */
|
|
318
|
+
//- (void)setprintLocationOnPageModelWithXL:(int)xL
|
|
319
|
+
// xH:(int)xH
|
|
320
|
+
// yL:(int)yL
|
|
321
|
+
// yH:(int)yH
|
|
322
|
+
// dxL:(int)dxL
|
|
323
|
+
// dxH:(int)dxH
|
|
324
|
+
// dyL:(int)dyL
|
|
325
|
+
// dyH:(int)dyH;
|
|
326
|
+
//
|
|
327
|
+
///**
|
|
328
|
+
// * 32.设置横向打印位置
|
|
329
|
+
// */
|
|
330
|
+
//- (void)setHorizonLocationWith:(int)nL nH:(int)nH;
|
|
331
|
+
///**
|
|
332
|
+
// * 33.选择对齐方式
|
|
333
|
+
// */
|
|
334
|
+
//- (void)selectAlignmentWithN:(int)n;
|
|
335
|
+
///**
|
|
336
|
+
// * 34.选择打印纸传感器以输出信号
|
|
337
|
+
// */
|
|
338
|
+
//- (void)selectSensorForOutputSignal:(int)n;
|
|
339
|
+
///**
|
|
340
|
+
// * 35.选择打印纸传感器以停止打印
|
|
341
|
+
// */
|
|
342
|
+
//- (void)selectSensorForStopPrint:(int)n;
|
|
343
|
+
///**
|
|
344
|
+
// * 36.允许/禁止按键
|
|
345
|
+
// */
|
|
346
|
+
//- (void)allowOrDisableKeypress:(int)n;
|
|
347
|
+
///**
|
|
348
|
+
// * 37.打印并向前走纸 N 行
|
|
349
|
+
// */
|
|
350
|
+
//- (void)printAndPushPageRow:(int)n;
|
|
351
|
+
///**
|
|
352
|
+
// * 38.产生钱箱控制脉冲
|
|
353
|
+
// */
|
|
354
|
+
//- (void)makePulseWithCashboxWithM:(int)m t1:(int)t1 t2:(int)t2;
|
|
355
|
+
///**
|
|
356
|
+
// * 39.选择字符代码表
|
|
357
|
+
// */
|
|
358
|
+
//- (void)selectCharacterTabN:(int)n;
|
|
359
|
+
///**
|
|
360
|
+
// * 40.选择/取消倒置打印模式
|
|
361
|
+
// */
|
|
362
|
+
//- (void)selectOrCancelInversionPrintModel:(int)n;
|
|
363
|
+
///**
|
|
364
|
+
// * 41.打印下载到FLASH中的位图
|
|
365
|
+
// */
|
|
366
|
+
//- (void)printFlashBitmapWithN:(int)n m:(int)m;
|
|
367
|
+
///**
|
|
368
|
+
// * 42.定义FLASH位图
|
|
369
|
+
// */
|
|
370
|
+
//- (void)definFlashBitmapWithN:(int)n Points:(NSArray *)points;
|
|
371
|
+
///**
|
|
372
|
+
// * 43.选择字符大小
|
|
373
|
+
// */
|
|
374
|
+
//- (void)selectCharacterSize:(int)n;
|
|
375
|
+
///**
|
|
376
|
+
// * 44.页模式下设置纵向绝对位置
|
|
377
|
+
// */
|
|
378
|
+
//- (void)setVertLocationOnPageModelWithnL:(int)nL nH:(int)nH;
|
|
379
|
+
///**
|
|
380
|
+
// * 45.定义下载位图
|
|
381
|
+
// */
|
|
382
|
+
//- (void)defineLoadBitmapWithX:(int)x Y:(int)y Points:(NSArray *)points;
|
|
383
|
+
///**
|
|
384
|
+
// * 46.执行打印数据十六进制转储
|
|
385
|
+
// */
|
|
386
|
+
//- (void)printDataAndSaveAsHexWithpL:(int)pL pH:(int)pH n:(int)n m:(int)m;
|
|
387
|
+
///**
|
|
388
|
+
// * 47.打印下载位图
|
|
389
|
+
// */
|
|
390
|
+
//- (void)printLoadBitmapM:(int)m;
|
|
391
|
+
///**
|
|
392
|
+
// * 48.开始/结束宏定义
|
|
393
|
+
// */
|
|
394
|
+
//- (void)beginOrEndDefine;
|
|
395
|
+
///**
|
|
396
|
+
// * 49.选择/取消黑白反显打印模式
|
|
397
|
+
// */
|
|
398
|
+
//- (void)selectORCancelBWPrintModel:(int)n;
|
|
399
|
+
///**
|
|
400
|
+
// * 50.选择HRI字符的打印位置
|
|
401
|
+
// */
|
|
402
|
+
//- (void)selectHRIPrintLocation:(int)n;
|
|
403
|
+
///**
|
|
404
|
+
// * 51.设置左边距
|
|
405
|
+
// */
|
|
406
|
+
//- (void)setLeftMarginWithnL:(int)nL nH:(int)nH;
|
|
407
|
+
///**
|
|
408
|
+
// * 52.设置横向和纵向移动单位
|
|
409
|
+
// */
|
|
410
|
+
//- (void)setHoriAndVertUnitXWith:(int)x y:(int)y;
|
|
411
|
+
///**
|
|
412
|
+
// * 53.选择切纸模式并切纸
|
|
413
|
+
// */
|
|
414
|
+
//- (void)selectCutPaperModelAndCutPaperWith:(int)m n:(int)n selectedModel:(int)model;
|
|
415
|
+
///**
|
|
416
|
+
// * 54.设置打印区域宽高
|
|
417
|
+
// */
|
|
418
|
+
//- (void)setPrintLocationWith:(int)nL nH:(int)nH;
|
|
419
|
+
///**
|
|
420
|
+
// * 55.页模式下设置纵向相对位置
|
|
421
|
+
// */
|
|
422
|
+
//- (void)setVertRelativeLocationOnPageModelWith:(int)nL nH:(int)nH;
|
|
423
|
+
///**
|
|
424
|
+
// * 56.执行宏命令
|
|
425
|
+
// */
|
|
426
|
+
//- (void)runMacroMommandWith:(int)r t:(int)t m:(int)m;
|
|
427
|
+
///**
|
|
428
|
+
// * 57.打开/关闭自动状态反传功能(ASB)
|
|
429
|
+
// */
|
|
430
|
+
//- (void)openOrCloseASB:(int)n;
|
|
431
|
+
///**
|
|
432
|
+
// * 58.选择HRI使用字体
|
|
433
|
+
// */
|
|
434
|
+
//- (void)selectHRIFontToUse:(int)n;
|
|
435
|
+
///**
|
|
436
|
+
// * 59. 选择条码高度
|
|
437
|
+
// */
|
|
438
|
+
//- (void)selectBarcodeHeight:(int)n;
|
|
439
|
+
///**
|
|
440
|
+
// * 60.打印条码
|
|
441
|
+
// */
|
|
442
|
+
//- (void)printBarCodeWithPoints:(int)m n:(int)n points:(NSArray *)points selectModel:(int)model;
|
|
443
|
+
///**
|
|
444
|
+
// * 61.返回状态
|
|
445
|
+
// */
|
|
446
|
+
//- (void)callBackStatus:(int)n completion:(BleManagerReceiveCallBack)block;
|
|
447
|
+
///**
|
|
448
|
+
// * 62.打印光栅位图
|
|
449
|
+
// */
|
|
450
|
+
//- (void)printRasterBitmapWith:(int)m
|
|
451
|
+
// xL:(int)xL
|
|
452
|
+
// xH:(int)xH
|
|
453
|
+
// yl:(int)yL
|
|
454
|
+
// yh:(int)yH
|
|
455
|
+
// points:(NSArray *)points;
|
|
456
|
+
///**
|
|
457
|
+
// * 63.设置条码宽度
|
|
458
|
+
// */
|
|
459
|
+
//- (void)setBarcodeWidth:(int)n;
|
|
460
|
+
//#pragma mark - ============汉字字符控制命令============
|
|
461
|
+
///**
|
|
462
|
+
// * 64.设置汉字字符模式
|
|
463
|
+
// */
|
|
464
|
+
//- (void)setChineseCharacterModel:(int)n;
|
|
465
|
+
///**
|
|
466
|
+
// * 65.选择汉字模式
|
|
467
|
+
// */
|
|
468
|
+
//- (void)selectChineseCharacterModel;
|
|
469
|
+
///**
|
|
470
|
+
// * 66.选择/取消汉字下划线模式
|
|
471
|
+
// */
|
|
472
|
+
//- (void)selectOrCancelChineseUderlineModel:(int)n;
|
|
473
|
+
///**
|
|
474
|
+
// * 67.取消汉字模式
|
|
475
|
+
// */
|
|
476
|
+
//- (void)cancelChineseModel;
|
|
477
|
+
///**
|
|
478
|
+
// * 68.定义用户自定义汉字
|
|
479
|
+
// */
|
|
480
|
+
//- (void)defineCustomChinesePointsC1:(int)c1 c2:(int)c2 points:(NSArray *)points;
|
|
481
|
+
///**
|
|
482
|
+
// * 69.设置汉字字符左右间距
|
|
483
|
+
// */
|
|
484
|
+
//- (void)setChineseMarginWithLeftN1:(int)n1 n2:(int)n2;
|
|
485
|
+
///**
|
|
486
|
+
// * 70.选择/取消汉字倍高倍宽
|
|
487
|
+
// */
|
|
488
|
+
//- (void)selectOrCancelChineseHModelAndWModel:(int)n;
|
|
489
|
+
//#pragma mark - ============打印机提示命令============
|
|
490
|
+
///**
|
|
491
|
+
// * 72.打印机来单打印蜂鸣提示
|
|
492
|
+
// */
|
|
493
|
+
//- (void)printerSound:(int)n t:(int)t;
|
|
494
|
+
///**
|
|
495
|
+
// * 73.打印机来单打印蜂鸣提示及报警灯闪烁
|
|
496
|
+
// */
|
|
497
|
+
//- (void)printerSoundAndAlarmLight:(int)m t:(int)t n:(int)n;
|
|
498
|
+
//
|
|
499
|
+
//#pragma mark - =========TSC指令==========
|
|
500
|
+
///**
|
|
501
|
+
// * 1.设置标签尺寸
|
|
502
|
+
// */
|
|
503
|
+
//- (void)PosaddSizeWidth:(int)width height:(int)height;
|
|
504
|
+
///**
|
|
505
|
+
// * 2.设置间隙长度
|
|
506
|
+
// */
|
|
507
|
+
//- (void)PosaddGap:(int)gap;
|
|
508
|
+
///**
|
|
509
|
+
// * 3.产生钱箱控制脉冲
|
|
510
|
+
// */
|
|
511
|
+
//- (void)PosaddCashDrwer:(int)m t1:(int)t1 t2:(int)t2;
|
|
512
|
+
///**
|
|
513
|
+
// * 4.控制每张标签的停止位置
|
|
514
|
+
// */
|
|
515
|
+
//- (void)PosaddOffset:(float)offset;
|
|
516
|
+
///**
|
|
517
|
+
// * 5.设置打印速度
|
|
518
|
+
// */
|
|
519
|
+
//- (void)PosaddSpeed:(float)speed;
|
|
520
|
+
///**
|
|
521
|
+
// * 6.设置打印浓度
|
|
522
|
+
// */
|
|
523
|
+
//- (void)PosaddDensity:(int)n;
|
|
524
|
+
///**
|
|
525
|
+
// * 7.设置打印方向和镜像
|
|
526
|
+
// */
|
|
527
|
+
//- (void)PosaddDirection:(int)n;
|
|
528
|
+
///**
|
|
529
|
+
// * 8.设置原点坐标
|
|
530
|
+
// */
|
|
531
|
+
//- (void)PosaddReference:(int)x y:(int)y;
|
|
532
|
+
///**
|
|
533
|
+
// * 9.清除打印缓冲区数据
|
|
534
|
+
// */
|
|
535
|
+
//- (void)PosaddCls;
|
|
536
|
+
///**
|
|
537
|
+
// * 10.走纸
|
|
538
|
+
// */
|
|
539
|
+
//- (void)PosaddFeed:(int)feed;
|
|
540
|
+
///**
|
|
541
|
+
// * 11.退纸
|
|
542
|
+
// */
|
|
543
|
+
//- (void)PosaddBackFeed:(int)feed;
|
|
544
|
+
///**
|
|
545
|
+
// * 12.走一张标签纸距离
|
|
546
|
+
// */
|
|
547
|
+
//- (void)PosaddFormFeed;
|
|
548
|
+
///**
|
|
549
|
+
// * 13.标签位置进行一次校准
|
|
550
|
+
// */
|
|
551
|
+
//- (void)PosaddHome;
|
|
552
|
+
///**
|
|
553
|
+
// * 14.打印标签
|
|
554
|
+
// */
|
|
555
|
+
//- (void)PosaddPrint:(int)m;
|
|
556
|
+
///**
|
|
557
|
+
// * 15.设置国际代码页
|
|
558
|
+
// */
|
|
559
|
+
//- (void)PosaddCodePage:(int)page;
|
|
560
|
+
///**
|
|
561
|
+
// * 16.设置蜂鸣器
|
|
562
|
+
// */
|
|
563
|
+
//- (void)PosaddSound:(int)level interval:(int)interval;
|
|
564
|
+
///**
|
|
565
|
+
// * 17.设置打印机报错
|
|
566
|
+
// */
|
|
567
|
+
//- (void)PosaddLimitFeed:(int)feed;
|
|
568
|
+
///**
|
|
569
|
+
// * 18.在打印缓冲区绘制黑块
|
|
570
|
+
// */
|
|
571
|
+
//- (void)PosaddBar:(int)x y:(int)y width:(int)width height:(int)height;
|
|
572
|
+
///**
|
|
573
|
+
// * 19.在打印缓冲区绘制一维条码
|
|
574
|
+
// */
|
|
575
|
+
//- (void)Posadd1DBarcodeX:(int)x
|
|
576
|
+
// y:(int)y
|
|
577
|
+
// type:(NSString *)type
|
|
578
|
+
// height:(int)height
|
|
579
|
+
// readable:(int)readable
|
|
580
|
+
// rotation:(int)rotation
|
|
581
|
+
// narrow:(int)narrow
|
|
582
|
+
// wide:(int)wide
|
|
583
|
+
// content:(NSString *)content;
|
|
584
|
+
///**
|
|
585
|
+
// * 20.在打印缓冲区绘制矩形
|
|
586
|
+
// */
|
|
587
|
+
//- (void)PosaddBox:(int)x y:(int)y xend:(int)xend yend:(int)yend;
|
|
588
|
+
///**
|
|
589
|
+
// * 21.在打印缓冲区绘制位图
|
|
590
|
+
// */
|
|
591
|
+
//- (void)PosaddBitmap:(int)x
|
|
592
|
+
// y:(int)y
|
|
593
|
+
// width:(int)width
|
|
594
|
+
// height:(int)height
|
|
595
|
+
// mode:(int)mode data:(int)data;
|
|
596
|
+
///**
|
|
597
|
+
// * 22.擦除打印缓冲区中指定区域的数据
|
|
598
|
+
// */
|
|
599
|
+
//- (void)PosaddErase:(int)x y:(int)y xwidth:(int)xwidth yheight:(int)yheight;
|
|
600
|
+
///**
|
|
601
|
+
// * 23.将指定区域的数据黑白反色
|
|
602
|
+
// */
|
|
603
|
+
//- (void)PosaddReverse:(int)x y:(int)y xwidth:(int)xwidth yheight:(int)yheight;
|
|
604
|
+
///**
|
|
605
|
+
// * 24.在打印缓冲区中绘制文字
|
|
606
|
+
// */
|
|
607
|
+
//- (void)PosaddText:(int)x y:(int)y font:(NSString *)font rotation:(int)rotation x_mul:(int)xmul y_mul:(int)ymul content:(NSString *)content;
|
|
608
|
+
///**
|
|
609
|
+
// * 25.在打印缓冲区中绘制文字
|
|
610
|
+
// */
|
|
611
|
+
//- (void)PosaddQRCode:(int)x y:(int)y level:(int)level cellWidth:(int)cellWidth rotation:(int)totation data:(NSString *)dataStr;
|
|
612
|
+
///**
|
|
613
|
+
// * 26.设置剥离功能是否开启
|
|
614
|
+
// */
|
|
615
|
+
//- (void)PosaddPeel:(NSString *)enable;
|
|
616
|
+
///**
|
|
617
|
+
// * 27.设置撕离功能是否开启
|
|
618
|
+
// */
|
|
619
|
+
//- (void)PosaddTear:(NSString *)enable;
|
|
620
|
+
///**
|
|
621
|
+
// * 28.设置切刀功能是否开启
|
|
622
|
+
// */
|
|
623
|
+
//- (void)PosaddCut:(NSString *)enable;
|
|
624
|
+
///**
|
|
625
|
+
// * 29.设置打印机出错时,是否打印上一张内容
|
|
626
|
+
// */
|
|
627
|
+
//- (void)PosaddReprint:(NSString *)enable;
|
|
628
|
+
///**
|
|
629
|
+
// * 30.设置是否按走纸键打印最近一张标签
|
|
630
|
+
// */
|
|
631
|
+
//- (void)PosaddPrintKeyEnable:(NSString *)enable;
|
|
632
|
+
///**
|
|
633
|
+
// * 31.设置按走纸键打印最近一张标签的份数
|
|
634
|
+
// */
|
|
635
|
+
//- (void)PosaddPrintKeyNum:(int)m;
|
|
636
|
+
/**
|
|
637
|
+
* 32.Return the contents of the buffer to be sent
|
|
638
|
+
*/
|
|
639
|
+
-(NSArray*)GetBuffer;
|
|
640
|
+
/**
|
|
641
|
+
* 33.Clear buffer contents
|
|
642
|
+
*/
|
|
643
|
+
-(void)ClearBuffer;
|
|
644
|
+
/**
|
|
645
|
+
* 34.Send buffer command
|
|
646
|
+
*/
|
|
647
|
+
-(void)SendCommandBuffer;
|
|
648
|
+
/**
|
|
649
|
+
* 34.Send a single command
|
|
650
|
+
* @param data 发送的数据
|
|
651
|
+
*/
|
|
652
|
+
-(void)sendCommand:(NSData *)data;
|
|
653
|
+
|
|
654
|
+
/// Set command mode
|
|
655
|
+
/// @param Mode mode
|
|
656
|
+
- (void)PosSetCommandMode:(int)Mode;
|
|
657
|
+
@end
|
|
658
|
+
|