【发布时间】:2019-05-15 02:27:47
【问题描述】:
我有一台 58 毫米的“MINI 热敏打印机”,型号:ZJ-5805DD 用作我的 POS 应用程序的 POS 打印机。
我已成功通过蓝牙以编程方式将我的应用程序连接到打印机,并且可以使用
正常打印文本KitchenPrinter.writeValue(myStringData, for: A2orC2, type: .withoutResponse)
*注意:A2 或 C2 [见下文] 特征会产生相同的文本打印输出。
更改字体打印大小已成为我的死胡同。我知道这是可能的,因为打印机手册让我从 AppStore 下载了可以更改字体大小的打印测试仪“POS-PrinterV1.0”
在服务/特征发现时,我们发现 4 个服务 A、B、C、D(为了讨论简单)
答:
CBService:0x1c0a6a5c0,isPrimary = YES,UUID = 49535343-FE7D-4AE5-8FA9-9FAFD205E455
CBCharacteristic: 0x1c02adf80, UUID = 49535343-1E4D-4BD9-BA61-23C647249616, properties = 0x10, value = (null), notifying = NO包含通知
CBCharacteristic: 0x1c02bba80, UUID = 49535343-8841-43F4-A8D4-ECBE34729BB3, properties = 0xC, value = (null), notifying = NO包含 WRITE WRITEWITHOUTRESPONSE
乙:
CBService:0x1c0a6ce80,isPrimary = YES,UUID = E7810A71-73AE-499D-8C15-FAA9AEF0C3F2
CBCharacteristic: 0x1c02adfe0, UUID = BEF8D6C9-9C21-4C9E-B632-BD58C1009F9F, properties = 0x3E, value = (null), notifying = NO包含 WRITE WRITETHOUTRESPONSE NOTIFY READ INDICATE
C:
CBService: 0x1c0a69100, isPrimary = YES, UUID = 18F0
CBCharacteristic: 0x1c02b8000, UUID = 2AF0, properties = 0x30, value = (null), notifying = NO包含通知指示
CBCharacteristic: 0x1c02a5700, UUID = 2AF1, properties = 0xC, value = (null), notifying = NO包含 WRITE WRITEWITHOUTRESPONSE
D:
CBService: 0x1c0a68300, isPrimary = YES, UUID = 设备信息
CBCharacteristic: 0x1c02a5dc0, UUID = Serial Number String, properties = 0x2, value = (null), notifying = NO包含阅读
CBCharacteristic: 0x1c02a77a0, UUID = Software Revision String, properties = 0x2, value = (null), notifying = NO包含阅读
CBCharacteristic: 0x1c02a76e0, UUID = Hardware Revision String, properties = 0x2, value = (null), notifying = NO包含阅读
CBCharacteristic: 0x1c02a6060, UUID = Manufacturer Name String, properties = 0x2, value = (null), notifying = NO包含阅读
我几天来一直在互联网上搜索 Swift 解决方案。请问有人可以帮忙吗?
【问题讨论】:
标签: swift printing bluetooth font-size cbperipheral