我想请问下CC2640R2蓝牙4.2有没有串口透传的例子?ble5的例子5.14_advance_peripheral_uarttrans能实现这个功能,但是移植到蓝牙4.2时SDI串口功能用不了。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我想请问下CC2640R2蓝牙4.2有没有串口透传的例子?ble5的例子5.14_advance_peripheral_uarttrans能实现这个功能,但是移植到蓝牙4.2时SDI串口功能用不了。
使能Return Partial
Receive with Return Partial
This use case will read in UART_MODE_BLOCKING until the wanted amount of bytes is received or until a started reception is inactive for a 32-bit period. This UART_read() call can also be used when unknown amount of bytes shall be read. Note: The partial return is also possible in UART_MODE_CALLBACK mode.
UART_Handle handle; UART_Params params; uint8_t rxBuf[100]; // Receive buffer // Init UART and specify non-default parameters UART_Params_init(¶ms); params.baudRate = 9600; params.writeDataMode = UART_DATA_BINARY; // Open the UART and initiate the partial read handle = UART_open(Board_UART, ¶ms); // Enable RETURN_PARTIAL UART_control(handle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL); // Begin read int rxBytes = UART_read(handle, rxBuf, 100));