CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-bleak

Cross-platform Bluetooth Low Energy GATT client library for asynchronous BLE communication

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-7/

BLE Device Configuration Reader

A utility that connects to a Bluetooth Low Energy device and reads configuration metadata from GATT descriptors.

Capabilities

Connect to BLE Device

  • Connects to a BLE device using a provided address and retrieves all available services @test

Read Characteristic Descriptors

  • Reads all descriptors for a given characteristic UUID and returns their values as a dictionary mapping descriptor UUIDs to their byte values @test
  • Returns an empty dictionary when a characteristic has no descriptors @test
  • Raises an appropriate error when the characteristic UUID does not exist on the device @test

Implementation

@generates

API

from typing import Dict

async def read_characteristic_descriptors(device_address: str, characteristic_uuid: str) -> Dict[str, bytes]:
    """
    Connects to a BLE device and reads all descriptors for a specified characteristic.

    Args:
        device_address: The Bluetooth address of the device to connect to
        characteristic_uuid: The UUID of the characteristic whose descriptors to read

    Returns:
        A dictionary mapping descriptor UUIDs (as strings) to their values (as bytes)

    Raises:
        BleakError: If connection fails or characteristic is not found
    """
    pass

Dependencies { .dependencies }

bleak { .dependency }

Provides Bluetooth Low Energy GATT client functionality for device connection and descriptor reading.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-bleak

tile.json