我尝试了许多在 Xamarin 跨平台上使用 Iphone 连接 Zebra IMZ320 蓝牙的示例
并且还使用 Plugin.BLE
但我无法连接我的设备,没有人有使用 Xamarin 跨平台 ios 连接蓝牙打印机的成功经验
最佳答案
CoreBluetooth.framework
适用于低功耗蓝牙:
Communicate with Bluetooth 4.0 low-energy devices.
The Core Bluetooth framework provides the classes needed for your apps to communicate with devices that are equipped with Bluetooth low energy wireless technology.
根据Zebra IMZ320的规范,通讯方式为:
Secure Bluetooth 2.0, 802.11a/b/g/n (optional) or USB (client) connectivity; Wi-Fi®-certified connectivity
这不是低功耗蓝牙(已在蓝牙 4.0 中引入)。您将无法通过蓝牙低功耗扫描找到打印机,因为行为、逻辑和实现(协议(protocol)、规范、GATT、外设/服务/特性)完全不同。
此外,description page of the Zebra IMZ320提供了一个链接(FAQ - Creating & Registering An IOS App)来指导如何为其开发应用程序。 您需要使用ExternalAccessory.framework为了它。
If your app communicates with a Zebra product via Bluetooth using the External Accessory Framework, and you plan to distribute the app via the App Store or Volume Purchase Program Store, then you must register the app with Zebra.
此页面是通用页面(并非特定于该打印机)。但根据规范,它不符合蓝牙低功耗标准(而其他产品可能符合,这就是为什么其中有一段谈论 CoreBluetooth)。
这是正常行为(使用 ExternalAccessory
与 CoreBluetooth
框架),因为它们中的每一个都有特定的含义和用途。
结论:
使用ExternalAccessory.framework,也是available on Xamarin .
关于xamarin.forms - Xamarin跨平台蓝牙连接的示例代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50284991/