From 435c35cee93e5332ebc91f1ffb8243394bbe9fbf Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:56:39 +0000 Subject: [PATCH] Improve beacon state handling --- applications/external | 2 +- applications/system/js_app/modules/js_blebeacon.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/external b/applications/external index 746531bdf1..3dbd298b07 160000 --- a/applications/external +++ b/applications/external @@ -1 +1 @@ -Subproject commit 746531bdf1646328448533f1d3c9612ec6c061a1 +Subproject commit 3dbd298b0714312cc6af4d74c52cd802e718d343 diff --git a/applications/system/js_app/modules/js_blebeacon.c b/applications/system/js_app/modules/js_blebeacon.c index a87f4d2291..4d19accb1c 100644 --- a/applications/system/js_app/modules/js_blebeacon.c +++ b/applications/system/js_app/modules/js_blebeacon.c @@ -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); } @@ -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));