New new BLE logging characteristic with LogRecord protos (#4220)

* New UUID

* New log radio characteristic with LogRecord protobuf

* LogRecord

* Merge derp

* How did you get there

* Trunk

* Fix length

* Remove assert
This commit is contained in:
Ben Meadors
2024-07-03 16:29:07 -05:00
committed by GitHub
parent 10b157a38d
commit 9c46bdad1a
7 changed files with 51 additions and 19 deletions

View File

@@ -219,7 +219,6 @@ void NimbleBluetooth::setupService()
logRadioCharacteristic = bleService->createCharacteristic(
LOGRADIO_UUID,
NIMBLE_PROPERTY::NOTIFY | NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::READ_AUTHEN | NIMBLE_PROPERTY::READ_ENC, 512U);
logRadioCharacteristic->setValue("Init");
}
bluetoothPhoneAPI = new BluetoothPhoneAPI();
@@ -268,12 +267,12 @@ void NimbleBluetooth::clearBonds()
NimBLEDevice::deleteAllBonds();
}
void NimbleBluetooth::sendLog(const char *logMessage)
void NimbleBluetooth::sendLog(const uint8_t *logMessage, size_t length)
{
if (!bleServer || !isConnected() || strlen(logMessage) > 512) {
if (!bleServer || !isConnected() || length > 512) {
return;
}
logRadioCharacteristic->notify(reinterpret_cast<const uint8_t *>(logMessage), strlen(logMessage), true);
logRadioCharacteristic->notify(logMessage, length, true);
}
void clearNVS()