Flipper Zero Firmware
Loading...
Searching...
No Matches
bt_i.h
1#pragma once
2
3#include "bt.h"
4
5#include <furi.h>
6#include <furi_hal.h>
7#include <api_lock.h>
8
9#include <gui/gui.h>
10#include <gui/view_port.h>
11#include <gui/view.h>
12
13#include <dialogs/dialogs.h>
14#include <power/power_service/power.h>
15#include <rpc/rpc.h>
16#include <notification/notification.h>
17#include <storage/storage.h>
18
19#include <bt/bt_settings.h>
20#include <bt/bt_service/bt_keys_storage.h>
21
22#include "bt_keys_filename.h"
23
24#define BT_KEYS_STORAGE_PATH INT_PATH(BT_KEYS_STORAGE_FILE_NAME)
25
26typedef enum {
27 BtMessageTypeUpdateStatus,
28 BtMessageTypeUpdateBatteryLevel,
29 BtMessageTypeUpdatePowerState,
30 BtMessageTypePinCodeShow,
31 BtMessageTypeKeysStorageUpdated,
32 BtMessageTypeSetProfile,
33 BtMessageTypeDisconnect,
34 BtMessageTypeForgetBondedDevices,
35} BtMessageType;
36
37typedef struct {
38 uint8_t* start_address;
39 uint16_t size;
41
42typedef union {
43 uint32_t pin_code;
44 uint8_t battery_level;
45 bool power_state_charging;
46 struct {
47 const FuriHalBleProfileTemplate* template;
48 FuriHalBleProfileParams params;
49 } profile;
50 FuriHalBleProfileParams profile_params;
51 BtKeyStorageUpdateData key_storage_data;
53
54typedef struct {
55 FuriApiLock lock;
56 BtMessageType type;
57 BtMessageData data;
58 bool* result;
59 FuriHalBleProfileBase** profile_instance;
60} BtMessage;
61
62struct Bt {
63 uint8_t* bt_keys_addr_start;
64 uint16_t bt_keys_size;
65 uint16_t max_packet_size;
66 BtSettings bt_settings;
67 BtKeysStorage* keys_storage;
68 BtStatus status;
69 bool beacon_active;
70 FuriHalBleProfileBase* current_profile;
71 FuriMessageQueue* message_queue;
72 NotificationApp* notification;
73 Gui* gui;
74 ViewPort* statusbar_view_port;
75 ViewPort* pin_code_view_port;
76 uint32_t pin_code;
77 DialogsApp* dialogs;
78 DialogMessage* dialog_message;
79 Power* power;
80 Rpc* rpc;
81 RpcSession* rpc_session;
82 FuriEventFlag* rpc_event;
83 FuriEventFlag* api_event;
84 BtStatusChangedCallback status_changed_cb;
85 void* status_changed_ctx;
86};
Furi HAL API.
GUI: main API.
APIs for working with storages, directories and files.
Definition bt_i.h:62
Definition bt_i.h:37
Definition bt_keys_storage.c:13
Definition bt_i.h:54
Definition bt_settings.h:12
Definition dialogs_module_message.c:12
Definition dialogs_i.h:10
Definition event_flag.c:11
Definition profile_interface.h:14
Definition profile_interface.h:28
Definition message_queue.c:14
Gui structure.
Definition gui_i.h:47
Definition notification_app.h:48
Definition power_i.h:24
Definition rpc.c:88
Definition rpc.c:67
Definition view_port_i.h:11
Definition bt_i.h:42
GUI: View API.
GUI: ViewPort API.