This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Disable HID some of the time

We are developing a device that has different "modes", and in some modes it acts as a HID keyboard and mouse, but in other modes it does not. This device connects to iOS and android, and in HID modes causes the virtual keyboard to be hidden as it is a HID keyboard. So in none-HID modes we want to avoid iOS recognising the device as a HID keyboard.

We have an existing device on a different platform which already implements this. When switching between HID and non-HID modes, it will modify the HID report and send a services modified indication for the HID service, causing iOS to re-read the HID report. This works fine.

What would be the best way to do the same thing on Nordic nRF52832? I've read that the GATT database cannot be modified without disconnection, which we want to avoid. Is there any way to do the same as on the existing platform – modify the HID report and send a services changed indication?

Parents
  • Hi Nick

    sd_ble_gatts_service_changed is used to perform a Service Changed Indication to one or more peers. You can add and change services, but you won't be able to remove any. I'm not entirely sure how this works with HID, but I imagine "removing" the HID function might count as removing a service. In any case, you're welcome to try it out, and yes, you can use 0xFFFF as the end handle if you're not adding any further services.

    Best regards,

    Simon

  • This is what I was wanting originally, as I mentioned sending a services changed indication for the existing HID service causes the OS to re-read the HID report, and if the report does not contain a keyboard then the virtual keyboard will be shown. Is there any way to determine the HID service end handle? or would it be a case of adding an offset to the final characteristic handle?

Reply
  • This is what I was wanting originally, as I mentioned sending a services changed indication for the existing HID service causes the OS to re-read the HID report, and if the report does not contain a keyboard then the virtual keyboard will be shown. Is there any way to determine the HID service end handle? or would it be a case of adding an offset to the final characteristic handle?

Children
No Data
Related