BLE HID can first identify whether IOS or Android sends different report descriptors

最近,我做了一个HID项目,发现其他蓝牙设备可以根据连接的主机是IOS还是Android发送不同的报告描述符。

Parents
  • Hi 

    If I understand you correctly you want a BLE HID device to know if it is connected to and Android or an iOS phone? 

    I don't think there is a good way to do this unfortunately, but I will do some investigating internally and get back to you. 

    Best regards
    Torbjørn

  • Yes, I need to know the host's operating system before sending the report descriptor

  • Hi 

    Would you be able to share those packet capture traces with me so I can try to understand what these devices are doing? 

    It might be possible to connect to the phone with a generic HID report, then perform service discovery of the server in the phone and use that to determine whether the phone is an Android or iOS device. 

    Then you have to change the HID report based on which platform you're on, and use the Service Changed characteristic to inform the phone that the services are changed and that service discovery needs to be repeated. 

    This has never been tested by us though, and I don't know if it would be a reliable method across different phones. This is why it would be interesting to take a look at the traces you captured.

    Best regards
    Torbjørn

  • Hello,

    I don't know if there are any time constraints on HID Report characteristic read, but you could delay the response after you're done checking Manufacturer Name String characteristic.

    Do something like that:

    1. When you receive connection indication, initiate service discovery from your HID side. You're only interested in Device Information service (0x180A), so discover by service UUID to make it faster.

    2. If you'd get Report char read request, wait a bit until you know the type of the connected device.

    3. When Device Information service is found, discover Manufacturer Name String characteristic inside (0x2A29).

    4. Read this characteristic. All Apple devices will return "Apple Inc.".

    Only when 1, 3 or 4 fail you may assume it's not an iDevice and you may return the Report char value.

    Android devices don't have Device Information service natively, but any app could create such service in its GATT service configuration. It may also decide to return "Apple Inc.", but there's nothing you can do about it. That would have to be intentional.

    Seems like you'll have to modify the default behavior to be able to postpone Report read request. I don't know if that's possible from API or spec perspective. Anyway, that's an idea.

  • BLEHID.rar

    Hi

    This is the packet capture data of two products

    Thank you

  • This product is designed to control the phone's self timer, Tiktok and sliding up and down. It can only run smoothly on a specific operating system version, because it needs to be compatible with two operating systems on one product

Reply Children
No Data
Related