unleashed-firmware/targets/f7/ble_glue/profiles/serial_profile.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

62 lines
1.6 KiB
C

#pragma once
#include <furi_ble/profile_interface.h>
#include <services/serial_service.h>
#ifdef __cplusplus
extern "C" {
#endif
#define BLE_PROFILE_SERIAL_PACKET_SIZE_MAX BLE_SVC_SERIAL_DATA_LEN_MAX
typedef enum {
FuriHalBtSerialRpcStatusNotActive,
FuriHalBtSerialRpcStatusActive,
} FuriHalBtSerialRpcStatus;
/** Serial service callback type */
typedef SerialServiceEventCallback FuriHalBtSerialCallback;
/** Serial profile descriptor */
extern const FuriHalBleProfileTemplate* ble_profile_serial;
/** Send data through BLE
*
* @param profile Profile instance
* @param data data buffer
* @param size data buffer size
*
* @return true on success
*/
bool ble_profile_serial_tx(FuriHalBleProfileBase* profile, uint8_t* data, uint16_t size);
/** Set BLE RPC status
*
* @param profile Profile instance
* @param active true if RPC is active
*/
void ble_profile_serial_set_rpc_active(FuriHalBleProfileBase* profile, bool active);
/** Notify that application buffer is empty
* @param profile Profile instance
*/
void ble_profile_serial_notify_buffer_is_empty(FuriHalBleProfileBase* profile);
/** Set Serial service events callback
*
* @param profile Profile instance
* @param buffer_size Applicaition buffer size
* @param calback FuriHalBtSerialCallback instance
* @param context pointer to context
*/
void ble_profile_serial_set_event_callback(
FuriHalBleProfileBase* profile,
uint16_t buff_size,
FuriHalBtSerialCallback callback,
void* context);
#ifdef __cplusplus
}
#endif