ble_read_write_characteristic
Read or write a BLE GATT characteristic on a peripheral by address and UUID, with optional payload encoding, response mode, and read-back verification.
Instructions
Read from and/or write to a GATT Characteristic on a BLE peripheral.
Args: address: BLE MAC address or UUID of the target board/sensor. characteristic_uuid: UUID of the GATT characteristic to read/write. write_data: Optional payload to write. If None, performs a read-only operation. encoding: 'utf-8', 'ascii', or 'hex' (e.g. '01 FF 0A') when writing data. read_after_write: Whether to read the characteristic value back after writing. with_response: Request GATT write-with-response (True) or write-without-response (False). timeout_sec: Connection timeout in seconds (default 10.0).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | ||
| encoding | No | utf-8 | |
| write_data | No | ||
| timeout_sec | No | ||
| with_response | No | ||
| read_after_write | No | ||
| characteristic_uuid | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||