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

nrf51822 send media key to android device

hey I have a nRF51822 eval board and I want to use it as hid keyboard to send some media key such as vol+/- play/pause, etc. I have used the example code ble_hid_keyboard and it works well to send characters but I don't know how to send these media keys. thanks

Parents
  • FormerMember
    0 FormerMember

    From what I can see in USB HID Usage Tables on p. 56, vol +/- and play/pause has the following commands:

    • Volume up: 0x80
    • Volume down: 0x81
    • Play/pause: seems to be described in chapter 3.4.4 "Alternate Types"

    Update 26.10.2016: This example on github shows how to transfer vol+/-, play/pause. The example is for an older SDK, but the HID part/HID coding will be the same with a newer SDK.

  • Has anyone got the solution Kristin linked to work?

    I'm using SDK v12.3, started with the HID example and that works, I can see the keystrokes in android. I updated hids_init() to match the github example code and replaced keys_send() calls with consumer_control_send, but so far I'm not having any luck getting the device to respond.

    Edit: I've got it working now, it was something in the report map. Since all I want to do is control media, I updated to the report map in the main.c file that is attached to this thread and it's working.

Reply
  • Has anyone got the solution Kristin linked to work?

    I'm using SDK v12.3, started with the HID example and that works, I can see the keystrokes in android. I updated hids_init() to match the github example code and replaced keys_send() calls with consumer_control_send, but so far I'm not having any luck getting the device to respond.

    Edit: I've got it working now, it was something in the report map. Since all I want to do is control media, I updated to the report map in the main.c file that is attached to this thread and it's working.

Children
No Data
Related