@@ -19,26 +19,34 @@ static const uint8_t reportReferenceChar[2] = {
1919};
2020
2121static const uint8_t hidReportMap [] = {
22- 0x05 , 0x0C , // Usage Page (Consumer )
23- 0x09 , 0x01 , // Usage (Consumer Control )
22+ 0x05 , 0x01 , // Usage Page (Generic Desktop Ctrls )
23+ 0x09 , 0x05 , // Usage (Game Pad )
2424 0xA1 , 0x01 , // Collection (Application)
2525 0x85 , 0x01 , // Report Id (1)
26- 0x05 , 0x0C , // Usage Page (Consumer)
27- 0x09 , 0x86 , // Usage (Channel)
28- 0x15 , 0xFF , // Logical Minimum (-1)
29- 0x25 , 0x01 , // Logical Maximum (1)
30- 0x75 , 0x02 , // Report Size (2)
31- 0x95 , 0x01 , // Report Count (1)
32- 0x81 , 0x46 , // Input (Data,Var,Rel,No Wrap,Linear,Preferred State,Null State)
33- 0x09 , 0xE9 , // Usage (Volume Increment)
34- 0x09 , 0xEA , // Usage (Volume Decrement)
35- 0x15 , 0x00 , // Logical Minimum (0)
36- 0x75 , 0x01 , // Report Size (1)
37- 0x95 , 0x02 , // Report Count (2)
38- 0x81 , 0x02 , // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
39- 0x95 , 0x01 , // Report Count (1)
40- 0x75 , 0x04 , // Report Size (4)
41- 0x81 , 0x03 , // Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
26+ 0xA1 , 0x00 , // Collection (Physical)
27+ 0x05 , 0x01 , // Usage Page (Generic Desktop Ctrls)
28+ 0x09 , 0x30 , // Usage (X)
29+ 0x09 , 0x31 , // Usage (Y)
30+ 0x09 , 0x32 , // Usage (Z)
31+ 0x09 , 0x33 , // Usage (Rx)
32+ 0x09 , 0x35 , // Usage (Rz)
33+ 0x09 , 0x34 , // Usage (Ry)
34+ 0x09 , 0x36 , // Usage (Slider)
35+ 0x09 , 0x36 , // Usage (Slider)
36+ 0x15 , 0x00 , // Logical Minimum (0)
37+ 0x26 , 0xFF , 0x07 , // Logical Maximum (2047)
38+ 0x75 , 0x10 , // Report Size (16)
39+ 0x95 , 0x08 , // Report Count (8)
40+ 0x81 , 0x02 , // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
41+ 0x05 , 0x09 , // Usage Page (Button)
42+ 0x19 , 0x01 , // Usage Minimum (0x01)
43+ 0x29 , 0x08 , // Usage Maximum (0x08)
44+ 0x15 , 0x00 , // Logical Minimum (0)
45+ 0x25 , 0x01 , // Logical Maximum (1)
46+ 0x95 , 0x08 , // Report Count (8)
47+ 0x75 , 0x01 , // Report Size (1)
48+ 0x81 , 0x02 , // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
49+ 0xC0 , // End Collection
4250 0xC0 , // End Collection
4351};
4452
@@ -262,7 +270,7 @@ int gatt_svr_chr_hid(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt
262270
263271 //Daten des reports übermitteln
264272 if (uuid == GATT_HID_REPORT_UUID ) {
265- rc = os_mbuf_append (ctxt -> om , reportData , sizeof (reportData )/ sizeof ( reportData [ 0 ] ));
273+ rc = os_mbuf_append (ctxt -> om , & channelData , sizeof (channelData ));
266274 return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES ;
267275 }
268276
0 commit comments