How does DA14531 realize the serial port to receive data of variable length?
I am a novice, because I don’t know the length of the data to be received, so how do I use DA14531's UART1 to receive data of variable length? Thank you very much!
In the SDK, I want to use the function void“uart_receive (uart_t * uart_id uint8_t *哒ta, uint16_t len, UART_OP_CFG op) ”to receive data, but before using this function, you must know the length of the received data, that is, you need to know in advance The value of len, because I am not sure about the length of the data received through the serial port, so I cannot determine the value of len. Is there a way to accept data without being uncertain about the value of len?
Before use“uart_receive (uart_t * uart_id uint8_t *哒ta, uint16_t len, UART_OP_CFG op) ",you need to set up a callback functionuart_register_rx_cb(uart_t *uart_id, uart_cb_t cb),in which the functionuart_cb_tcontains the data length parameter. You can find these inuart.cfile
Hi Mr. Weng,
I am little confused. Do you mean that you want to know how to measure the data length?
And by the way, you are welcome to ask any questions. : )
Br
In the SDK, I want to use the function void“uart_receive (uart_t * uart_id uint8_t *哒ta, uint16_t len, UART_OP_CFG op) ”to receive data, but before using this function, you must know the length of the received data, that is, you need to know in advance The value of len, because I am not sure about the length of the data received through the serial port, so I cannot determine the value of len. Is there a way to accept data without being uncertain about the value of len?
Before use“uart_receive (uart_t * uart_id uint8_t *哒ta, uint16_t len, UART_OP_CFG op) ",you need to set up a callback functionuart_register_rx_cb(uart_t *uart_id, uart_cb_t cb),in which the functionuart_cb_tcontains the data length parameter. You can find these inuart.cfile