mirror of
https://github.com/kawasaki/pyscrlink.git
synced 2025-09-05 01:00:23 +02:00
BLESession.handle_request: Simplify Peripheral constructor call
Passing the device variable itself into Peripheral() will give the addr, addrType and the iface to the Peripheral().
This commit is contained in:
committed by
Shin'ichiro Kawasaki
parent
e281543cb8
commit
3a68a0109e
@@ -549,8 +549,7 @@ class BLESession(Session):
|
||||
self.device = self.found_devices[params['peripheralId']]
|
||||
self.deviceName = self.device.getValueText(0x9) or self.device.getValueText(0x8)
|
||||
try:
|
||||
self.perip = Peripheral(self.device.addr,
|
||||
self.device.addrType)
|
||||
self.perip = Peripheral(self.device)
|
||||
logger.info(f"connected to the BLE peripheral: {self.deviceName}")
|
||||
except BTLEDisconnectError as e:
|
||||
logger.error(f"failed to connect to the BLE device \"{self.deviceName}\": {e}")
|
||||
|
Reference in New Issue
Block a user