Skip to content

Commit 2b8b4ed

Browse files
committed
sim: NimbleController: add stubs for new En/DisableRadio() functions
New functions added in InfiniTimeOrg/InfiniTime@ef44b76 for the airplane-mode
1 parent cdd6625 commit 2b8b4ed

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

sim/components/ble/NimbleController.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,23 @@ void NimbleController::NotifyBatteryLevel(uint8_t level) {
376376
// }
377377
}
378378

379+
void NimbleController::EnableRadio() {
380+
// bleController.EnableRadio();
381+
// bleController.Disconnect();
382+
// fastAdvCount = 0;
383+
// StartAdvertising();
384+
}
385+
386+
void NimbleController::DisableRadio() {
387+
// bleController.DisableRadio();
388+
// if (bleController.IsConnected()) {
389+
// ble_gap_terminate(connectionHandle, BLE_ERR_REM_USER_CONN_TERM);
390+
// bleController.Disconnect();
391+
// } else {
392+
// ble_gap_adv_stop();
393+
// }
394+
}
395+
379396
//void NimbleController::PersistBond(struct ble_gap_conn_desc& desc) {
380397
// union ble_store_key key;
381398
// union ble_store_value our_sec, peer_sec, peer_cccd_set[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)] = {0};

sim/components/ble/NimbleController.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ namespace Pinetime {
8989
fastAdvCount = 0;
9090
}
9191

92+
void EnableRadio();
93+
void DisableRadio();
94+
9295
private:
9396
// void PersistBond(struct ble_gap_conn_desc& desc);
9497
// void RestoreBond();

0 commit comments

Comments
 (0)