mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-13 22:32:27 +00:00
Move endif
This commit is contained in:
@@ -671,16 +671,17 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
|||||||
|
|
||||||
LOG_INFO("BLE conn %u initial MTU %u (target %u)", connHandle, connInfo.getMTU(), kPreferredBleMtu);
|
LOG_INFO("BLE conn %u initial MTU %u (target %u)", connHandle, connInfo.getMTU(), kPreferredBleMtu);
|
||||||
pServer->updateConnParams(connHandle, 6, 12, 0, 200);
|
pServer->updateConnParams(connHandle, 6, 12, 0, 200);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NIMBLE_TWO
|
||||||
virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason)
|
virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason)
|
||||||
{
|
{
|
||||||
LOG_INFO("BLE disconnect reason: %d", reason);
|
LOG_INFO("BLE disconnect reason: %d", reason);
|
||||||
#else
|
#else
|
||||||
virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
|
virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
|
||||||
{
|
{
|
||||||
LOG_INFO("BLE disconnect");
|
LOG_INFO("BLE disconnect");
|
||||||
#endif
|
#endif
|
||||||
#ifdef NIMBLE_TWO
|
#ifdef NIMBLE_TWO
|
||||||
if (ble->isDeInit)
|
if (ble->isDeInit)
|
||||||
@@ -718,14 +719,14 @@ virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
|
|||||||
// Restart Advertising
|
// Restart Advertising
|
||||||
ble->startAdvertising();
|
ble->startAdvertising();
|
||||||
#else
|
#else
|
||||||
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
||||||
if (!pAdvertising->start(0)) {
|
if (!pAdvertising->start(0)) {
|
||||||
if (pAdvertising->isAdvertising()) {
|
if (pAdvertising->isAdvertising()) {
|
||||||
LOG_DEBUG("BLE advertising already running");
|
LOG_DEBUG("BLE advertising already running");
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("BLE failed to restart advertising");
|
LOG_ERROR("BLE failed to restart advertising");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user