FastLED 3.10.8
Loading...
Searching...
No Matches
AutoResearchBle.h
Go to the documentation of this file.
1// examples/AutoResearch/AutoResearchBle.h
2//
3// BLE autoresearch for ESP32: GATT server for JSON-RPC over BLE.
4// Used by `bash autoresearch --ble`.
5//
6// The ESP32 starts a BLE GATT server with a custom service.
7// The host Python script connects via Bleak and tests
8// bidirectional JSON-RPC communication (ping/pong).
9//
10// NOTE: BLE transport creation/destruction is handled by
11// AutoResearchRemoteControl::startBleRemote()/stopBleRemote().
12// This file provides state accessors only.
13
14#pragma once
15
16#include "fl/stl/stdint.h"
17
18// FL_IS_RP2040 / FL_IS_RP2350 for the advertising-name default below.
19#include "platforms/is_platform.h"
20
21// BLE configuration constants
22//
23// The advertising name is what a host scan matches on, so it has to name the
24// board that actually answered. It was hardcoded "FastLED-C6", which meant an
25// RP2350W advertised under a C6 name and the scan log reported the wrong chip.
26#ifndef AUTORESEARCH_BLE_DEVICE_NAME
27#if defined(FL_IS_RP2350)
28#define AUTORESEARCH_BLE_DEVICE_NAME "FastLED-RP2350"
29#elif defined(FL_IS_RP2040)
30#define AUTORESEARCH_BLE_DEVICE_NAME "FastLED-RP2040"
31#else
32#define AUTORESEARCH_BLE_DEVICE_NAME "FastLED-C6"
33#endif
34#endif
35
38 bool ble_server_active = false;
39};
40
AutoResearchBleState & getBleState()
Get current BLE autoresearch state.
State for BLE autoresearch.