mirror of
https://github.com/kawasaki/pyscrlink.git
synced 2025-09-06 17:50:20 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7cc9ccac2e | ||
|
4558ea43df | ||
|
641b84a86e |
@@ -206,6 +206,10 @@ Please file issues to [GitHub issue tracker](https://github.com/kawasaki/pyscrli
|
||||
Releases
|
||||
--------
|
||||
|
||||
Release 0.2.5
|
||||
|
||||
* Fixed handling of multiple UUIDs for LEGO Boost
|
||||
|
||||
Release 0.2.4
|
||||
|
||||
* Added -s option to specify BLE scan duration
|
||||
|
@@ -453,12 +453,14 @@ class BLESession(Session):
|
||||
def __del__(self):
|
||||
self.close()
|
||||
|
||||
def _get_dev_uuid(self, dev):
|
||||
def _get_dev_uuids(self, dev):
|
||||
for adtype in self.SERVICE_CLASS_UUID_ADTYPES:
|
||||
service_class_uuid = dev.getValueText(adtype)
|
||||
if service_class_uuid:
|
||||
logger.debug(self.SERVICE_CLASS_UUID_ADTYPES[adtype])
|
||||
return UUID(service_class_uuid)
|
||||
service_class_uuids = dev.getValue(adtype)
|
||||
if service_class_uuids:
|
||||
for u in service_class_uuids:
|
||||
a = self.SERVICE_CLASS_UUID_ADTYPES[adtype]
|
||||
logger.debug(f"service class uuid for {a}/{adtype}: {u}")
|
||||
return service_class_uuids
|
||||
return None
|
||||
|
||||
def matches(self, dev, filters):
|
||||
@@ -471,13 +473,14 @@ class BLESession(Session):
|
||||
for s in f['services']:
|
||||
logger.debug(f"service to check: {s}")
|
||||
given_uuid = s
|
||||
logger.debug(f"given: {given_uuid}")
|
||||
dev_uuid = self._get_dev_uuid(dev)
|
||||
if not dev_uuid:
|
||||
logger.debug(f"given UUID: {given_uuid} hash={UUID(given_uuid).__hash__()}")
|
||||
dev_uuids = self._get_dev_uuids(dev)
|
||||
if not dev_uuids:
|
||||
continue
|
||||
logger.debug(f"dev: {dev_uuid}")
|
||||
logger.debug(given_uuid == dev_uuid)
|
||||
if given_uuid == dev_uuid:
|
||||
for u in dev_uuids:
|
||||
logger.debug(f"dev UUID: {u} hash={u.__hash__()}")
|
||||
logger.debug(given_uuid == u)
|
||||
if given_uuid == u:
|
||||
logger.debug("match...")
|
||||
return True
|
||||
if 'namePrefix' in f:
|
||||
|
Reference in New Issue
Block a user