base: ignore anything not from the known vendor IDs
We don't want to accidentally start talking to a device and brick it.
This commit is contained in:
parent
deb2c3ad2f
commit
e1a3675439
12
tuhi/base.py
12
tuhi/base.py
|
@ -333,9 +333,6 @@ class Tuhi(GObject.Object):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _device_in_register_mode(cls, bluez_device):
|
def _device_in_register_mode(cls, bluez_device):
|
||||||
if bluez_device.vendor_id not in WACOM_COMPANY_IDS:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# When the device is in register mode (blue light blinking), the
|
# When the device is in register mode (blue light blinking), the
|
||||||
# manufacturer is merely 4 bytes. This will reset to 7 bytes even
|
# manufacturer is merely 4 bytes. This will reset to 7 bytes even
|
||||||
# when the device simply times out and does not register fully.
|
# when the device simply times out and does not register fully.
|
||||||
|
@ -368,16 +365,17 @@ class Tuhi(GObject.Object):
|
||||||
stage.
|
stage.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
uuid = None
|
# We have a reverse-engineered protocol. Let's not talk to anyone
|
||||||
|
# who doesn't look like we know them to avoid potentially bricking a
|
||||||
|
# device.
|
||||||
|
if bluez_device.vendor_id not in WACOM_COMPANY_IDS:
|
||||||
|
return
|
||||||
|
|
||||||
# check if the device is already known to us
|
# check if the device is already known to us
|
||||||
try:
|
try:
|
||||||
config = self.config.devices[bluez_device.address]
|
config = self.config.devices[bluez_device.address]
|
||||||
uuid = config['uuid']
|
uuid = config['uuid']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
|
||||||
|
|
||||||
if uuid is None and bluez_device.vendor_id not in WACOM_COMPANY_IDS:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# if we got here from a currently live BlueZ device,
|
# if we got here from a currently live BlueZ device,
|
||||||
|
|
Loading…
Reference in New Issue