2021-12-08 11:28:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-08 09:42:02 +00:00
|
|
|
#include <services/serial_service.h>
|
2021-12-08 11:28:01 +00:00
|
|
|
|
2022-09-14 16:11:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-12-08 11:28:01 +00:00
|
|
|
#define FURI_HAL_BT_SERIAL_PACKET_SIZE_MAX SERIAL_SVC_DATA_LEN_MAX
|
|
|
|
|
2022-10-14 17:21:23 +00:00
|
|
|
typedef enum {
|
|
|
|
FuriHalBtSerialRpcStatusNotActive,
|
|
|
|
FuriHalBtSerialRpcStatusActive,
|
|
|
|
} FuriHalBtSerialRpcStatus;
|
|
|
|
|
2021-12-08 11:28:01 +00:00
|
|
|
/** Serial service callback type */
|
|
|
|
typedef SerialServiceEventCallback FuriHalBtSerialCallback;
|
|
|
|
|
|
|
|
/** Start Serial Profile
|
|
|
|
*/
|
|
|
|
void furi_hal_bt_serial_start();
|
|
|
|
|
|
|
|
/** Stop Serial Profile
|
|
|
|
*/
|
|
|
|
void furi_hal_bt_serial_stop();
|
|
|
|
|
|
|
|
/** Set Serial service events callback
|
|
|
|
*
|
|
|
|
* @param buffer_size Applicaition buffer size
|
|
|
|
* @param calback FuriHalBtSerialCallback instance
|
|
|
|
* @param context pointer to context
|
|
|
|
*/
|
2022-01-05 16:10:18 +00:00
|
|
|
void furi_hal_bt_serial_set_event_callback(
|
|
|
|
uint16_t buff_size,
|
|
|
|
FuriHalBtSerialCallback callback,
|
|
|
|
void* context);
|
2021-12-08 11:28:01 +00:00
|
|
|
|
2022-10-14 17:21:23 +00:00
|
|
|
/** Set BLE RPC status
|
|
|
|
*
|
|
|
|
* @param status FuriHalBtSerialRpcStatus instance
|
|
|
|
*/
|
|
|
|
void furi_hal_bt_serial_set_rpc_status(FuriHalBtSerialRpcStatus status);
|
|
|
|
|
2021-12-08 11:28:01 +00:00
|
|
|
/** Notify that application buffer is empty
|
|
|
|
*/
|
|
|
|
void furi_hal_bt_serial_notify_buffer_is_empty();
|
|
|
|
|
|
|
|
/** Send data through BLE
|
|
|
|
*
|
|
|
|
* @param data data buffer
|
|
|
|
* @param size data buffer size
|
|
|
|
*
|
|
|
|
* @return true on success
|
|
|
|
*/
|
|
|
|
bool furi_hal_bt_serial_tx(uint8_t* data, uint16_t size);
|
2022-09-14 16:11:38 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|