SDAA260 April 2026 CC1310 , CC1311P3 , CC1312PSIP , CC1312R , CC1312R7 , CC1314R10 , CC1350 , CC1352P , CC1352P7 , CC1352R , CC1354P10 , CC1354R10
The rfPacketTx example is written to support this format, and no changes are needed to the code examples, other than to the payload length and content. However, in the following code snippet, some modifications have been implemented to improve readability. The following code shows how rfPacketTx.c can be modified to send the wanted payload once every 0.5 s.
1: //---------------------------------------------------------------------------------------------
2: // Transmit Standard Packet Format with CMD_PROP_TX (1 Length Byte)
3: //---------------------------------------------------------------------------------------------
4:
5: // Defines
6: #define PAYLOAD_LENGTH 3 // Max 255 bytes
7:
8: uint8_t packet[PAYLOAD_LENGTH];
9:
10: static RF_Object rfObject;
11: static RF_Handle rfHandle;
12:
13: void *mainThread(void *arg0)
14: {
15: RF_Params rfParams;
16: RF_Params_init(&rfParams);
17:
18: RF_cmdPropTx.pktLen = PAYLOAD_LENGTH; // Application specific settings
19: RF_cmdPropTx.pPkt = packet;
20:
21: rfHandle = RF_open(&rfObject, &RF_prop,
22: (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
23: RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
24:
25: while(1)
26: {
27: //-------------------------------------------------------------------------------------
28: // Could be placed outside the while(1) since the packet does not change
29: for (uint8_t i = 0; i < PAYLOAD_LENGTH; i++)
30: {
31: packet[i] = i + 1;
32: }
33: //-------------------------------------------------------------------------------------
34: RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
35: RF_yield(rfHandle);
36: usleep(500000);
37: }
38: }When using the standard TX command, the maximum payload length is 255, and the length byte (PAYLOAD_LENGTH) must be written to the .pktLen field of the command.