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

game pad report

Hi,

I use nrf51822 HID keyboard. How to add a game-pad report as a second report in the ble_hid_keyboard ? How to init the function hids_init() in SDK.

Thanks

Gamepad report

 0x05, 0x01,     // USAGE_PAGE (Generic Desktop)
               0x09, 0x05,      // USAGE (Game Pad)
               0xa1, 0x01,              // COLLECTION (Application)
               0x85, 0x02,                      //Report Id (2)
               0x05, 0x02,                      // USAGE_PAGE (Simulation Controls)
               0x09, 0xbb,                      // USAGE (Throttle)
               0x15, 0x00,                      // LOGICAL_MINIMUM (0)
               0x25, 0x1f,                      // LOGICAL_MAXIMUM (31)
               0x75, 0x08,                      // REPORT_SIZE (8)
               0x95, 0x01,                      // REPORT_COUNT (1)
               0x81, 0x02,                       // INPUT (Data,Var,Abs)
               0x05, 0x02,                      // USAGE_PAGE (Simulation Controls)
               0x09, 0xbb,                      // USAGE (Throttle)
               0x15, 0x00,                      // LOGICAL_MINIMUM (0)
               0x25, 0x1f,                      // LOGICAL_MAXIMUM (31)
               0x75, 0x08,                      // REPORT_SIZE (8)
               0x95, 0x01,                      // REPORT_COUNT (1)
               0x81, 0x02,                      // INPUT (Data,Var,Abs)
               0x05, 0x01,                      // USAGE_PAGE (Generic Desktop)
               0xa1, 0x00,                         // COLLECTION (Physical)
               0x09, 0x30,                              // USAGE (X)
               0x09, 0x31,                              // USAGE (Y)
               0x09, 0x32,                              // USAGE (Z)
               0x09, 0x33,                              // USAGE (Rx)
               0x15, 0x81,                              // LOGICAL_MINIMUM (-127)
               0x25, 0x7f,                              // LOGICAL_MAXIMUM (127)
               0x75, 0x08,                              // REPORT_SIZE (8)
               0x95, 0x04,                              // REPORT_COUNT (4)
               0x81, 0x02,                              // INPUT (Data,Var,Abs)
               0x05, 0x09,                              // USAGE_PAGE (Button)
               0x19, 0x01,                              // USAGE_MINIMUM (Button 1)
               0x29, 0x10,                              // USAGE_MAXIMUM (Button 16)
               0x15, 0x00,                              // LOGICAL_MINIMUM (0)
               0x25, 0x01,                              // LOGICAL_MAXIMUM (1)
               0x75, 0x01,                              // REPORT_SIZE (1)
               0x95, 0x10,                              // REPORT_COUNT (16)
               0x81, 0x02,                              // INPUT (Data,Var,Abs)
               0xc0,                            // END_COLLECTION
               0xc0                     // END_COLLECTION
Related