CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; ESP32-S3-DevKitC-1-N8R2 with ESP32S3
Code/REPL
import _bleio
import binascii
import time
print('start-----------------------------------')
my_entry = None
for entry in _bleio.adapter.start_scan(timeout=3):
# endswith b'\xc0' is for d40
if binascii.hexlify(entry.address.address_bytes).endswith(b'c0'):
print(binascii.hexlify(entry.address.address_bytes), entry.address, entry.rssi, entry.connectable)
my_entry = entry
break
# connect to d40
if not my_entry:
raise Exception('no d40 found')
connection = _bleio.adapter.connect(my_entry.address, timeout=5)
print('connection', connection.connected, connection.paired)
services = connection.discover_remote_services(service_uuids_whitelist=[_bleio.UUID(0x1800)])
time.sleep(1)
print('services', services, len(services))
for s in services:
time.sleep(1)
print('s', s.characteristics)
for c in s.characteristics:
time.sleep(1)
if c.properties == _bleio.Characteristic.INDICATE:
print('indicate',c)
elif c.properties == _bleio.Characteristic.NOTIFY:
print('notify',c)
elif c.properties == _bleio.Characteristic.READ:
time.sleep(1)
print('read',c, c.uuid, c.descriptors)
else:
print('c', c, c.uuid, c.properties)
connection.disconnect()
print('end-----------------------------------')
Behavior
start-----------------------------------
b'b68804da26c0'
-56 True
connection True False
services (Service(UUID(0x1800)),) 1
s (Characteristic(UUID(0x2a00)),)
Traceback (most recent call last):
File "", line 35, in
AttributeError: 'Characteristic' object has no attribute 'descriptors'
Description
In document, there should be descriptors under _bleio.Characteristic.
But I got an error message, "AttributeError: 'Characteristic' object has no attribute 'descriptors'".
Additional information
No response
CircuitPython version
Code/REPL
Behavior
start-----------------------------------
-56 Trueb'b68804da26c0'
connection True False
services (Service(UUID(0x1800)),) 1
s (Characteristic(UUID(0x2a00)),)
Traceback (most recent call last):
File "", line 35, in
AttributeError: 'Characteristic' object has no attribute 'descriptors'
Description
In document, there should be descriptors under _bleio.Characteristic.
But I got an error message, "AttributeError: 'Characteristic' object has no attribute 'descriptors'".
Additional information
No response