summaryrefslogtreecommitdiff
path: root/src/components/ble
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-03-25 16:43:27 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-03-25 16:44:46 (GMT)
commit30c319831ab15e6abaf97e4fa8f58a8eaeb8ba4a (patch)
treea3231e8a294d6214e6c549d0d9ca4d23b1eb523f /src/components/ble
parent196b8325544174f571e6394259d11c56eaad8cb4 (diff)
sans airplane mode and related support code
Diffstat (limited to 'src/components/ble')
-rw-r--r--src/components/ble/BleController.cpp12
-rw-r--r--src/components/ble/BleController.h5
-rw-r--r--src/components/ble/NimbleController.cpp18
-rw-r--r--src/components/ble/NimbleController.h3
4 files changed, 1 insertions, 37 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;