[FL-1796] Disable bluetooth (#703)
* bt: add authentication for all characteristics * bt: app_ble cleanup * bt: add start and stop advertising API * bt: rework application with start and stop advertising API * bt: support f7 target * bt: f7 target remove unused files * bt: stop advertising in bt debug application * bt: fix bt status bar update * bt: change bluetooth On Off order
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "bt_debug_app.h"
|
||||
#include <furi-hal-bt.h>
|
||||
|
||||
enum BtDebugSubmenuIndex {
|
||||
BtDebugSubmenuIndexCarrierTest,
|
||||
@@ -25,6 +26,10 @@ uint32_t bt_debug_start_view(void* context) {
|
||||
|
||||
BtDebugApp* bt_debug_app_alloc() {
|
||||
BtDebugApp* app = furi_alloc(sizeof(BtDebugApp));
|
||||
|
||||
// Load settings
|
||||
bt_settings_load(&app->settings);
|
||||
|
||||
// Gui
|
||||
app->gui = furi_record_open("gui");
|
||||
|
||||
@@ -88,7 +93,15 @@ void bt_debug_app_free(BtDebugApp* app) {
|
||||
|
||||
int32_t bt_debug_app(void* p) {
|
||||
BtDebugApp* app = bt_debug_app_alloc();
|
||||
// Stop advertising
|
||||
furi_hal_bt_stop_advertising();
|
||||
|
||||
view_dispatcher_run(app->view_dispatcher);
|
||||
|
||||
// Restart advertising
|
||||
if(app->settings.enabled) {
|
||||
furi_hal_bt_start_advertising();
|
||||
}
|
||||
bt_debug_app_free(app);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user