From 2b8b4edba3e1fe663d4208b278013fb68891d1fc Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 26 Feb 2022 21:30:04 +0100 Subject: [PATCH] sim: NimbleController: add stubs for new En/DisableRadio() functions New functions added in https://github.com/InfiniTimeOrg/InfiniTime/commit/ef44b763d94cc6ff1be6f75ff3e638d7d356e99e for the airplane-mode --- sim/components/ble/NimbleController.cpp | 17 +++++++++++++++++ sim/components/ble/NimbleController.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/sim/components/ble/NimbleController.cpp b/sim/components/ble/NimbleController.cpp index b0c87ee..3684d25 100644 --- a/sim/components/ble/NimbleController.cpp +++ b/sim/components/ble/NimbleController.cpp @@ -376,6 +376,23 @@ 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(); +// } +} + //void NimbleController::PersistBond(struct ble_gap_conn_desc& desc) { // union ble_store_key key; // union ble_store_value our_sec, peer_sec, peer_cccd_set[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)] = {0}; diff --git a/sim/components/ble/NimbleController.h b/sim/components/ble/NimbleController.h index 0699945..ce7e8d7 100644 --- a/sim/components/ble/NimbleController.h +++ b/sim/components/ble/NimbleController.h @@ -89,6 +89,9 @@ namespace Pinetime { fastAdvCount = 0; } + void EnableRadio(); + void DisableRadio(); + private: // void PersistBond(struct ble_gap_conn_desc& desc); // void RestoreBond();