Part Number: CC1310
Tool/software: TI-RTOS
In the example of WOR-RX,I want to send back the received data.It works, but there was a problem:There is a long interval between sending and receiving data!
Based on the results of my tests, I think the module will send data after the next wake-up.What should I do while maintaining low power consumption?
/* Called for every received packet and command done */
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
/* If we've received a new packet and it's available to read out */
if (e & RF_EventRxEntryDone)
{
do
{
/* Toggle LED on RX */
PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, !PIN_getOutputValue(Board_PIN_LED1));
/* Get current unhandled data entry */
currentDataEntry = RFQueue_getDataEntry();
/* Handle the packet data, located at ¤tDataEntry->data:
* - Length is the first byte with the current configuration
* - Data starts from the second byte */
packetLength = *(uint8_t*)(¤tDataEntry->data);
packetDataPointer = (uint8_t*)(¤tDataEntry->data + 1);
/* This code block is added to avoid a compiler warning.
* Normally, an application will reference these variables for
* useful data. */
dummy = packetLength + packetDataPointer[0];
txPacket[0] = packetLength;
memcpy(&txPacket[1],packetDataPointer,packetLength);
Display_printf(uartDisplayHandle, 0, 0, "RX");
Event_post(radioOperationEventHandle, RADIO_EVENT_VALID_PACKET_RECEIVED);
} while(RFQueue_nextEntry() == DATA_ENTRY_FINISHED);
}
}
static void txTaskFunction(UArg arg0, UArg arg1)
{
/* Initialize TX_ADV command from TX command */
initializeTxAdvCmdFromTxCmd(&RF_cmdPropTxAdv, &RF_cmdPropTx);
/* Set application specific fields */
RF_cmdPropTxAdv.pktLen = 31; /* +1 for length byte */
RF_cmdPropTxAdv.pPkt = txPacket;
RF_cmdPropTxAdv.preTrigger.triggerType = TRIG_NOW;
//RF_cmdPropTxAdv.startTime = 0;
while(1)
{
uint32_t events = Event_pend(radioOperationEventHandle, 0, RADIO_EVENT_ALL, BIOS_WAIT_FOREVER);
if(events & RADIO_EVENT_VALID_PACKET_RECEIVED)
{
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv,RF_PriorityNormal, NULL, 0);
Display_printf(uartDisplayHandle, 0, 0, "TX");
}
}
}
