diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/ble/BleController.cpp | 12 | ||||
| -rw-r--r-- | src/components/ble/BleController.h | 5 | ||||
| -rw-r--r-- | src/components/ble/NimbleController.cpp | 18 | ||||
| -rw-r--r-- | src/components/ble/NimbleController.h | 3 | ||||
| -rw-r--r-- | src/components/settings/Settings.h | 12 |
5 files changed, 1 insertions, 49 deletions
diff --git a/src/components/ble/BleController.cpp b/src/components/ble/BleController.cpp index b6b7383..548466f 100644 --- a/src/components/ble/BleController.cpp +++ b/src/components/ble/BleController.cpp @@ -14,18 +14,6 @@ void Ble::Disconnect() { isConnected = false; } -bool Ble::IsRadioEnabled() const { - return isRadioEnabled; -} - -void Ble::EnableRadio() { - isRadioEnabled = true; -} - -void Ble::DisableRadio() { - isRadioEnabled = false; -} - void Ble::StartFirmwareUpdate() { isFirmwareUpdating = true; } diff --git a/src/components/ble/BleController.h b/src/components/ble/BleController.h index 05112dc..6625df2 100644 --- a/src/components/ble/BleController.h +++ b/src/components/ble/BleController.h @@ -16,10 +16,6 @@ namespace Pinetime { void Connect(); void Disconnect(); - bool IsRadioEnabled() const; - void EnableRadio(); - void DisableRadio(); - void StartFirmwareUpdate(); void StopFirmwareUpdate(); void FirmwareUpdateTotalBytes(uint32_t totalBytes); @@ -59,7 +55,6 @@ namespace Pinetime { private: bool isConnected = false; - bool isRadioEnabled = true; bool isFirmwareUpdating = false; uint32_t firmwareUpdateTotalBytes = 0; uint32_t firmwareUpdateCurrentBytes = 0; diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 79880e9..a1597e2 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -163,7 +163,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) { case BLE_GAP_EVENT_ADV_COMPLETE: NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE"); NRF_LOG_INFO("reason=%d; status=%0X", event->adv_complete.reason, event->connect.status); - if (bleController.IsRadioEnabled() && !bleController.IsConnected()) { + if (!bleController.IsConnected()) { StartAdvertising(); } break; @@ -332,20 +332,4 @@ void NimbleController::NotifyBatteryLevel(uint8_t level) { } } -void NimbleController::EnableRadio() { - bleController.EnableRadio(); - bleController.Disconnect(); - fastAdvCount = 0; - StartAdvertising(); -} - -void NimbleController::DisableRadio() { - bleController.DisableRadio(); - if (bleController.IsConnected()) { - ble_gap_terminate(connectionHandle, BLE_ERR_REM_USER_CONN_TERM); - bleController.Disconnect(); - } else { - ble_gap_adv_stop(); - } -} diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h index 176848d..dfa42f7 100644 --- a/src/components/ble/NimbleController.h +++ b/src/components/ble/NimbleController.h @@ -63,9 +63,6 @@ namespace Pinetime { fastAdvCount = 0; }; - void EnableRadio(); - void DisableRadio(); - private: static constexpr const char* deviceName = "InfiniTime"; Pinetime::System::SystemTask& systemTask; diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 086aafd..3b26d69 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -159,14 +159,6 @@ namespace Pinetime { return settings.stepsGoal; }; - void SetBleRadioEnabled(bool enabled) { - bleRadioEnabled = enabled; - }; - - bool GetBleRadioEnabled() const { - return bleRadioEnabled; - }; - private: Pinetime::Controllers::FS& fs; @@ -191,10 +183,6 @@ namespace Pinetime { uint8_t appMenu = 0; uint8_t settingsMenu = 0; - /* airplaneMode is intentionally not saved with the other watch settings and initialized - * to off (false) on every boot because we always want ble to be enabled on startup - */ - bool bleRadioEnabled = true; void LoadSettingsFromFile(); void SaveSettingsToFile(); |
