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.
Hi ,我打算将串口接收的指令通过RF透传出去,指令不同所以字节长度不同,请问射频该怎么动态的发送不同长度的数据呢?我想的是在任务中根据具体指令,把要发送的数据的长度填充给RF_cmdPropTxAdv.pktLen参数,这样想对吗?
就是通过pktLen来设置每一包数据的长度,就是这样操作的,没问题。
The transmit operations contain a buffer with the data to be transmitted. The number of bytes in this buffer
is given by pktLen. For the CMD_PROP_TX command, the length given in pktLen is transmitted as the
first byte if pktConf.bVarLen is 1, and then followed by the contents of the transmit buffer.
pktLen = 0 是使用unlimited length模式。
按照你的描述,你的应用中,不同数据包的长度不同,但是每种数据包的长度是知道的,因此没有必要用unlimited length模式。可以直接将pktConf.bVarLen设置为1, a length byte equal to the value of pktLen is sent next. 操作更简单方便。
RF_cmdPropRx.pQueue = &dataQueue 是配置将接收到的数据放入dataQueue队列。
如果一定要类比,TX端对应的语句是RF_cmdPropTx.pPkt = packet;