2021-12-08 14:28:01 +03:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-08 12:42:02 +03:00
|
|
|
#include <services/serial_service.h>
|
2021-12-08 14:28:01 +03:00
|
|
|
|
2022-09-14 19:11:38 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-12-08 14:28:01 +03:00
|
|
|
#define FURI_HAL_BT_SERIAL_PACKET_SIZE_MAX SERIAL_SVC_DATA_LEN_MAX
|
|
|
|
|
2022-10-14 20:21:23 +03:00
|
|
|
typedef enum {
|
|
|
|
FuriHalBtSerialRpcStatusNotActive,
|
|
|
|
FuriHalBtSerialRpcStatusActive,
|
|
|
|
} FuriHalBtSerialRpcStatus;
|
|
|
|
|
2021-12-08 14:28:01 +03: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 19:10:18 +03:00
|
|
|
void furi_hal_bt_serial_set_event_callback(
|
|
|
|
uint16_t buff_size,
|
|
|
|
FuriHalBtSerialCallback callback,
|
|
|
|
void* context);
|
2021-12-08 14:28:01 +03:00
|
|
|
|
2022-10-14 20:21:23 +03:00
|
|
|
/** Set BLE RPC status
|
|
|
|
*
|
|
|
|
* @param status FuriHalBtSerialRpcStatus instance
|
|
|
|
*/
|
|
|
|
void furi_hal_bt_serial_set_rpc_status(FuriHalBtSerialRpcStatus status);
|
|
|
|
|
2021-12-08 14:28:01 +03: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 19:11:38 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|