Cross-platform Bluetooth Low Energy GATT client library for asynchronous BLE communication
Overall
score
97%
A command-line tool for configuring BLE device characteristics by writing to their descriptors.
Connect to a BLE device and enable notifications on a characteristic by writing the appropriate value to its Client Characteristic Configuration Descriptor (CCCD).
b'\x01\x00' to the CCCD to enable notifications @testConnect to a BLE device and disable notifications on a characteristic by writing to its CCCD.
b'\x00\x00' to the CCCD to disable notifications @test@generates
async def enable_notifications(device_address: str, characteristic_uuid: str) -> None:
"""
Connect to a BLE device and enable notifications on a characteristic
by writing to its Client Characteristic Configuration Descriptor.
Args:
device_address: The Bluetooth address of the target device
characteristic_uuid: The UUID of the characteristic to enable notifications for
Raises:
ValueError: If the characteristic does not have a CCCD
BleakError: If connection or write operation fails
"""
async def disable_notifications(device_address: str, characteristic_uuid: str) -> None:
"""
Connect to a BLE device and disable notifications on a characteristic
by writing to its Client Characteristic Configuration Descriptor.
Args:
device_address: The Bluetooth address of the target device
characteristic_uuid: The UUID of the characteristic to disable notifications for
Raises:
ValueError: If the characteristic does not have a CCCD
BleakError: If connection or write operation fails
"""Provides Bluetooth Low Energy client functionality for connecting to devices and writing to GATT descriptors.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-bleakdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9