请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:LAUNCHXL-CC1310 我希望通过无线电连续发送数据、因此我键入以下代码、对吧?
在 main()函数中:
RF_postCmd(rfHandle, (RF_Op*)RF_pCmdTxHS, RF_PriorityNormal, &tx_callback, RF_EventLastCmdDone);
回调函数:
static void tx_callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
if (e & RF_EventLastCmdDone)
{
/* For TC_HSM, the packet length and a pointer to the first byte in the payload can be found as follows:
*
* uint8_t packetLength = ((*(uint8_t*)(¤tDataEntry->data + 1)) << 8) | (*(uint8_t*)(¤tDataEntry->data));
* uint8_t* packetDataPointer = (uint8_t*)(¤tDataEntry->data + 2);
*
* For the other test cases (TC_LRM, TC_OOK and TC_FSK), the packet length and first payload byte is found here:
*
* uint8_t packetLength = *(uint8_t*)(¤tDataEntry->data);
* uint8_t* packetDataPointer = (uint8_t*)(¤tDataEntry->data + 1);
*/
packetTransfered = true;
}
}