or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/bleak@1.1.x
tile.json

tessl/pypi-bleak

tessl install tessl/pypi-bleak@1.1.0

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

Agent Success

Agent success rate when using this tile

97%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.07x

Baseline

Agent success rate without this tile

91%

task.mdevals/scenario-6/

BLE Characteristic Capability Analyzer

Build a utility that analyzes BLE device characteristics and reports their supported operations.

Task

Create a module that connects to a BLE device and analyzes all characteristics across all services to determine which operations each characteristic supports. The module should produce a structured report showing which characteristics support reading, writing (with or without response), notifications, indications, and other operations.

Requirements

Your solution should:

  1. Accept a BLE device address as input
  2. Connect to the device and discover all services and characteristics
  3. For each characteristic, determine which operations are supported by inspecting its properties
  4. Categorize characteristics by their supported operations:
    • Readable characteristics (support read operations)
    • Writable characteristics (support write with response)
    • Writable without response characteristics (support write without response)
    • Notifiable characteristics (support notifications)
    • Indicatable characteristics (support indications)
  5. Generate a report dictionary with the device address and categorized characteristics
  6. Each characteristic in the report should include its UUID and the service UUID it belongs to
  7. Handle the connection lifecycle properly (connect and disconnect)

Output Format

The analyzer should return a dictionary with this structure:

{
    "device_address": "AA:BB:CC:DD:EE:FF",
    "characteristics": {
        "readable": [
            {"service_uuid": "0000180f-...", "char_uuid": "00002a19-..."},
            ...
        ],
        "writable": [...],
        "writable_without_response": [...],
        "notifiable": [...],
        "indicatable": [...]
    }
}

Test Cases

  • Given a device with a Battery Service characteristic (readable), the analyzer correctly identifies it as readable @test
  • Given a device with a characteristic supporting both notify and indicate, the analyzer includes it in both categories @test
  • Given a device with a writable characteristic, the analyzer correctly identifies it as writable @test

Implementation

@generates

API

async def analyze_characteristics(device_address: str) -> dict:
    """
    Analyze a BLE device's characteristics and categorize them by supported operations.

    Args:
        device_address: The Bluetooth address of the device to analyze

    Returns:
        A dictionary containing the device address and categorized characteristics

    Raises:
        Exception: If unable to connect to the device or discover services
    """
    pass

Dependencies { .dependencies }

bleak { .dependency }

Provides BLE client functionality for connecting to devices, discovering services and characteristics, and inspecting characteristic properties.

@satisfied-by