[FL-1976] BLE HID (#852)

* ble: prototype ble hid
* ble: add HID service and characteristics
* debug tools: add ble keyboard app
* ble: change appearance
* ble: working keyboard
* bt: introduce furi-hal-bt-hid
* bt: restart hid service on each keyboard app enter
* bt: introduce switch profile
* bt: add profile to ble glue
* bt: working profile switch
* bt: introduce bt serial profile, rework API
* bt: rewotk HID profile
* bt: rework gap with profile configuration
* bt: move change profile routine to furi hal bt
* bt: change switch profile API to blocking
* bt: move battery update to furi hal bt
* bt: cleanup
* bt: add support for f6 target
* bt: update documentation
* bt: clean up code
* bt: remove NO OUTPUT setting
* bt: set numeric comparison pairing in BLE HID
* bt: support f6 target
* bt: set mac address in profile configuration
* bt: set advertise name in profile config
* bt: rework with furi thread
* bt: support f6 target
* bt: clear hci command buffer on core2 restart
* bt: correct thread kill sequence
* bt: fix freertos functions calls
* bt: add some enterprise delays fo correct memory free
* bt: code cleanup
* bt: change terminate -> stop
* bt: fix memory leakage

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-12-08 14:28:01 +03:00
committed by GitHub
parent bb96509ed1
commit 7170864fe4
46 changed files with 2288 additions and 439 deletions

View File

@@ -15,6 +15,8 @@
#include "../bt_settings.h"
#define BT_API_UNLOCK_EVENT (1UL << 0)
typedef enum {
BtStatusOff,
BtStatusAdvertising,
@@ -26,16 +28,19 @@ typedef enum {
BtMessageTypeUpdateBatteryLevel,
BtMessageTypePinCodeShow,
BtMessageTypeKeysStorageUpdated,
BtMessageTypeSetProfile,
} BtMessageType;
typedef union {
uint32_t pin_code;
uint8_t battery_level;
BtProfile profile;
} BtMessageData;
typedef struct {
BtMessageType type;
BtMessageData data;
bool* result;
} BtMessage;
struct Bt {
@@ -44,6 +49,7 @@ struct Bt {
uint16_t max_packet_size;
BtSettings bt_settings;
BtStatus status;
BtProfile profile;
osMessageQueueId_t message_queue;
Gui* gui;
ViewPort* statusbar_view_port;
@@ -53,4 +59,5 @@ struct Bt {
Rpc* rpc;
RpcSession* rpc_session;
osEventFlagsId_t rpc_event;
osEventFlagsId_t api_event;
};