Skip to content

Commit

Permalink
Improve beacon state handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 8, 2024
1 parent 13fe7b3 commit 435c35c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion applications/external
Submodule external updated 1 files
+8 −2 ble_spam/ble_spam.c
7 changes: 5 additions & 2 deletions applications/system/js_app/modules/js_blebeacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ static void js_blebeacon_stop(struct mjs* mjs) {
blebeacon->saved_prev_active = true;
blebeacon->prev_active = furi_hal_bt_extra_beacon_is_active();
}
furi_hal_bt_extra_beacon_stop();
if(!furi_hal_bt_extra_beacon_stop()) {
ret_int_err(mjs, "Failed stopping beacon");
return;
}

mjs_return(mjs, MJS_UNDEFINED);
}
Expand Down Expand Up @@ -209,7 +212,7 @@ static void js_blebeacon_destroy(void* inst) {
JsBlebeaconInst* blebeacon = inst;
if(!blebeacon->keep_alive) {
if(furi_hal_bt_extra_beacon_is_active()) {
furi_hal_bt_extra_beacon_stop();
furi_check(furi_hal_bt_extra_beacon_stop());
}
if(blebeacon->saved_prev_cfg && blebeacon->prev_cfg_set) {
furi_check(furi_hal_bt_extra_beacon_set_config(&blebeacon->prev_cfg));
Expand Down

0 comments on commit 435c35c

Please sign in to comment.