From 4288343cb3c67aba5035fcc8cefd1cb0c2e8c093 Mon Sep 17 00:00:00 2001 From: Zach Whitehead Date: Thu, 26 Mar 2026 20:40:23 -0400 Subject: [PATCH 1/4] Remove start() calls from BLE init funcs Remove explicit service->start() calls from init functions in config_service.cpp, fastlink_service.cpp, and ota_service.cpp. Services are intended to be started elsewhere (e.g. by the server lifecycle), so dropping these calls prevents duplicate starts and potential BLE initialization/race issues. --- src/sp140/ble/config_service.cpp | 2 -- src/sp140/ble/fastlink_service.cpp | 1 - src/sp140/ble/ota_service.cpp | 1 - 3 files changed, 4 deletions(-) diff --git a/src/sp140/ble/config_service.cpp b/src/sp140/ble/config_service.cpp index 8196d25..c28a62e 100644 --- a/src/sp140/ble/config_service.cpp +++ b/src/sp140/ble/config_service.cpp @@ -370,8 +370,6 @@ void initConfigBleService(NimBLEServer* server, const std::string& uniqueId) { NimBLEUUID(DEVICE_UNIQUE_ID_UUID), kReadSecure); uniqueIdCharacteristic->setValue(uniqueId); // Already uppercase string - configService->start(); - deviceInfoService->start(); } void updateThrottleBLE(int value) { diff --git a/src/sp140/ble/fastlink_service.cpp b/src/sp140/ble/fastlink_service.cpp index cb43521..a986d68 100644 --- a/src/sp140/ble/fastlink_service.cpp +++ b/src/sp140/ble/fastlink_service.cpp @@ -224,7 +224,6 @@ void initFastLinkBleService(NimBLEServer *pServer) { kFastLinkCommandProperties); pCommandCharacteristic->setCallbacks(&commandCallbacks); - pService->start(); } void publishFastLinkTelemetry(const TelemetryHub &hub, DeviceState deviceState) { diff --git a/src/sp140/ble/ota_service.cpp b/src/sp140/ble/ota_service.cpp index 664535d..37526ce 100644 --- a/src/sp140/ble/ota_service.cpp +++ b/src/sp140/ble/ota_service.cpp @@ -368,5 +368,4 @@ void initOtaBleService(NimBLEServer* pServer) { NIMBLE_PROPERTY::NOTIFY | NIMBLE_PROPERTY::INDICATE); - pService->start(); } From e947ec5a0b1891b4d4e5234b0a56c6f59445a58b Mon Sep 17 00:00:00 2001 From: Zach Whitehead Date: Thu, 26 Mar 2026 20:43:49 -0400 Subject: [PATCH 2/4] Update diagnostics.cpp --- src/sp140/diagnostics.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/sp140/diagnostics.cpp b/src/sp140/diagnostics.cpp index 3226357..4e90936 100644 --- a/src/sp140/diagnostics.cpp +++ b/src/sp140/diagnostics.cpp @@ -88,11 +88,6 @@ uint32_t diagAgeMs(uint32_t uptime_ms, uint32_t last_run_ms) { return uptime_ms - last_run_ms; } -void zeroCoreDump(CoreDumpSummary* summary) { - if (summary == nullptr) return; - memset(summary, 0, sizeof(*summary)); -} - void zeroPacket(BootDiagPacket* packet) { if (packet == nullptr) return; memset(packet, 0, sizeof(*packet)); From 931a71228df1cc5b1676a59990cbc1c578b8ce8f Mon Sep 17 00:00:00 2001 From: Zach Whitehead Date: Thu, 26 Mar 2026 21:05:41 -0400 Subject: [PATCH 3/4] lint --- src/sp140/ble/config_service.cpp | 1 - src/sp140/ble/fastlink_service.cpp | 1 - src/sp140/ble/ota_service.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/src/sp140/ble/config_service.cpp b/src/sp140/ble/config_service.cpp index c28a62e..5175130 100644 --- a/src/sp140/ble/config_service.cpp +++ b/src/sp140/ble/config_service.cpp @@ -369,7 +369,6 @@ void initConfigBleService(NimBLEServer* server, const std::string& uniqueId) { NimBLECharacteristic* uniqueIdCharacteristic = deviceInfoService->createCharacteristic( NimBLEUUID(DEVICE_UNIQUE_ID_UUID), kReadSecure); uniqueIdCharacteristic->setValue(uniqueId); // Already uppercase string - } void updateThrottleBLE(int value) { diff --git a/src/sp140/ble/fastlink_service.cpp b/src/sp140/ble/fastlink_service.cpp index a986d68..fd61282 100644 --- a/src/sp140/ble/fastlink_service.cpp +++ b/src/sp140/ble/fastlink_service.cpp @@ -223,7 +223,6 @@ void initFastLinkBleService(NimBLEServer *pServer) { FAST_LINK_COMMAND_UUID, kFastLinkCommandProperties); pCommandCharacteristic->setCallbacks(&commandCallbacks); - } void publishFastLinkTelemetry(const TelemetryHub &hub, DeviceState deviceState) { diff --git a/src/sp140/ble/ota_service.cpp b/src/sp140/ble/ota_service.cpp index 37526ce..55a8d23 100644 --- a/src/sp140/ble/ota_service.cpp +++ b/src/sp140/ble/ota_service.cpp @@ -367,5 +367,4 @@ void initOtaBleService(NimBLEServer* pServer) { OTA_CUSTOMER_UUID, NIMBLE_PROPERTY::NOTIFY | NIMBLE_PROPERTY::INDICATE); - } From f90e64066da9798483ca8a613fb27b95005207d4 Mon Sep 17 00:00:00 2001 From: Zach Whitehead Date: Thu, 26 Mar 2026 21:35:16 -0400 Subject: [PATCH 4/4] Start BLE services after characteristic setup Call start() on BLE services after creating characteristics to ensure they become active and visible. Added service start calls in: - src/sp140/ble/config_service.cpp (configService and deviceInfoService) - src/sp140/ble/fastlink_service.cpp (pService) - src/sp140/ble/ota_service.cpp (pService) This fixes cases where characteristics were configured but the corresponding services were never started, preventing proper BLE exposure and notifications. --- src/sp140/ble/config_service.cpp | 3 +++ src/sp140/ble/fastlink_service.cpp | 2 ++ src/sp140/ble/ota_service.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/sp140/ble/config_service.cpp b/src/sp140/ble/config_service.cpp index 5175130..8196d25 100644 --- a/src/sp140/ble/config_service.cpp +++ b/src/sp140/ble/config_service.cpp @@ -369,6 +369,9 @@ void initConfigBleService(NimBLEServer* server, const std::string& uniqueId) { NimBLECharacteristic* uniqueIdCharacteristic = deviceInfoService->createCharacteristic( NimBLEUUID(DEVICE_UNIQUE_ID_UUID), kReadSecure); uniqueIdCharacteristic->setValue(uniqueId); // Already uppercase string + + configService->start(); + deviceInfoService->start(); } void updateThrottleBLE(int value) { diff --git a/src/sp140/ble/fastlink_service.cpp b/src/sp140/ble/fastlink_service.cpp index fd61282..cb43521 100644 --- a/src/sp140/ble/fastlink_service.cpp +++ b/src/sp140/ble/fastlink_service.cpp @@ -223,6 +223,8 @@ void initFastLinkBleService(NimBLEServer *pServer) { FAST_LINK_COMMAND_UUID, kFastLinkCommandProperties); pCommandCharacteristic->setCallbacks(&commandCallbacks); + + pService->start(); } void publishFastLinkTelemetry(const TelemetryHub &hub, DeviceState deviceState) { diff --git a/src/sp140/ble/ota_service.cpp b/src/sp140/ble/ota_service.cpp index 55a8d23..664535d 100644 --- a/src/sp140/ble/ota_service.cpp +++ b/src/sp140/ble/ota_service.cpp @@ -367,4 +367,6 @@ void initOtaBleService(NimBLEServer* pServer) { OTA_CUSTOMER_UUID, NIMBLE_PROPERTY::NOTIFY | NIMBLE_PROPERTY::INDICATE); + + pService->start(); }