From 8e493f4e995fe7680de4191310e2d1d0029792cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Sat, 14 Mar 2026 19:57:01 +0100 Subject: [PATCH] Send BLE notifications as text --- src/helpers/esp32/BLELogInterface.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers/esp32/BLELogInterface.h b/src/helpers/esp32/BLELogInterface.h index 9ac1f414..b0347dbd 100644 --- a/src/helpers/esp32/BLELogInterface.h +++ b/src/helpers/esp32/BLELogInterface.h @@ -68,6 +68,13 @@ public: BLEService* service = _server->createService(NUS_SERVICE_UUID); _tx_char = service->createCharacteristic(NUS_TX_UUID, BLECharacteristic::PROPERTY_NOTIFY); _tx_char->addDescriptor(new BLE2902()); + + // Characteristic Presentation Format (0x2904): declare value as UTF-8 string + // Format: format(1) exponent(1) unit(2) namespace(1) description(2) + static const uint8_t utf8_format[] = { 0x19, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00 }; + BLEDescriptor* pFormat = new BLEDescriptor((uint16_t)0x2904); + pFormat->setValue(const_cast(utf8_format), sizeof(utf8_format)); + _tx_char->addDescriptor(pFormat); service->start(); BLEAdvertising* adv = BLEDevice::getAdvertising();