/
bdDetect.py
581 lines (528 loc) · 20.3 KB
/
bdDetect.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
#bdDetect.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2013-2017 NV Access Limited
"""Support for braille display detection.
This allows devices to be automatically detected and used when they become available,
as well as providing utilities to query for possible devices for a particular driver.
To support detection for a driver, devices need to be associated
using the C{add*} functions.
Drivers distributed with NVDA do this at the bottom of this module.
For drivers in add-ons, this must be done in a global plugin.
"""
import itertools
from collections import namedtuple, defaultdict, OrderedDict
import threading
import wx
import hwPortUtils
import braille
import winKernel
import winUser
import core
import ctypes
from logHandler import log
import config
import time
import thread
import appModuleHandler
from baseObject import AutoPropertyObject
import re
DBT_DEVNODES_CHANGED=7
_driverDevices = OrderedDict()
USB_ID_REGEX = re.compile(r"^VID_[0-9A-F]{4}&PID_[0-9A-F]{4}$", re.U)
class DeviceMatch(
namedtuple("DeviceMatch", ("type","id", "port", "deviceInfo"))
):
"""Represents a detected device.
@ivar id: The identifier of the device.
@type id: unicode
@ivar port: The port that can be used by a driver to communicate with a device.
@type port: unicode
@ivar deviceInfo: all known information about a device.
@type deviceInfo: dict
"""
__slots__ = ()
# Device type constants
#: Key constant for HID devices
KEY_HID = "hid"
#: Key for serial devices (COM ports)
KEY_SERIAL = "serial"
#: Key for devices with a manufacturer specific driver
KEY_CUSTOM = "custom"
#: Key for bluetooth devices
KEY_BLUETOOTH = "bluetooth"
# Constants for USB and bluetooth detection to be used by the background thread scanner.
DETECT_USB = 1
DETECT_BLUETOOTH = 2
def _isDebug():
return config.conf["debugLog"]["hwIo"]
def _getDriver(driver):
try:
return _driverDevices[driver]
except KeyError:
ret = _driverDevices[driver] = defaultdict(set)
return ret
def addUsbDevices(driver, type, ids):
"""Associate USB devices with a driver.
@param driver: The name of the driver.
@type driver: str
@param type: The type of the driver, either C{KEY_HID}, C{KEY_SERIAL} or C{KEY_CUSTOM}.
@type type: str
@param ids: A set of USB IDs in the form C{"VID_xxxx&PID_XXXX"}.
Note that alphabetical characters in hexadecimal numbers should be uppercase.
@type ids: set of str
@raise ValueError: When one of the provided IDs is malformed.
"""
malformedIds = [id for id in ids if not isinstance(id, basestring) or not USB_ID_REGEX.match(id)]
if malformedIds:
raise ValueError("Invalid IDs provided for driver %s, type %s: %s"
% (driver, type, ", ".join(wrongIds)))
devs = _getDriver(driver)
driverUsb = devs[type]
driverUsb.update(ids)
def addBluetoothDevices(driver, matchFunc):
"""Associate Bluetooth HID or COM ports with a driver.
@param driver: The name of the driver.
@type driver: str
@param matchFunc: A function which determines whether a given Bluetooth device matches.
It takes a L{DeviceMatch} as its only argument
and returns a C{bool} indicating whether it matched.
@type matchFunc: callable
"""
devs = _getDriver(driver)
devs[KEY_BLUETOOTH] = matchFunc
def getDriversForConnectedUsbDevices():
"""Get any matching drivers for connected USB devices.
@return: Pairs of drivers and device information.
@rtype: generator of (str, L{DeviceMatch}) tuples
"""
usbDevs = itertools.chain(
(DeviceMatch(KEY_CUSTOM, port["usbID"], port["devicePath"], port)
for port in deviceInfoFetcher.usbDevices),
(DeviceMatch(KEY_HID, port["usbID"], port["devicePath"], port)
for port in deviceInfoFetcher.hidDevices if port["provider"]=="usb"),
(DeviceMatch(KEY_SERIAL, port["usbID"], port["port"], port)
for port in deviceInfoFetcher.comPorts if "usbID" in port)
)
for match in usbDevs:
for driver, devs in _driverDevices.iteritems():
for type, ids in devs.iteritems():
if match.type==type and match.id in ids:
yield driver, match
def getDriversForPossibleBluetoothDevices():
"""Get any matching drivers for possible Bluetooth devices.
@return: Pairs of drivers and port information.
@rtype: generator of (str, L{DeviceMatch}) tuples
"""
btDevs = itertools.chain(
(DeviceMatch(KEY_SERIAL, port["bluetoothName"], port["port"], port)
for port in deviceInfoFetcher.comPorts
if "bluetoothName" in port),
(DeviceMatch(KEY_HID, port["hardwareID"], port["devicePath"], port)
for port in deviceInfoFetcher.hidDevices if port["provider"]=="bluetooth"),
)
for match in btDevs:
for driver, devs in _driverDevices.iteritems():
matchFunc = devs[KEY_BLUETOOTH]
if not callable(matchFunc):
continue
if matchFunc(match):
yield driver, match
class _DeviceInfoFetcher(AutoPropertyObject):
"""Utility class that caches fetched info for available devices for the duration of one core pump cycle."""
cachePropertiesByDefault = True
def _get_comPorts(self):
return list(hwPortUtils.listComPorts(onlyAvailable=True))
def _get_usbDevices(self):
return list(hwPortUtils.listUsbDevices(onlyAvailable=True))
def _get_hidDevices(self):
return list(hwPortUtils.listHidDevices(onlyAvailable=True))
#: The single instance of the device info fetcher.
#: @type: L{_DeviceInfoFetcher}
deviceInfoFetcher = _DeviceInfoFetcher()
class Detector(object):
"""Detector class used to automatically detect braille displays.
This should only be used by the L{braille} module.
"""
def __init__(self, usb=True, bluetooth=True, limitToDevices=None):
"""Constructor.
The keyword arguments initialize the detector in a particular state.
On an initialized instance, these initial arguments can be overridden by calling L{_startBgScan} or L{rescan}.
@param usb: Whether this instance should detect USB devices initially.
@type usb: bool
@param bluetooth: Whether this instance should detect Bluetooth devices initially.
@type bluetooth: bool
@param limitToDevices: Drivers to which detection should be limited initially.
C{None} if no driver filtering should occur.
"""
self._BgScanApc = winKernel.PAPCFUNC(self._bgScan)
self._btDevsLock = threading.Lock()
self._btDevs = None
core.post_windowMessageReceipt.register(self.handleWindowMessage)
appModuleHandler.post_appSwitch.register(self.pollBluetoothDevices)
self._stopEvent = threading.Event()
self._queuedScanLock = threading.Lock()
self._scanQueued = False
self._detectUsb = usb
self._detectBluetooth = bluetooth
self._limitToDevices = limitToDevices
self._runningApcLock = threading.Lock()
# Perform initial scan.
self._startBgScan(usb=usb, bluetooth=bluetooth, limitToDevices=limitToDevices)
@property
def _scanQueuedSafe(self):
"""Returns L{_scanQueued} in a thread safe way by using L{_queuedScanLock}."""
with self._queuedScanLock:
return self._scanQueued
@_scanQueuedSafe.setter
def _scanQueuedSafe(self, state):
"""Sets L{_scanQueued} in a thread safe way by using L{_queuedScanLock}."""
with self._queuedScanLock:
self._scanQueued = state
def _startBgScan(self, usb=False, bluetooth=False, limitToDevices=None):
"""Starts a scan for devices.
If a scan is already in progress, a new scan will be queued after the current scan.
To explicitely cancel a scan in progress, use L{rescan}.
@param usb: Whether USB devices should be detected for this and subsequent scans.
@type usb: bool
@param bluetooth: Whether Bluetooth devices should be detected for this and subsequent scans.
@type bluetooth: bool
@param limitToDevices: Drivers to which detection should be limited for this and subsequent scans.
C{None} if no driver filtering should occur.
"""
with self._queuedScanLock:
self._detectUsb = usb
self._detectBluetooth = bluetooth
self._limitToDevices = limitToDevices
if not self._scanQueued:
self._scanQueued = True
if self._runningApcLock.locked():
# There's currently a scan in progress.
# Since the scan is embeded in a loop, it will automatically do another scan,
# unless a display has been found.
return
braille._BgThread.queueApc(self._BgScanApc)
def _stopBgScan(self):
"""Stops the current scan as soon as possible and prevents a queued scan to start."""
if not self._runningApcLock.locked():
# No scan to stop
return
self._stopEvent.set()
self._scanQueuedSafe = False
def _bgScan(self, param):
if self._runningApcLock.locked():
log.debugWarning("Braille display detection background scan APC executed while one is already running")
return
with self._runningApcLock:
while self._scanQueuedSafe:
# Clear the stop event before a scan is started.
# Since a scan can take some time to complete, another thread can set the stop event to cancel it.
self._stopEvent.clear()
with self._queuedScanLock:
self._scanQueued = False
detectUsb = self._detectUsb
detectBluetooth = self._detectBluetooth
limitToDevices = self._limitToDevices
if detectUsb:
if self._stopEvent.isSet():
continue
for driver, match in getDriversForConnectedUsbDevices():
if self._stopEvent.isSet() or (self._limitToDevices and driver not in self._limitToDevices):
continue
if braille.handler.setDisplayByName(driver, detected=match):
return
if detectBluetooth:
if self._stopEvent.isSet():
continue
with self._btDevsLock:
if self._btDevs is None:
btDevs = list(getDriversForPossibleBluetoothDevices())
# Cache Bluetooth devices for next time.
btDevsCache = []
else:
btDevs = self._btDevs
btDevsCache = btDevs
for driver, match in btDevs:
if self._stopEvent.isSet() or (self._limitToDevices and driver not in self._limitToDevices):
continue
if btDevsCache is not btDevs:
btDevsCache.append((driver, match))
if braille.handler.setDisplayByName(driver, detected=match):
return
if self._stopEvent.isSet():
continue
if btDevsCache is not btDevs:
with self._btDevsLock:
self._btDevs = btDevsCache
def rescan(self, usb=True, bluetooth=True, limitToDevices=None):
"""Stop a current scan when in progress, and start scanning from scratch.
@param usb: Whether USB devices should be detected for this and subsequent scans.
@type usb: bool
@param bluetooth: Whether Bluetooth devices should be detected for this and subsequent scans.
@type bluetooth: bool
@param limitToDevices: Drivers to which detection should be limited for this and subsequent scans.
C{None} if no driver filtering should occur.
"""
self._stopBgScan()
with self._btDevsLock:
# A Bluetooth com port or HID device might have been added.
self._btDevs = None
self._startBgScan(usb=usb, bluetooth=bluetooth, limitToDevices=limitToDevices)
def handleWindowMessage(self, msg=None, wParam=None):
if msg == winUser.WM_DEVICECHANGE and wParam == DBT_DEVNODES_CHANGED:
self.rescan(bluetooth=self._detectBluetooth, limitToDevices=self._limitToDevices)
def pollBluetoothDevices(self):
"""Poll bluetooth devices that might be in range.
This does not cancel the current scan."""
if not self._detectBluetooth:
# Do not poll bluetooth devices at all when bluetooth is disabled.
return
with self._btDevsLock:
if not self._btDevs:
return
self._startBgScan(bluetooth=self._detectBluetooth, limitToDevices=self._limitToDevices)
def terminate(self):
appModuleHandler.post_appSwitch.unregister(self.pollBluetoothDevices)
core.post_windowMessageReceipt.unregister(self.handleWindowMessage)
self._stopBgScan()
def getConnectedUsbDevicesForDriver(driver):
"""Get any connected USB devices associated with a particular driver.
@param driver: The name of the driver.
@type driver: str
@return: Device information for each device.
@rtype: generator of L{DeviceMatch}
@raise LookupError: If there is no detection data for this driver.
"""
devs = _driverDevices[driver]
usbDevs = itertools.chain(
(DeviceMatch(KEY_CUSTOM, port["usbID"], port["devicePath"], port)
for port in deviceInfoFetcher.usbDevices),
(DeviceMatch(KEY_HID, port["usbID"], port["devicePath"], port)
for port in deviceInfoFetcher.hidDevices if port["provider"]=="usb"),
(DeviceMatch(KEY_SERIAL, port["usbID"], port["port"], port)
for port in deviceInfoFetcher.comPorts if "usbID" in port)
)
for match in usbDevs:
for type, ids in devs.iteritems():
if match.type==type and match.id in ids:
yield match
def getPossibleBluetoothDevicesForDriver(driver):
"""Get any possible Bluetooth devices associated with a particular driver.
@param driver: The name of the driver.
@type driver: str
@return: Port information for each port.
@rtype: generator of L{DeviceMatch}
@raise LookupError: If there is no detection data for this driver.
"""
matchFunc = _driverDevices[driver][KEY_BLUETOOTH]
if not callable(matchFunc):
return
btDevs = itertools.chain(
(DeviceMatch(KEY_SERIAL, port["bluetoothName"], port["port"], port)
for port in deviceInfoFetcher.comPorts
if "bluetoothName" in port),
(DeviceMatch(KEY_HID, port["hardwareID"], port["devicePath"], port)
for port in deviceInfoFetcher.hidDevices if port["provider"]=="bluetooth"),
)
for match in btDevs:
if matchFunc(match):
yield match
def driverHasPossibleDevices(driver):
"""Determine whether there are any possible devices associated with a given driver.
@param driver: The name of the driver.
@type driver: str
@return: C{True} if there are possible devices, C{False} otherwise.
@rtype: bool
@raise LookupError: If there is no detection data for this driver.
"""
return bool(next(itertools.chain(
getConnectedUsbDevicesForDriver(driver),
getPossibleBluetoothDevicesForDriver(driver)
), None))
def driverSupportsAutoDetection(driver):
"""Returns whether the provided driver supports automatic detection of displays.
@param driver: The name of the driver.
@type driver: str
@return: C{True} if de driver supports auto detection, C{False} otherwise.
@rtype: bool
"""
return driver in _driverDevices
### Detection data
# alva
addUsbDevices("alva", KEY_HID, {
"VID_0798&PID_0640", # BC640
"VID_0798&PID_0680", # BC680
"VID_0798&PID_0699", # USB protocol converter
})
addBluetoothDevices("alva", lambda m: m.id.startswith("ALVA "))
# baum
addUsbDevices("baum", KEY_HID, {
"VID_0904&PID_3001", # RefreshaBraille 18
"VID_0904&PID_6101", # VarioUltra 20
"VID_0904&PID_6103", # VarioUltra 32
"VID_0904&PID_6102", # VarioUltra 40
"VID_0904&PID_4004", # Pronto! 18 V3
"VID_0904&PID_4005", # Pronto! 40 V3
"VID_0904&PID_4007", # Pronto! 18 V4
"VID_0904&PID_4008", # Pronto! 40 V4
"VID_0904&PID_6001", # SuperVario2 40
"VID_0904&PID_6002", # SuperVario2 24
"VID_0904&PID_6003", # SuperVario2 32
"VID_0904&PID_6004", # SuperVario2 64
"VID_0904&PID_6005", # SuperVario2 80
"VID_0904&PID_6006", # Brailliant2 40
"VID_0904&PID_6007", # Brailliant2 24
"VID_0904&PID_6008", # Brailliant2 32
"VID_0904&PID_6009", # Brailliant2 64
"VID_0904&PID_600A", # Brailliant2 80
"VID_0904&PID_6201", # Vario 340
"VID_0483&PID_A1D3", # Orbit Reader 20
})
addUsbDevices("baum", KEY_SERIAL, {
"VID_0403&PID_FE70", # Vario 40
"VID_0403&PID_FE71", # PocketVario
"VID_0403&PID_FE72", # SuperVario/Brailliant 40
"VID_0403&PID_FE73", # SuperVario/Brailliant 32
"VID_0403&PID_FE74", # SuperVario/Brailliant 64
"VID_0403&PID_FE75", # SuperVario/Brailliant 80
"VID_0904&PID_2001", # EcoVario 24
"VID_0904&PID_2002", # EcoVario 40
"VID_0904&PID_2007", # VarioConnect/BrailleConnect 40
"VID_0904&PID_2008", # VarioConnect/BrailleConnect 32
"VID_0904&PID_2009", # VarioConnect/BrailleConnect 24
"VID_0904&PID_2010", # VarioConnect/BrailleConnect 64
"VID_0904&PID_2011", # VarioConnect/BrailleConnect 80
"VID_0904&PID_2014", # EcoVario 32
"VID_0904&PID_2015", # EcoVario 64
"VID_0904&PID_2016", # EcoVario 80
"VID_0904&PID_3000", # RefreshaBraille 18
})
addBluetoothDevices("baum", lambda m: any(m.id.startswith(prefix) for prefix in (
"Baum SuperVario",
"Baum PocketVario",
"Baum SVario",
"HWG Brailliant",
"Refreshabraille",
"VarioConnect",
"BrailleConnect",
"Pronto!",
"VarioUltra",
"Orbit Reader 20",
)))
# brailleNote
addUsbDevices("brailleNote", KEY_SERIAL, {
"VID_1C71&PID_C004", # Apex
})
addBluetoothDevices("brailleNote", lambda m:
any(first <= m.deviceInfo.get("bluetoothAddress",0) <= last for first, last in (
(0x0025EC000000, 0x0025EC01869F), # Apex
)) or m.id.startswith("Braillenote"))
# brailliantB
addUsbDevices("brailliantB", KEY_HID, {
"VID_1C71&PID_C006", # Brailliant BI 32, 40 and 80
"VID_1C71&PID_C022", # Brailliant BI 14
"VID_1C71&PID_C00A", # BrailleNote Touch
})
addUsbDevices("brailliantB", KEY_SERIAL, {
"VID_1C71&PID_C005", # Brailliant BI 32, 40 and 80
"VID_1C71&PID_C021", # Brailliant BI 14
})
addBluetoothDevices("brailliantB", lambda m: (
m.type==KEY_SERIAL
and (m.id.startswith("Brailliant B")
or m.id == "Brailliant 80"
or "BrailleNote Touch" in m.id
)) or (m.type==KEY_HID
and m.deviceInfo.get("manufacturer") == "Humanware"
and m.deviceInfo.get("product") == "Brailliant HID"
))
# eurobraille
addUsbDevices("eurobraille", KEY_HID, {
"VID_C251&PID_1122", # Esys (version < 3.0, no SD card
"VID_C251&PID_1123", # Esys (version >= 3.0, with HID keyboard, no SD card
"VID_C251&PID_1124", # Esys (version < 3.0, with SD card
"VID_C251&PID_1125", # Esys (version >= 3.0, with HID keyboard, with SD card
"VID_C251&PID_1126", # Esys (version >= 3.0, no SD card
"VID_C251&PID_1127", # Reserved
"VID_C251&PID_1128", # Esys (version >= 3.0, with SD card
"VID_C251&PID_1129", # Reserved
"VID_C251&PID_112A", # Reserved
"VID_C251&PID_112B", # Reserved
"VID_C251&PID_112C", # Reserved
"VID_C251&PID_112D", # Reserved
"VID_C251&PID_112E", # Reserved
"VID_C251&PID_112F", # Reserved
"VID_C251&PID_1130", # Esytime
"VID_C251&PID_1131", # Reserved
"VID_C251&PID_1132", # Reserved
})
addBluetoothDevices("eurobraille", lambda m: m.id.startswith("Esys"))
# freedomScientific
addUsbDevices("freedomScientific", KEY_CUSTOM, {
"VID_0F4E&PID_0100", # Focus 1
"VID_0F4E&PID_0111", # PAC Mate
"VID_0F4E&PID_0112", # Focus 2
"VID_0F4E&PID_0114", # Focus Blue
})
addBluetoothDevices("freedomScientific", lambda m: any(m.id.startswith(prefix) for prefix in (
"F14", "Focus 14 BT",
"Focus 40 BT",
"Focus 80 BT",
)))
# handyTech
addUsbDevices("handyTech", KEY_SERIAL, {
"VID_0403&PID_6001", # FTDI chip
"VID_0921&PID_1200", # GoHubs chip
})
# Newer Handy Tech displays have a native HID processor
addUsbDevices("handyTech", KEY_HID, {
"VID_1FE4&PID_0054", # Active Braille
"VID_1FE4&PID_0055", # Connect Braille
"VID_1FE4&PID_0081", # Basic Braille 16
"VID_1FE4&PID_0082", # Basic Braille 20
"VID_1FE4&PID_0083", # Basic Braille 32
"VID_1FE4&PID_0084", # Basic Braille 40
"VID_1FE4&PID_008A", # Basic Braille 48
"VID_1FE4&PID_0086", # Basic Braille 64
"VID_1FE4&PID_0087", # Basic Braille 80
"VID_1FE4&PID_008B", # Basic Braille 160
"VID_1FE4&PID_008C", # Basic Braille 84
"VID_1FE4&PID_0061", # Actilino
"VID_1FE4&PID_0064", # Active Star 40
})
# Some older HT displays use a HID converter and an internal serial interface
addUsbDevices("handyTech", KEY_HID, {
"VID_1FE4&PID_0003", # USB-HID adapter
"VID_1FE4&PID_0074", # Braille Star 40
"VID_1FE4&PID_0044", # Easy Braille
})
addBluetoothDevices("handyTech", lambda m: any(m.id.startswith(prefix) for prefix in (
"Actilino AL",
"Active Braille AB",
"Active Star AS",
"Basic Braille BB",
"Braille Star 40 BS",
"Braillino BL",
"Braille Wave BW",
"Easy Braille EBR",
)))
# hims
# Bulk devices
addUsbDevices("hims", KEY_CUSTOM, {
"VID_045E&PID_930A", # Braille Sense & Smart Beetle
"VID_045E&PID_930B", # Braille EDGE 40
})
# Sync Braille, serial device
addUsbDevices("hims", KEY_SERIAL, {
"VID_0403&PID_6001",
})
addBluetoothDevices("hims", lambda m: any(m.id.startswith(prefix) for prefix in (
"BrailleSense",
"BrailleEDGE",
"SmartBeetle",
)))
# superBrl
addUsbDevices("superBrl", KEY_SERIAL, {
"VID_10C4&PID_EA60", # SuperBraille 3.2
})