环境:nortos,sdk:simplelink_cc13x0_sdk_4_20_00_05
目前想要达到的效果就是,串口接收到得数据为不定长;
但是参考官方给出来的例程接收是定长的,而且需要在回调函数中调用UART_read才可以继续进入回调函数接收;
问题1:如何实现串口接收数据不定长?官方有提供接收吗?
问题2:串口回调函数必须调用UART_read才可以进入?
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.
环境:nortos,sdk:simplelink_cc13x0_sdk_4_20_00_05
目前想要达到的效果就是,串口接收到得数据为不定长;
但是参考官方给出来的例程接收是定长的,而且需要在回调函数中调用UART_read才可以继续进入回调函数接收;
问题1:如何实现串口接收数据不定长?官方有提供接收吗?
问题2:串口回调函数必须调用UART_read才可以进入?
1.可以接收不定长的数据,参考Receive with Return Partialhttps://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_4_10_01_01/docs/tidrivers/doxygen/html/_u_a_r_t_c_c26_x_x_8h.html
2.UART_write()或UART_read()都可以
1、关于不定长数据接收问题,我查看相关api,目前所知就是只能使用换行符号进行触发回调函数?
2、回调函数只能是调用UART_write()或UART_read()才能触发进入?因为这个read无法确定接收的数据是多少字节,所以字节数设置大了会无法触发回调函数,有没有更好的解决办法?
参考https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/611339/rtos-launchxl-cc1310-cc1310-uart-read-problem-to-receive-variable-length-packet?tisearch=e2e-sitesearch&keymatch=uart%2520variable%2520length%2520data#