Add BLE host transport selectable via DIP8 alongside UART.

Master can speak the same framed protobuf protocol over NimBLE or UART; goTool gains -ble, ble-rtt, and ble-stream timing checks for ESP-NOW coexistence.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-23 16:11:10 +02:00
co-authored by Cursor
parent d7441cb85f
commit 92a13d7fd0
28 changed files with 2306 additions and 250 deletions
+10 -2
View File
@@ -1,5 +1,6 @@
#include "client_registry.h"
#include "cmd_accel_stream.h"
#include "ble_stream.h"
#include "esp_log.h"
#include "esp_now_comm.h"
#include "uart_cmd.h"
@@ -50,6 +51,10 @@ static void handle_accel_stream(const uint8_t *data, size_t len) {
}
if (req.write) {
if (req.period_ms != 0) {
ble_stream_set_period_ms(req.period_ms);
}
if (req.all_clients) {
size_t n = client_registry_set_accel_stream_all(req.enable);
uint32_t sent = 0;
@@ -65,8 +70,10 @@ static void handle_accel_stream(const uint8_t *data, size_t len) {
}
}
ESP_LOGI(TAG, "accel stream %s for %u/%u slaves",
req.enable ? "on" : "off", (unsigned)sent, (unsigned)n);
ESP_LOGI(TAG, "accel stream %s for %u/%u slaves period_ms=%lu",
req.enable ? "on" : "off", (unsigned)sent, (unsigned)n,
(unsigned long)ble_stream_period_ms());
ble_stream_update();
reply(req.enable, 0, sent > 0, sent);
return;
}
@@ -85,6 +92,7 @@ static void handle_accel_stream(const uint8_t *data, size_t len) {
}
esp_err_t err = push_stream_to_slave(client, req.enable);
ble_stream_update();
reply(req.enable, req.client_id, err == ESP_OK, err == ESP_OK ? 1u : 0u);
return;
}