mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 10:19:59 +00:00
fix nrf52 build
This commit is contained in:
parent
19ee911022
commit
80e4bc6289
@ -21,6 +21,8 @@ static BLEDfu bledfu; // DFU software update helper service
|
||||
static uint8_t fromRadioBytes[FromRadio_size];
|
||||
static uint8_t toRadioBytes[ToRadio_size];
|
||||
|
||||
static bool bleConnected;
|
||||
|
||||
class BluetoothPhoneAPI : public PhoneAPI
|
||||
{
|
||||
/**
|
||||
@ -33,6 +35,11 @@ class BluetoothPhoneAPI : public PhoneAPI
|
||||
DEBUG_MSG("BLE notify fromNum\n");
|
||||
fromNum.notify32(fromRadioNum);
|
||||
}
|
||||
|
||||
/// Check the current underlying physical link to see if the client is currently connected
|
||||
virtual bool checkIsConnected() {
|
||||
return bleConnected;
|
||||
}
|
||||
};
|
||||
|
||||
static BluetoothPhoneAPI *bluetoothPhoneAPI;
|
||||
@ -46,6 +53,7 @@ void connect_callback(uint16_t conn_handle)
|
||||
connection->getPeerName(central_name, sizeof(central_name));
|
||||
|
||||
DEBUG_MSG("BLE Connected to %s\n", central_name);
|
||||
bleConnected = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,7 +63,8 @@ void connect_callback(uint16_t conn_handle)
|
||||
*/
|
||||
void disconnect_callback(uint16_t conn_handle, uint8_t reason)
|
||||
{
|
||||
(void)conn_handle;
|
||||
// FIXME - we currently assume only one active connection
|
||||
bleConnected = false;
|
||||
|
||||
DEBUG_MSG("BLE Disconnected, reason = 0x%x\n", reason);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user