Hi all, I can control volume up/down, music play/pause with the ble_hids module.
static uint8_t report_map_data[] = { 0x05, 0x0c, // Usage Page (consumer device) 0x09, 0x01, // Usage (consumer control) 0xA1, 0x01, // Collection (application)
0x09, 0xB0, // Usage (play)
0x09, 0xB1, // Usage (pause)
0x09, 0xB7, // Usage (stop)
0x09, 0xB5, // Usage (next)
0x09, 0xB6, // Usage (previous)
0x09, 0xCF, // Usage (voice command)
0x15, 0x01, // Logical Minimum (1)
0x25, 0x06, // Logical Maximum (6)
0x75, 0x04, // Report Size (4 bit)
0x95, 0x01, // Report Count (1)
0x81, 0x00, // INPUT (Data, Array, Absolute)
0x09, 0xE9, // Usage (Volume Up)
0x09, 0xEA, // Usage (Volume Down)
0x15, 0x01, // Logical Minimum (1)
0x25, 0x02, // Logical Maximum (2)
0x75, 0x02, // Report Size (2 bit)
0x95, 0x01, // Report Count (1)
0x81, 0x00, // INPUT (Data, Array, Absolute)
0x05, 0x07, // Usage Page (keyboard)
0x09, 0x58, // Usage(return)
0x09, 0x28, // Usage(enter)
0x15, 0x01, // Logical Minimum (1)
0x25, 0x02, // Logical Maximum (2)
0x75, 0x02, // Report Size (2 bit)
0x95, 0x01, // Report Count (1)
0x81, 0x00, // INPUT (Data, Array, Absolute)
0xC0 // End Collection (Application)
};
But whenever bluetooth device on Android is closed or ble connection drops, the music player auto start playing music.