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

HID Android/Iphone

Hi, I have implemented a firmware that allows to bonding and connecting whit android and iOs; I have added the HID service and characteristics, if I press a button I can send a parameter 0xE9(with this parameter I should increment the volume in the android device) at the characteristic 2A4D, but the device volume doesn't increment... 1: I must send another parameter to another characteristic? 2: iOs HID parameters, are equals to Android parameters? Thanks Best regardes!

Parents
  • @Epasta:

    I'm not very familiar with the code on mbed. But for the consumer control HID report , what we do is to just notify the button pressed (0xE9 for volume up is already defined in the report) based on the position of the entry in the report. You can find the define:

    typedef enum
    {
        RELEASE_KEY                     = 0x00,
        CONSUMER_CTRL_PLAY              = 0x01,
        CONSUMER_CTRL_ALCCC             = 0x02,
        CONSUMER_CTRL_SCAN_NEXT_TRACK   = 0x04,
        CONSUMER_CTRL_SCAN_PREV_TRACK   = 0x08,
        CONSUMER_CTRL_VOL_DW            = 0x10,
        CONSUMER_CTRL_VOL_UP            = 0x20,
        CONSUMER_CTRL_AC_FORWARD        = 0x40,
        CONSUMER_CTRL_AC_BACK           = 0x80,    
    } consumer_control_t;
    

    So when we want to send "volume up", we send the notification of the characteristic with value = 0x20 (not 0xE9) (match with command number 6 in the list).

    I would suggest you to also post the question on mbed website.

Reply
  • @Epasta:

    I'm not very familiar with the code on mbed. But for the consumer control HID report , what we do is to just notify the button pressed (0xE9 for volume up is already defined in the report) based on the position of the entry in the report. You can find the define:

    typedef enum
    {
        RELEASE_KEY                     = 0x00,
        CONSUMER_CTRL_PLAY              = 0x01,
        CONSUMER_CTRL_ALCCC             = 0x02,
        CONSUMER_CTRL_SCAN_NEXT_TRACK   = 0x04,
        CONSUMER_CTRL_SCAN_PREV_TRACK   = 0x08,
        CONSUMER_CTRL_VOL_DW            = 0x10,
        CONSUMER_CTRL_VOL_UP            = 0x20,
        CONSUMER_CTRL_AC_FORWARD        = 0x40,
        CONSUMER_CTRL_AC_BACK           = 0x80,    
    } consumer_control_t;
    

    So when we want to send "volume up", we send the notification of the characteristic with value = 0x20 (not 0xE9) (match with command number 6 in the list).

    I would suggest you to also post the question on mbed website.

Children
No Data
Related