mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-22 10:43:11 +00:00
23ff6723cf
* bt: update connection parameters * bt: set correct connection latency and timeout * gui popup: add clean method * furi_hal_bt: add connection parameters request, clear database * bt: add forget bonded devices API * bt_settings: add forget bonded devices GUI * bt: rework pin code show with view port to hide view * bt: support conn parameters for different profiles * furi_hal_bt: sync f6 target * target f6: fix build * bt: format sources * furi_hal_bt: update connection parameters * bt: update connection params, fix GUI * FuriHal: fix spelling * Refactoring: rename _clean to _reset Co-authored-by: あく <alleteam@gmail.com>
28 lines
889 B
C
Executable file
28 lines
889 B
C
Executable file
#include "bt_i.h"
|
|
|
|
bool bt_set_profile(Bt* bt, BtProfile profile) {
|
|
furi_assert(bt);
|
|
|
|
// Send message
|
|
bool result = false;
|
|
BtMessage message = {
|
|
.type = BtMessageTypeSetProfile, .data.profile = profile, .result = &result};
|
|
furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK);
|
|
// Wait for unlock
|
|
osEventFlagsWait(bt->api_event, BT_API_UNLOCK_EVENT, osFlagsWaitAny, osWaitForever);
|
|
|
|
return result;
|
|
}
|
|
|
|
void bt_set_status_changed_callback(Bt* bt, BtStatusChangedCallback callback, void* context) {
|
|
furi_assert(bt);
|
|
|
|
bt->status_changed_cb = callback;
|
|
bt->status_changed_ctx = context;
|
|
}
|
|
|
|
void bt_forget_bonded_devices(Bt* bt) {
|
|
furi_assert(bt);
|
|
BtMessage message = {.type = BtMessageTypeForgetBondedDevices};
|
|
furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK);
|
|
}
|