mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 11:10:52 +00:00
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:
@@ -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()
|
||||
|
||||
@@ -11,7 +11,7 @@ class NimbleBluetooth : BluetoothApi
|
||||
bool isActive();
|
||||
bool isConnected();
|
||||
int getRssi();
|
||||
void sendLog(const char *logMessage);
|
||||
void sendLog(const uint8_t *logMessage, size_t length);
|
||||
|
||||
private:
|
||||
void setupService();
|
||||
|
||||
Reference in New Issue
Block a user