unify activity detection in PhoneAPI, turn off BLE API while serial API in use

This commit is contained in:
geeksville
2020-06-08 16:06:59 -07:00
parent 4919129bbc
commit 7473a6c27a
8 changed files with 53 additions and 50 deletions

View File

@@ -1,5 +1,6 @@
#include "SerialConsole.h"
#include "configuration.h"
#include "target_specific.h"
#include <Arduino.h>
#define Port Serial
@@ -34,4 +35,10 @@ void SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
canWrite = true;
StreamAPI::handleToRadio(buf, len);
}
/// Hookable to find out when connection changes
void SerialConsole::onConnectionChanged(bool connected)
{
setBluetoothEnable(!connected); // To prevent user confusion, turn off bluetooth while using the serial port api
}