Skip to content

Commit

Permalink
BLE: calls hal_ble_stack_init() on entering the listening mode and ca…
Browse files Browse the repository at this point in the history
…lling BLE.on().
  • Loading branch information
XuGuohui committed Aug 26, 2019
1 parent 80e1238 commit 039c1d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/src/ble_listening_mode_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ LOG_SOURCE_CATEGORY("system.listen.ble")
#include "check.h"
#include "scope_guard.h"
#include "device_code.h"
#include "service_debug.h"

namespace {

Expand Down Expand Up @@ -272,6 +273,8 @@ int BleListeningModeHandler::enter() {
}
});

SPARK_ASSERT(hal_ble_stack_init(nullptr) == SYSTEM_ERROR_NONE);

// Now the BLE configurations are non-modifiable.
CHECK(hal_ble_enter_locked_mode(nullptr));
CHECK(constructControlRequestAdvData());
Expand Down
1 change: 1 addition & 0 deletions wiring/src/spark_wiring_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@ int BleLocalDevice::end() const {

int BleLocalDevice::on() const {
WiringBleLock lk;
CHECK(hal_ble_stack_init(nullptr));
return SYSTEM_ERROR_NONE;
}

Expand Down

0 comments on commit 039c1d2

Please sign in to comment.