UART-controlled ESP32 peripheral for automated E2E Bluetooth testing. Dual-mode (Classic BT + BLE) via Bluedroid on original ESP32. Firmware (ESP-IDF v5.x, 2511 lines C): - NDJSON protocol over UART1 (115200 baud) - System commands: ping, reset, get_info, get_status - Classic BT: GAP, SPP, all 4 SSP pairing modes - BLE: GATTS, advertising, GATT service/characteristic management - 6 device personas: headset, speaker, keyboard, sensor, phone, bare - Event reporter: thread-safe async event queue to host Python MCP server (FastMCP, 1626 lines): - Async serial client with command/response correlation - Event queue with wait_for pattern matching - Tools: connection, configure, classic, ble, persona, events - MCP resources: esp32://status, esp32://events, esp32://personas Tests: 74 unit tests passing, 5 integration test stubs (skip without hardware)
20 lines
650 B
C
20 lines
650 B
C
/*
|
|
* bt_classic.h -- Classic Bluetooth GAP/SSP + SPP peripheral.
|
|
*/
|
|
|
|
#pragma once
|
|
#include "cJSON.h"
|
|
|
|
void bt_classic_init(void);
|
|
|
|
/* Command handlers (dispatched from cmd_dispatcher) */
|
|
void cmd_classic_enable(const char *id, cJSON *params);
|
|
void cmd_classic_disable(const char *id, cJSON *params);
|
|
void cmd_classic_set_discoverable(const char *id, cJSON *params);
|
|
void cmd_classic_pair_respond(const char *id, cJSON *params);
|
|
void cmd_classic_set_ssp_mode(const char *id, cJSON *params);
|
|
|
|
/* Called by configure command to set IO capabilities */
|
|
void bt_classic_set_io_cap(const char *io_cap_str);
|
|
void bt_classic_set_device_class(uint32_t cod);
|