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
|
Releases
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Release 0.2.5
|
||||||
|
|
||||||
|
* Fixed handling of multiple UUIDs for LEGO Boost
|
||||||
|
|
||||||
Release 0.2.4
|
Release 0.2.4
|
||||||
|
|
||||||
* Added -s option to specify BLE scan duration
|
* Added -s option to specify BLE scan duration
|
||||||
|
@@ -453,12 +453,14 @@ class BLESession(Session):
|
|||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def _get_dev_uuid(self, dev):
|
def _get_dev_uuids(self, dev):
|
||||||
for adtype in self.SERVICE_CLASS_UUID_ADTYPES:
|
for adtype in self.SERVICE_CLASS_UUID_ADTYPES:
|
||||||
service_class_uuid = dev.getValueText(adtype)
|
service_class_uuids = dev.getValue(adtype)
|
||||||
if service_class_uuid:
|
if service_class_uuids:
|
||||||
logger.debug(self.SERVICE_CLASS_UUID_ADTYPES[adtype])
|
for u in service_class_uuids:
|
||||||
return UUID(service_class_uuid)
|
a = self.SERVICE_CLASS_UUID_ADTYPES[adtype]
|
||||||
|
logger.debug(f"service class uuid for {a}/{adtype}: {u}")
|
||||||
|
return service_class_uuids
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def matches(self, dev, filters):
|
def matches(self, dev, filters):
|
||||||
@@ -471,15 +473,16 @@ class BLESession(Session):
|
|||||||
for s in f['services']:
|
for s in f['services']:
|
||||||
logger.debug(f"service to check: {s}")
|
logger.debug(f"service to check: {s}")
|
||||||
given_uuid = s
|
given_uuid = s
|
||||||
logger.debug(f"given: {given_uuid}")
|
logger.debug(f"given UUID: {given_uuid} hash={UUID(given_uuid).__hash__()}")
|
||||||
dev_uuid = self._get_dev_uuid(dev)
|
dev_uuids = self._get_dev_uuids(dev)
|
||||||
if not dev_uuid:
|
if not dev_uuids:
|
||||||
continue
|
continue
|
||||||
logger.debug(f"dev: {dev_uuid}")
|
for u in dev_uuids:
|
||||||
logger.debug(given_uuid == dev_uuid)
|
logger.debug(f"dev UUID: {u} hash={u.__hash__()}")
|
||||||
if given_uuid == dev_uuid:
|
logger.debug(given_uuid == u)
|
||||||
logger.debug("match...")
|
if given_uuid == u:
|
||||||
return True
|
logger.debug("match...")
|
||||||
|
return True
|
||||||
if 'namePrefix' in f:
|
if 'namePrefix' in f:
|
||||||
# 0x08: Shortened Local Name
|
# 0x08: Shortened Local Name
|
||||||
deviceName = dev.getValueText(0x08)
|
deviceName = dev.getValueText(0x08)
|
||||||
|
2
setup.py
2
setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="pyscrlink",
|
name="pyscrlink",
|
||||||
version="0.2.4",
|
version="0.2.5",
|
||||||
author="Shin'ichiro Kawasaki",
|
author="Shin'ichiro Kawasaki",
|
||||||
author_email='kawasaki@juno.dti.ne.jp',
|
author_email='kawasaki@juno.dti.ne.jp',
|
||||||
description='Scratch-link for Linux with Python',
|
description='Scratch-link for Linux with Python',
|
||||||
|
Reference in New Issue
Block a user