3
3
package ble
4
4
5
5
import (
6
+ "machine/usb/descriptor"
6
7
k "machine/usb/hid/keyboard"
7
8
8
9
"tinygo.org/x/bluetooth"
@@ -12,32 +13,7 @@ var adapter = bluetooth.DefaultAdapter
12
13
var reportIn bluetooth.Characteristic
13
14
var rx bluetooth.DeviceCharacteristic
14
15
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 ]
41
17
42
18
type bleKeyboard struct {
43
19
keyboard
0 commit comments