Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

LAUNCHXL-CC1310: How to compare received RF data to a number/hex value on CC1310 launchpad?

$
0
0

Part Number:LAUNCHXL-CC1310




if (result == RF_EventLastCmdDone) { do { /* Get current unhandled data entry */ currentDataEntry = RFQueue_getDataEntry(); /* Handle the packet data, located at &currentDataEntry->data: * - Length is the first byte with the current configuration * - Data starts from the second byte */ packetLength = *(uint8_t*)(&currentDataEntry->data); packetDataPointer = (uint8_t*)(&currentDataEntry->data + 1); //UART_write(uart, "n1\n", 3); rssi = rxStatistics.lastRssi; /* Check for error */ if (rxStatistics.nRxNok > prevRcvOK){ error = 1; } else { error = 0; } if(packetDataPointer[packetLength]==37) { UART_write(uart, "packetdataPointer\n", 18); } prevRcvOK = rxStatistics.nRxNok; /* Check sequence */ rcvSeqNumber = (uint8_t)packetDataPointer[1]; if (rcvSeqNumber != 0) { // ignore first seqNumber. if (rcvSeqNumber != (prevRcvSeqNumber + 1)) { error = 1; } } prevRcvSeqNumber = rcvSeqNumber; /* Print results */ uart_writeError(); uart_writeRssi(); uart_writePayLoad(packetDataPointer, packetLength); /* 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 = packetDataPointer[0]; } while(RFQueue_nextEntry() == DATA_ENTRY_FINISHED); }

I have this section where I receive the data. The data even prints on the UART properly everything works. Now I want to add comparison to this received data. So if I receive 0x01 then I should be able to execute function and 0x02 some other function etc. I need to know how to compare the received data to 0x01. I am facing bit of difficulty in creating comparison.
Any input will be very helpful.

Thank you.


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>