unleashed-firmware/targets/f7/ble_glue/furi_ble/event_dispatcher.h
hedger 60a9d7e6cf
ble: profile rework (#3272)
* ble: profile rework, initial
* apps: hid: fix for pairing cleanup
* app: hid: select transport based on #define
* fixing PVS warnings
* ble: serial service: fixed uid naming
* bt service: on-demand dialog init; ble profiles: docs; battery svc: proper update
* Added shci_cmd_resp_wait/shci_cmd_resp_release impl with semaphore
* app: hid: separated transport code
* ble: fixed service init order for serial svc; moved hardfault check to ble_glue
* cli: ps: added thread prio to output, fixed heap display
* ble_glue: naming changes; separate thread for event processing;
* furi: added runtime stats; cli: added cpu% to `ps`
* cli: fixed thread time calculation
* furi: added getter for thread priority
* fixing pvs warnings
* hid profile: fixed naming
* more naming fixes
* hal: ble init small cleanup
* cleanup & draft beacon api
* f18: api sync
* apps: moved example_custom_font from debug to examples
* BLE extra beacon demo app
* naming fix
* UI fixes for demo app (wip)
* desktop, ble svc: added statusbar icon for beacon
* minor cleanup
* Minor cleanup & naming fixes
* api sync
* Removed stale header
* hal: added FURI_BLE_EXTRA_LOG for extra logging; comments & code cleanup
* naming & macro fixes
* quick fixes from review
* Eliminated stock svc_ctl
* cli: ps: removed runtime stats
* minor include fixes
* (void)
* naming fixes
* More naming fixes
* fbt: always build all libs
* fbt: explicitly globbing libs; dist: logging SDK path
* scripts: fixed lib path precedence
* hal: bt: profiles: naming changes, support for passing params to a profile; include cleanup
* ble: hid: added parameter processing for profile template
* api sync
* BLE HID: long name trim
* Removed unused check
* desktop: updated beacon status icon; ble: hid: cleaner device name management
* desktop: updated status icon

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
2024-02-16 14:20:45 +07:00

50 lines
1.3 KiB
C

#pragma once
#include <stdint.h>
#include <core/common_defines.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
BleEventNotAck,
BleEventAckFlowEnable,
BleEventAckFlowDisable,
} BleEventAckStatus;
typedef enum {
BleEventFlowDisable,
BleEventFlowEnable,
} BleEventFlowStatus;
/* Using other types so not to leak all the BLE stack headers
(we don't have a wrapper for them yet)
* Event data is hci_uart_pckt*
* Context is user-defined
*/
typedef BleEventAckStatus (*BleSvcEventHandlerCb)(void* event, void* context);
typedef struct GapEventHandler GapSvcEventHandler;
/* To be called once at BLE system startup */
void ble_event_dispatcher_init(void);
/* To be called at stack reset - ensures that all handlers are unregistered */
void ble_event_dispatcher_reset(void);
BleEventFlowStatus ble_event_dispatcher_process_event(void* payload);
/* Final handler for event not ack'd by services - to be implemented by app */
BleEventFlowStatus ble_event_app_notification(void* pckt);
/* Add a handler to the list of handlers */
FURI_WARN_UNUSED GapSvcEventHandler*
ble_event_dispatcher_register_svc_handler(BleSvcEventHandlerCb handler, void* context);
/* Remove a handler from the list of handlers */
void ble_event_dispatcher_unregister_svc_handler(GapSvcEventHandler* handler);
#ifdef __cplusplus
}
#endif