1
- # The MIT License (MIT)
1
+ # The MIT License (MIT)
2
2
#
3
3
# Copyright (c) 2019 Dan Halbert for Adafruit Industries
4
4
#
@@ -239,24 +239,24 @@ def __init__(self, name=None, tx_power=0):
239
239
# Protocol mode: boot or report. Make it read-only for now because
240
240
# it can't be changed
241
241
242
- # protocol_mode_char = Characteristic(
243
- # UUID(_PROTOCOL_MODE_UUID_NUM), properties=Characteristic.READ | Characteristic.WRITE_NO_RESPONSE,
244
- # read_perm=Attribute.OPEN, write_perm=Attribute.OPEN,
245
- # max_length=1, fixed_length=True)
246
- # protocol_mode_char.value = _PROTOCOL_MODE_REPORT
247
-
248
- # boot_keyboard_input_report = Characteristic(
249
- # UUID(_BOOT_KEYBOARD_INPUT_REPORT_UUID_NUM),
250
- # properties=Characteristic.READ | Characteristic.NOTIFY,
251
- # read_perm=Attribute.ENCRYPT_NO_MITM, write_perm=Attribute.NO_ACCESS,
252
- # max_length=self._INPUT_REPORT_SIZES[self.REPORT_ID_KEYBOARD], fixed_length=True)
253
-
254
- # boot_keyboard_output_report = Characteristic(
255
- # UUID(_BOOT_KEYBOARD_OUTPUT_REPORT_UUID_NUM),
256
- # properties=(Characteristic.READ | Characteristic.WRITE |
257
- # Characteristic.WRITE_NO_RESPONSE),
258
- # read_perm=Attribute.ENCRYPT_NO_MITM, write_perm=Attribute.ENCRYPT_NO_MITM,
259
- # max_length=self._OUTPUT_REPORT_SIZES[self.REPORT_ID_KEYBOARD], fixed_length=True)
242
+ protocol_mode_char = Characteristic (
243
+ UUID (_PROTOCOL_MODE_UUID_NUM ), properties = Characteristic .READ | Characteristic .WRITE_NO_RESPONSE ,
244
+ read_perm = Attribute .OPEN , write_perm = Attribute .OPEN ,
245
+ max_length = 1 , fixed_length = True )
246
+ protocol_mode_char .value = _PROTOCOL_MODE_REPORT
247
+
248
+ boot_keyboard_input_report = Characteristic (
249
+ UUID (_BOOT_KEYBOARD_INPUT_REPORT_UUID_NUM ),
250
+ properties = Characteristic .READ | Characteristic .NOTIFY ,
251
+ read_perm = Attribute .ENCRYPT_NO_MITM , write_perm = Attribute .NO_ACCESS ,
252
+ max_length = self ._INPUT_REPORT_SIZES [self .REPORT_ID_KEYBOARD ], fixed_length = True )
253
+
254
+ boot_keyboard_output_report = Characteristic (
255
+ UUID (_BOOT_KEYBOARD_OUTPUT_REPORT_UUID_NUM ),
256
+ properties = (Characteristic .READ | Characteristic .WRITE |
257
+ Characteristic .WRITE_NO_RESPONSE ),
258
+ read_perm = Attribute .ENCRYPT_NO_MITM , write_perm = Attribute .ENCRYPT_NO_MITM ,
259
+ max_length = self ._OUTPUT_REPORT_SIZES [self .REPORT_ID_KEYBOARD ], fixed_length = True )
260
260
261
261
# This is the USB HID descriptor (not to be confused with a BLE Descriptor).
262
262
report_map_char = Characteristic (
@@ -283,9 +283,9 @@ def __init__(self, name=None, tx_power=0):
283
283
hid_service = Service (UUID (_HID_SERVICE_UUID_NUM ),
284
284
tuple (self ._input_chars .values ()) +
285
285
tuple (self ._output_chars .values ()) +
286
- (# boot_keyboard_input_report,
287
- # boot_keyboard_output_report,
288
- # protocol_mode_char,
286
+ (boot_keyboard_input_report ,
287
+ boot_keyboard_output_report ,
288
+ protocol_mode_char ,
289
289
report_map_char ,
290
290
hid_information_char ,
291
291
self ._hid_control_point_char ,
0 commit comments