Skip to content

Commit

Permalink
Fix BT CLI unsatisfied imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Oct 31, 2024
1 parent eef213f commit 8dcfda2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion applications/services/bt/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ App(
apptype=FlipperAppType.PLUGIN,
entry_point="bt_cli_plugin_ep",
requires=["cli"],
sources=["bt_cli.c"],
sources=["bt_cli.c", "bt_service/bt_settings_api.c"],
)

App(
Expand Down
36 changes: 0 additions & 36 deletions applications/services/bt/bt_service/bt_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,3 @@ void bt_keys_storage_set_default_path(Bt* bt) {

bt_keys_storage_set_file_path(bt->keys_storage, BT_KEYS_STORAGE_PATH);
}

/*
* Private API for the Settings app
*/

void bt_get_settings(Bt* bt, BtSettings* settings) {
furi_assert(bt);
furi_assert(settings);

BtMessage message = {
.lock = api_lock_alloc_locked(),
.type = BtMessageTypeGetSettings,
.data.settings = settings,
};

furi_check(
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);

api_lock_wait_unlock_and_free(message.lock);
}

void bt_set_settings(Bt* bt, const BtSettings* settings) {
furi_assert(bt);
furi_assert(settings);

BtMessage message = {
.lock = api_lock_alloc_locked(),
.type = BtMessageTypeSetSettings,
.data.csettings = settings,
};

furi_check(
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);

api_lock_wait_unlock_and_free(message.lock);
}
37 changes: 37 additions & 0 deletions applications/services/bt/bt_service/bt_settings_api.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "bt_i.h"

/*
* Private API for the Settings app
*/

void bt_get_settings(Bt* bt, BtSettings* settings) {
furi_assert(bt);
furi_assert(settings);

BtMessage message = {
.lock = api_lock_alloc_locked(),
.type = BtMessageTypeGetSettings,
.data.settings = settings,
};

furi_check(
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);

api_lock_wait_unlock_and_free(message.lock);
}

void bt_set_settings(Bt* bt, const BtSettings* settings) {
furi_assert(bt);
furi_assert(settings);

BtMessage message = {
.lock = api_lock_alloc_locked(),
.type = BtMessageTypeSetSettings,
.data.csettings = settings,
};

furi_check(
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);

api_lock_wait_unlock_and_free(message.lock);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
// Then, we still use the Header from original code as if nothing happened

// bt_get_settings(), bt_set_settings()
#include <applications/services/bt/bt_service/bt_api.c>
#include <applications/services/bt/bt_service/bt_settings_api.c>

0 comments on commit 8dcfda2

Please sign in to comment.