Replies: 4 comments 2 replies
-
Thanks @dlech. I am not sure how to use it. I tried to add the print statement at the bottom, expecting to get a dump of a dictionary keyed by device id, but got instead 'property'. My goal is to print in the loop, for each device, a value of a specific advertisement attribute (manufacturer data). Any suggestion on how to do that? Is it even possible with the 'easy method' ? async def scan_and_dump():
print("Scanning 5 secs for advertising BLE devices ...", flush=True)
devices = await BleakScanner.discover(timeout=5)
i = 0
for device in devices:
# print(f"Metadata: {device.}", flush=True)
i += 1
# print(device, flush=True)
name = device.name or ""
print(f"{i:2} device address: {device.address} ({name})", flush=True)
print(f"Advertisement data:\n{BleakScanner.discovered_devices_and_advertisement_data}\n", flush=True) Output,
|
Beta Was this translation helpful? Give feedback.
-
Thanks @dlech, I do get it now. Is the rssi value the actual signal strength or some fixed adv data? If it is, is it available on all three platforms, Win, Linux, Mac?
|
Beta Was this translation helpful? Give feedback.
-
Very good. Thanks.
…On Tue, Apr 4, 2023 at 9:48 AM David Lechner ***@***.***> wrote:
It is the last value received. It is available on all platforms.
—
Reply to this email directly, view it on GitHub
<#1271 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQVMQMIHCMDAXZYHW2JTHLW7RGE3ANCNFSM6AAAAAAWSDDDEU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have simple code that scans for 5 secs and then prints the devices it found. I want to extend it to print some per device advertisement data. I tried device.metadata but it seems to be deprecated, with some reference to a callback which I don't use. What is the new way of doing so?
https://github.com/zapta/ble_stepper_motor_analyzer/blob/main/python/common/connections.py#L29
Beta Was this translation helpful? Give feedback.
All reactions