作者:村头的小路_157 | 来源:互联网 | 2023-05-17 12:32
IwanttocheckwhethertheBlueToothdeviceisthedeviceIwantbytheHID(HumanInterfaceDevice)
I want to check whether the BlueTooth device is the device I want by the HID(Human Interface Device) profile.
我想检查蓝牙设备是否是HID(人机接口设备)配置文件所需的设备。
Is it possible??
可能吗??
And how to get the HID profile?
以及如何获得HID配置文件?
Thanks for your help
谢谢你的帮助
1 个解决方案
6
Based on your comments, I do understand your request like that: You want to write an iOS app that takes input from a device connected via Bluetooth using the HID profile. Input from other, similar devices shall not be accepted by the app.
根据您的意见,我确实理解您的请求:您想要编写一个iOS应用程序,该应用程序通过使用HID配置文件通过蓝牙连接的设备获取输入。应用程序不接受来自其他类似设备的输入。
A first answer is: You can't do that. Bluetooth HID connections are established at OS level by
第一个答案是:你做不到。蓝牙HID连接在OS级别建立
Once, the input device is connected, it works as it is supposed to: Sending input events (in case of a keyboard characters / control signals). On app level you are not able to access low level data, like Bluetooth address, manufacturer information and so on. Gamekit will not help. It is higher level than OS level and requires an iOS device with an appropriate app on the remote side as well.
一旦输入设备连接,它就可以正常工作:发送输入事件(如果是键盘字符/控制信号)。在应用程序级别,您无法访问低级别数据,如蓝牙地址,制造商信息等。 Gamekit无济于事。它的级别高于操作系统级别,并且要求iOS设备在远程端具有适当的应用程序。
On a second thought, as you are developing the remote Bluetooth input device as well, you may go higher level. You connect the device as described above, but you encrypt the data the input device sends to a mobile device. Your app decrypts data and you problem is solved. Third party devices don't use your protocol and can't talk to your app. (So your app will have ignore their inputs). But this approach will break compatibility with other devices not using your app (e.g. you can't get a Bluetooth keyboard working with a regular pc anymore).
再想一想,当您开发远程蓝牙输入设备时,您可能会更上一层楼。您如上所述连接设备,但您加密输入设备发送到移动设备的数据。您的应用程序解密数据,您的问题就解决了。第三方设备不使用您的协议,无法与您的应用交谈。 (所以你的应用程序将忽略他们的输入)。但是这种方法会破坏与不使用您的应用程序的其他设备的兼容性(例如,您无法再使用普通电脑的蓝牙键盘)。