mirror of
https://github.com/kawasaki/pyscrlink.git
synced 2025-09-06 17:50:20 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
dc2ee5a22f | ||
|
caa344ecbb | ||
|
0f9ccd3b63 |
@@ -170,6 +170,15 @@ Please file issues to [GitHub issue tracker](https://github.com/kawasaki/pyscrli
|
|||||||
Releases
|
Releases
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Release 0.2.8
|
||||||
|
|
||||||
|
* Supported Microbit More v2
|
||||||
|
|
||||||
|
Release 0.2.7
|
||||||
|
|
||||||
|
* Supported Snap Firefox and Chromium
|
||||||
|
* Added -r option to retry BLE scan
|
||||||
|
|
||||||
Release 0.2.6
|
Release 0.2.6
|
||||||
|
|
||||||
* Removed Bluetooth Classic and LEGO Mindstorm EV3 support
|
* Removed Bluetooth Classic and LEGO Mindstorm EV3 support
|
||||||
|
@@ -18,7 +18,7 @@ import traceback
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# for BLESession (e.g. BBC micro:bit)
|
# for BLESession (e.g. BBC micro:bit)
|
||||||
from bluepy.btle import Scanner, UUID, Peripheral, DefaultDelegate
|
from bluepy.btle import Scanner, UUID, Peripheral, DefaultDelegate, ScanEntry
|
||||||
from bluepy.btle import BTLEDisconnectError, BTLEManagementError
|
from bluepy.btle import BTLEDisconnectError, BTLEManagementError
|
||||||
from pyscrlink import bluepy_helper_cap
|
from pyscrlink import bluepy_helper_cap
|
||||||
|
|
||||||
@@ -292,15 +292,19 @@ class BLESession(Session):
|
|||||||
logger.debug("match...")
|
logger.debug("match...")
|
||||||
return True
|
return True
|
||||||
if 'namePrefix' in f:
|
if 'namePrefix' in f:
|
||||||
# 0x08: Shortened Local Name
|
logger.debug(f"given namePrefix: {f['namePrefix']}")
|
||||||
deviceName = dev.getValueText(0x08)
|
deviceName = dev.getValueText(ScanEntry.SHORT_LOCAL_NAME)
|
||||||
if not deviceName:
|
if deviceName:
|
||||||
continue
|
logger.debug(f"SHORT_LOCAL_NAME: {deviceName}")
|
||||||
logger.debug(f"Name of \"{deviceName}\" begins with: \"{f['namePrefix']}\"?")
|
if deviceName.startswith(f['namePrefix']):
|
||||||
if(deviceName.startswith(f['namePrefix'])):
|
logger.debug(f"match...")
|
||||||
logger.debug("Yes")
|
return True
|
||||||
|
deviceName = dev.getValueText(ScanEntry.COMPLETE_LOCAL_NAME)
|
||||||
|
if deviceName:
|
||||||
|
logger.debug(f"COMPLETE_LOCAL_NAME: {deviceName}")
|
||||||
|
if deviceName.startswith(f['namePrefix']):
|
||||||
|
logger.debug(f"match...")
|
||||||
return True
|
return True
|
||||||
logger.debug("No")
|
|
||||||
if 'name' in f or 'manufactureData' in f:
|
if 'name' in f or 'manufactureData' in f:
|
||||||
logger.error("name/manufactureData filters not implemented")
|
logger.error("name/manufactureData filters not implemented")
|
||||||
# TODO: implement other filters defined:
|
# TODO: implement other filters defined:
|
||||||
|
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.6",
|
version="0.2.8",
|
||||||
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