mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-17 02:13:19 +03:00
4768177cf5
* 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
22 lines
771 B
C
Executable File
22 lines
771 B
C
Executable File
#include "bt.h"
|
|
#include "bt_i.h"
|
|
|
|
void bt_update_statusbar(Bt* bt) {
|
|
furi_assert(bt);
|
|
BtMessage message = {.type = BtMessageTypeUpdateStatusbar};
|
|
furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK);
|
|
}
|
|
|
|
void bt_update_battery_level(Bt* bt, uint8_t battery_level) {
|
|
furi_assert(bt);
|
|
BtMessage message = {
|
|
.type = BtMessageTypeUpdateBatteryLevel, .data.battery_level = battery_level};
|
|
furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK);
|
|
}
|
|
|
|
bool bt_pin_code_show(Bt* bt, uint32_t pin_code) {
|
|
furi_assert(bt);
|
|
BtMessage message = {.type = BtMessageTypePinCodeShow, .data.pin_code = pin_code};
|
|
return osMessageQueuePut(bt->message_queue, &message, 0, 0) == osOK;
|
|
}
|