实现蓝牙初始化,以及串口发送蓝牙接收、蓝牙发送串口接收

This commit is contained in:
OPTOC
2025-08-20 11:50:01 +08:00
parent 0853287c7c
commit 9abdbeb771
3 changed files with 130 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
#include "sys_log.h"
#define UART_ENABLE 1
#define BLE_ENABLE 0
#define BLE_ENABLE 1
#define WIFI_ENABLE 0
enum DEVICE_ERROR
@@ -128,4 +128,33 @@ int embedded_device_write(device_t *port, void *buffer, uint32_t length);
* @param size 写入数据长度
* @retval 缓存中可读取的字节数
*/
uint32_t embedded_device_get_rx_length(device_t *port);
uint32_t embedded_device_get_rx_length(device_t *port);
/**
* @brief PC OR 手机数据接口读操作
*
* @param port 由对应的驱动提供的绑定接口获得的句柄
* @param buffer 读取数据缓存
* @param length 读取数据长度
* @retval < 0 操作失败或在指定的时间内未满足指定的操作长度
* @retval >= 0 实际已缓存的长度
*/
int pc_device_read(device_t *port, void *buffer, uint32_t length);
/**
* @brief PC OR 手机数据接口写操作
*
* @param port 由对应的驱动提供的绑定接口获得的句柄
* @param data 写入数据
* @param size 写入数据长度
* @retval < 0 操作失败或在指定的时间内未满足指定的操作长度
* @retval >= 0 实际已缓存的长度
*/
int pc_device_write(device_t *port, void *buffer, uint32_t length);
/**
* @brief PC OR 手机数据接口写操作
*
* @param port 由对应的驱动提供的绑定接口获得的句柄
* @param data 写入数据
* @param size 写入数据长度
* @retval 缓存中可读取的字节数
*/
uint32_t pc_device_get_rx_length(device_t *port);