diff --git a/applications/services/bt/application.fam b/applications/services/bt/application.fam index 54e197259f..5e77b2a84c 100644 --- a/applications/services/bt/application.fam +++ b/applications/services/bt/application.fam @@ -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( diff --git a/applications/services/bt/bt_service/bt_api.c b/applications/services/bt/bt_service/bt_api.c index 39b9a099da..f0e792d42e 100644 --- a/applications/services/bt/bt_service/bt_api.c +++ b/applications/services/bt/bt_service/bt_api.c @@ -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); -} diff --git a/applications/services/bt/bt_service/bt_settings_api.c b/applications/services/bt/bt_service/bt_settings_api.c new file mode 100644 index 0000000000..333b14cd3d --- /dev/null +++ b/applications/services/bt/bt_service/bt_settings_api.c @@ -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); +} diff --git a/applications/settings/bt_settings_app/mock_imports/mock_bt_api.c b/applications/settings/bt_settings_app/mock_imports/mock_bt_settings_api.c similarity index 85% rename from applications/settings/bt_settings_app/mock_imports/mock_bt_api.c rename to applications/settings/bt_settings_app/mock_imports/mock_bt_settings_api.c index c7a2036f19..0f28d559fd 100644 --- a/applications/settings/bt_settings_app/mock_imports/mock_bt_api.c +++ b/applications/settings/bt_settings_app/mock_imports/mock_bt_settings_api.c @@ -4,4 +4,4 @@ // Then, we still use the Header from original code as if nothing happened // bt_get_settings(), bt_set_settings() -#include +#include