Skip to content

Commit

Permalink
alvaBC6 driver: Support auto-detection.
Browse files Browse the repository at this point in the history
The ALVA library still scans for devices itself at this stage, so it's slower than it could be. It should be possible to improve this in future.
  • Loading branch information
jcsteh committed Dec 24, 2013
1 parent 6b7b602 commit 2494d9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions source/bdDetect.py
Expand Up @@ -215,6 +215,12 @@ def arePossibleDevicesForDriver(driver):
return False

### Detection data
# alvaBC6
addUsbDevices("alvaBC6", {
"VID_0798&PID_0640", # BC640
"VID_0798&PID_0680", # BC680
})
addBluetoothComPorts("alvaBC6", lambda m: m.name.startswith("ALVA "))
# baum
addUsbDevices("baum", {
"VID_0403&PID_FE70", # Vario 40
Expand Down
7 changes: 4 additions & 3 deletions source/brailleDisplayDrivers/alvaBC6.py
Expand Up @@ -2,7 +2,7 @@
#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) 2009-2011 Optelec B.V. <http://www.optelec.com/>, James Teh <jamie@jantrid.net>
#Copyright (C) 2009-2013 Optelec B.V., NV Access Limited

import braille
import queueHandler
Expand All @@ -12,6 +12,7 @@
import time
import config
import inputCore
import bdDetect

ALVA_RELEASE_MASK = 0x8000

Expand Down Expand Up @@ -46,9 +47,9 @@ class BrailleDisplayDriver(braille.BrailleDisplayDriver):

@classmethod
def check(cls):
return bool(AlvaLib)
return bool(AlvaLib) and bdDetect.arePossibleDevicesForDriver(cls.name)

def __init__(self):
def __init__(self, port=None):
super(BrailleDisplayDriver,self).__init__()
log.debug("ALVA BC6xx Braille init")
_AlvaNumDevices=c_int(0)
Expand Down

0 comments on commit 2494d9c

Please sign in to comment.