Skip to content

Commit b633821

Browse files
committed
Change the reportMap to the same one as used for USB
1 parent 43c096f commit b633821

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

ble/ble.go

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package ble
44

55
import (
6+
"machine/usb/descriptor"
67
k "machine/usb/hid/keyboard"
78

89
"tinygo.org/x/bluetooth"
@@ -12,32 +13,7 @@ var adapter = bluetooth.DefaultAdapter
1213
var reportIn bluetooth.Characteristic
1314
var rx bluetooth.DeviceCharacteristic
1415

15-
var reportMap = []byte{
16-
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
17-
0x09, 0x06, // USAGE (Keyboard)
18-
0xa1, 0x01, // COLLECTION (Application)
19-
0x85, 0x02, // REPORT_ID (2)
20-
0x05, 0x07, // USAGE_PAGE (Keyboard)
21-
0x19, 0x01, // USAGE_MINIMUM
22-
0x29, 0x7f, // USAGE_MAXIMUM
23-
0x15, 0x00, // LOGICAL_MINIMUM (0)
24-
0x25, 0x01, // LOGICAL_MAXIMUM (1)
25-
0x75, 0x01, // REPORT_SIZE (1)
26-
0x95, 0x08, // REPORT_COUNT (8)
27-
0x81, 0x02, // INPUT (Data,Var,Abs)
28-
0x95, 0x01, // REPORT_COUNT (1)
29-
0x75, 0x08, // REPORT_SIZE (8)
30-
0x81, 0x01, // INPUT (Cnst,Ary,Abs)
31-
0x95, 0x06, // REPORT_COUNT (6)
32-
0x75, 0x08, // REPORT_SIZE (8)
33-
0x15, 0x00, // LOGICAL_MINIMUM (0)
34-
0x25, 0x65, // LOGICAL_MAXIMUM (101)
35-
0x05, 0x07, // USAGE_PAGE (Keyboard)
36-
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
37-
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
38-
0x81, 0x00, // INPUT (Data,Ary,Abs)
39-
0xc0, // END_COLLECTION
40-
}
16+
var reportMap = descriptor.CDCHID.HID[2]
4117

4218
type bleKeyboard struct {
4319
keyboard

0 commit comments

Comments
 (0)