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

Modify ble_app_hids_keyboard to be able to send Volumn_up/down keys

Hello, sorry if this is a stupid question.I'm using a nRF51822, SDK6.0.0 and S110 7.0.0.I want to modify ble_app_hids_keyboard to be able to send Volumn_up/down keys to android phone.I have search the question in developer zone, and find out 3 parts which need to be modified.

1.USB descriptors,that is reportmap in main.The following is the content of my code.

0x05,0x0C, //(GLOBAL) USAGE_PAGE 0x000C Consumer Device Page 
0x09,0x01, //(LOCAL) USAGE 0x000C0001 Consumer Control (CA=Application Collection) 
0xA1,0x01, //(MAIN) COLLECTION 0x01 Application (Usage=0x000C0001: Page=Consumer Device Page, Usage=Consumer Control, Type=CA)
0x85,0x01, //(GLOBAL) REPORT_ID 0x01 (1) 
0x19,0x01, //(LOCAL) USAGE_MINIMUM 0x000C0001 Consumer Control (CA=Application Collection) 
0x2A,0x9C,0x02, //(LOCAL) USAGE_MAXIMUM 0x000C029C AC Distribute Vertically (Sel=Selector) 
0x15,0x01, //(GLOBAL) LOGICAL_MINIMUM 0x01 (1) 
0x26,0x9C,0x02, //(GLOBAL) LOGICAL_MAXIMUM 0x029C (668) 
0x95,0x01, //(GLOBAL) REPORT_COUNT 0x01 (1) Number of fields 
0x75,0x10, //(GLOBAL) REPORT_SIZE 0x10 (16) Number of bits per field 
0x81,0x00, //(MAIN) INPUT 0x00000000 (1 field x 16 bits) 0=Data 0=Array 0=Absolute 0=Ignored 0=Ignored 0=PrefState 0=NoNull 
0xC0 //(MAIN) END_COLLECTION Application

2.Modify keys_send(1, p_key) to keys_send(2, p_key) or keys_send(3, p_key), according to 2 bytes or 3 bytes.

3.Modify m_sample_key_press_scan_str.The following is the tried combinations.


2 bytes 0x00, 0xE9

0x01, 0xE9

3 bytes 0x01, 0xE9, 0x00

0x00, 0xE9, 0x00

Nevertheless, the device is still recognized as a keyboard.Just can only send the letters on the keyboard to android phone.Can someone give me some tips?Thanks.

Parents Reply Children
No Data
Related