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

HID Finger Swipe Functionality (iPhone)

I’m very familiar with the HID keyboard and mouse profile and have built products using it but need direction on how to replicate the functionality of a up/down/left/right finger swipe on a iPhone. Any guidance will be valuable.  Thanks 

  • What I'm trying to accomplish is exactly what this remote is doing but not sure what type of Bluetooth HID profile it's working with. What it's doing is performing up/down/left/right scroll as if it was a finger swipe.  I think it is acting like a digitizer but it shows up as a keyboard profile and not a mouse.  There is another thread that talks about HID digitizer and has an example project to go with it but its base is on top of mouse. So I'm little confused on what HID profile to focus on.  I do have the packet logs captured from this remote.  Is there a way to capture the report profile from a device?

    www.aliexpress.com/.../4000061114207.html

  • Hi Matthew

    If you have access to the device in question you should be able to connect to it from the nRF Connect mobile app, and read out the HID report descriptor from there. 

    Then you can try to replicate that HID descriptor in your own peripheral implementation. 

    Best regards
    Torbjørn

  • Hi Overbekk,

    Thanks for the reply.  I'm in the process of rapidly growing my knowledge of Bluetooth LE.  I have done what you suggested and not sure where I should pull the feature report from in the nRF Connect App on my iPhone.  I have attached two screen shots to show what the app is revealing for the device.  My goal is to get and recreate the feature report like the example below.  At what point is the feature report sent to the iPhone during the connection and paring?  I have the packet logs that I pulled using the Mac OS X PacketLogger for Bluetooth.  The logs have the connection and paring information and also the info for each button press.  I have also uploaded them in case they help in any way.  As you know they can be viewed through Wireshark but wanted to add this note for others.  I'm going to try and see what the logs tell me but if you have any further advice or information please share.  Thanks...

    0x05, 0x0D,        // Usage Page (Digitizer)
       0x09, 0x04,        // Usage (Touch Screen)
       0xA1, 0x01,        // Collection (Application)
          ....,.....,        //   etc....
          0x95, 0x01,        //   Report Count (1)
          0xB1, 0x02,        //   Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
    0xC0 // End Collection




    0310.RemotePacketLogs.pklg
  • Hi Matthew

    Using the ble_app_hids_mouse example in the SDK you should be able to set up something similar to your remote device, as long as you copy the HID Report descriptor. One possible issue is that iOS in general doesn't support HID mice, only keyboards. 

    The log you sent was very useful, and shows the report descriptor being transferred (packets 100, 103, 106, ... in the log). The descriptor appears to identify the device as a mouse, so I am surprised this would work, but I guess you have verified that the device can be used to control the phone?

    The screenshots you sent don't appear to show the HID service at all, only the standard Generic Access, Generic Attribute and Battery services. Since the HID service is handled by the OS directly it is probably made inaccessible by the system. 

    An alternative is to use a Nordic devkit or dongle connected to your PC/Mac, and use the nRF Connect for Desktop application to connect to it. Then you should be able to see all the services. 

    Best regards
    Torbjørn

  • Hi Ovrebekk,

    You are correct about the iPhone not supporting HID mouse unless enable now in the Accessibility options.  But when I connect the remote to the computer it shows up as a keyboard and not a mouse.  Now I think you recognize my struggle and need the report descriptor.

    If I understand you correct.  I will use nRF Connect on my Mac that is connected to my nRF52832 devkit and have the remote connect and pair to the devkit so I can extract the info?  I'm guessing there is a sample project that allows for me to host as a master on the devkit?

    I will review the packet logs and try to figure out what you are suggesting.  Thanks...

Related