mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
NimBLE enhanced logging (do not merge) (#1629)
* Change log level to debug * Don't reinit active bluetooth services * Chmod +x before zip and adding to release
This commit is contained in:
@@ -56,7 +56,8 @@ class ESP32BluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
||||
}
|
||||
};
|
||||
|
||||
class ESP32BluetoothFromRadioCallback : public NimBLECharacteristicCallbacks {
|
||||
class ESP32BluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
virtual void onRead(NimBLECharacteristic *pCharacteristic) {
|
||||
DEBUG_MSG("From Radio onread\n");
|
||||
uint8_t fromRadioBytes[FromRadio_size];
|
||||
@@ -91,7 +92,8 @@ class ESP32BluetoothServerCallback : public NimBLEServerCallbacks
|
||||
return passkey;
|
||||
}
|
||||
|
||||
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc) {
|
||||
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc)
|
||||
{
|
||||
DEBUG_MSG("BLE authentication complete\n");
|
||||
|
||||
if (passkeyShowing) {
|
||||
@@ -100,7 +102,8 @@ class ESP32BluetoothServerCallback : public NimBLEServerCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
virtual void onDisconnect(NimBLEServer* pServer, ble_gap_conn_desc *desc) {
|
||||
virtual void onDisconnect(NimBLEServer* pServer, ble_gap_conn_desc *desc)
|
||||
{
|
||||
DEBUG_MSG("BLE disconnect\n");
|
||||
}
|
||||
};
|
||||
@@ -118,6 +121,12 @@ void ESP32Bluetooth::shutdown()
|
||||
pAdvertising->stop();
|
||||
}
|
||||
|
||||
bool ESP32Bluetooth::isActive()
|
||||
{
|
||||
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
||||
return bleServer && (bleServer->getConnectedCount() > 0 || pAdvertising->isAdvertising());
|
||||
}
|
||||
|
||||
void ESP32Bluetooth::setup()
|
||||
{
|
||||
DEBUG_MSG("Initialise the ESP32 bluetooth module\n");
|
||||
|
||||
Reference in New Issue
Block a user