Other Parts Discussed in Thread: CC1310
Tool/software: TI-RTOS
Hello,
I am using rfWakeOnRadioRx program from RF Examples on CC1310. The program is working fine along with rfWakeOnRadioTx.
For the next part I am sending constant string of 5 char from one cc1310 lauchpad to other. The receiving CC1310 lauchpad receives data successfully without loss. But when it comes to print data on UART terminal it only shows four characters. Here is the code snippet.
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e) //called when data is received
{
/* 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_LED1, !PIN_getOutputValue(Board_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 + 3); //pointer to actual data
/* This code block is added to avoid a compiler warning.
* Normally, an application will reference these variables for
* useful data. */
volatile uint8_t dummy;
dummy = packetLength;
dummy = dummy + packetDataPointer[0];
} while(RFQueue_nextEntry() == DATA_ENTRY_FINISHED);
UART_write(uart, packetDataPointer, sizeof(packetDataPointer)); //write data to uart
}
}
packetDataPointer variable is of type static uint8_t*
To receive all five characters I changed line as follows
UART_write(uart, packetDataPointer, sizeof(packetDataPointer)+1);
with this it is showing all four characters. But when again if the data is of some more size then I want
sizeof(packetDataPointer) to change dynamically and I don't want to increase the size manually. What changes to be made to receive and print all the received data of different size?