mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
NRF52 bluetooth cleanup and fix (#3328)
* NRF52 bluetooth cleanup. Fixes BLE not returning after serial PhoneAPI connection * Use new var name in esp32 arch
This commit is contained in:
@@ -210,8 +210,10 @@ void NRF52Bluetooth::shutdown()
|
||||
{
|
||||
// Shutdown bluetooth for minimum power draw
|
||||
LOG_INFO("Disable NRF52 bluetooth\n");
|
||||
if (connectionHandle != 0) {
|
||||
Bluefruit.disconnect(connectionHandle);
|
||||
}
|
||||
Bluefruit.Advertising.stop();
|
||||
Bluefruit.setTxPower(0); // Minimum power
|
||||
}
|
||||
|
||||
bool NRF52Bluetooth::isConnected()
|
||||
@@ -289,6 +291,14 @@ void NRF52Bluetooth::setup()
|
||||
}
|
||||
}
|
||||
|
||||
void NRF52Bluetooth::resumeAdverising()
|
||||
{
|
||||
Bluefruit.Advertising.restartOnDisconnect(true);
|
||||
Bluefruit.Advertising.setInterval(32, 244); // in unit of 0.625 ms
|
||||
Bluefruit.Advertising.setFastTimeout(30); // number of seconds in fast mode
|
||||
Bluefruit.Advertising.start(0);
|
||||
}
|
||||
|
||||
/// Given a level between 0-100, update the BLE attribute
|
||||
void updateBatteryLevel(uint8_t level)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user