diff options
| author | James A. Jerkins <evergreen@jamesjerkinscomputer.com> | 2021-12-24 02:30:14 (GMT) |
|---|---|---|
| committer | James A. Jerkins <evergreen@jamesjerkinscomputer.com> | 2021-12-24 02:30:14 (GMT) |
| commit | 319030d9e16e833cf8bff569a9ecfa452165ea27 (patch) | |
| tree | ae2890204710ac41fd7f637ac1c367c09f671009 /src/components/ble/BleController.h | |
| parent | 3b0b48020d96353fc6cd114aa80fc2fec98363a3 (diff) | |
Add airplane mode feature
Implements 'Airplane mode' feature to disable and enable bluetooth/ble
Adds airplaneMode as a non-persisted setting
Adds a setting menu for switching airplane mode on and off
Displays an airplane symbol on the Digital watch face and the
PineTimeStyle watch face when airplane mode is enabled
Always enables bluetooth/ble on boot (disable airplane mode)
Alphabetizes the settings menu options
Style cleanups
Closes #632
Diffstat (limited to 'src/components/ble/BleController.h')
| -rw-r--r-- | src/components/ble/BleController.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/ble/BleController.h b/src/components/ble/BleController.h index 72b8766..2714c0c 100644 --- a/src/components/ble/BleController.h +++ b/src/components/ble/BleController.h @@ -10,13 +10,14 @@ namespace Pinetime { using BleAddress = std::array<uint8_t, 6>; enum class FirmwareUpdateStates { Idle, Running, Validated, Error }; enum class AddressTypes { Public, Random, RPA_Public, RPA_Random }; + enum class ConnectStates { Disconnected, Connected, Airplane }; Ble() = default; bool IsConnected() const { - return isConnected; + return (connectionState == ConnectStates::Connected); } - void Connect(); - void Disconnect(); + void SetConnectState(ConnectStates newState); + ConnectStates GetConnectState() const; void StartFirmwareUpdate(); void StopFirmwareUpdate(); @@ -56,7 +57,7 @@ namespace Pinetime { } private: - bool isConnected = false; + ConnectStates connectionState = ConnectStates::Disconnected; bool isFirmwareUpdating = false; uint32_t firmwareUpdateTotalBytes = 0; uint32_t firmwareUpdateCurrentBytes = 0; |
