mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-20 20:01:54 +03:00
f0d4584b40
* view_dispatcher: add default back processing for Long events * assets: add ble connected and disconnected assets * bt keyboard: introduce new application * bt keyboard: add logic to keyboard mode * bt: remove debug ble hid application * bt hid: introduce media controller * gui canvas: rename CanvasFontDirection -> CanvasDirection * gui canvas: add arrow element * assets: update finilized assets * bt hid: finalise keynote GUI * bt hid: finalise media player GUI * bt: add media key buttons support * bt: add exit confirm view * bt: change Clicker -> Remote * bt: support f6 target * bt: hopefully final bt hid design * bt hid: add blue led notification when device is connected * bt: leave only bt clicker for now * bt: add display notification on pin code show event
46 lines
911 B
C
46 lines
911 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct Bt Bt;
|
|
|
|
typedef enum {
|
|
BtStatusOff,
|
|
BtStatusAdvertising,
|
|
BtStatusConnected,
|
|
} BtStatus;
|
|
|
|
typedef enum {
|
|
BtProfileSerial,
|
|
BtProfileHidKeyboard,
|
|
} BtProfile;
|
|
|
|
typedef void (*BtStatusChangedCallback)(BtStatus status, void* context);
|
|
|
|
/** Change BLE Profile
|
|
* @note Call of this function leads to 2nd core restart
|
|
*
|
|
* @param bt Bt instance
|
|
* @param profile BtProfile
|
|
*
|
|
* @return true on success
|
|
*/
|
|
bool bt_set_profile(Bt* bt, BtProfile profile);
|
|
|
|
/** Set callback for Bluetooth status change notification
|
|
*
|
|
* @param bt Bt instance
|
|
* @param callback BtStatusChangedCallback instance
|
|
* @param context pointer to context
|
|
*/
|
|
void bt_set_status_changed_callback(Bt* bt, BtStatusChangedCallback callback, void* context);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|