如题:
整理代码时需要写环形缓存对串口收发数据的处理函数;函数
接口如下:求一份代码参考参考,谢谢!
//#include "RingBufferUtils.h"
#define UART_RX_BUFFER_LEN 2048
static ring_buffer_t uart_ring_buffer;
static UINT8 uart_ring_data[UART_RX_BUFFER_LEN] = {0};
- /*
- send uart data
- */
- INT32 aliyun_iot_uart_send(INT8 *pSendBuffer, INT32 bufferLen);
- /*
- receive uart data
- */
- INT32 aliyun_iot_uart_recv(INT8 *pRecvBuffer, INT32 bufferLen, UINT32 timeOutMs);
- /*
- initialize the baud rate of the uart
- */
- INT32 aliyun_iot_uart_init();
- /*
- the length of the data readable inside uart buffer
- */
- INT32 aliyun_iot_uart_buffer_len();
|