Hello,
I am using the rfEcho example as a base, and have a small issue. I understand the basic example is used to send a packet from LaunchPad (LP) 1 to LP2 and back to LP1. However, i'll need LP2 & LP3 to 'reply' back to LP1.
The following is the main portions of both sides of the code which I have edited: (I changed it this way so that LP2 & LP3 can differentiate the packets of each other from the control packet of LP1)
(LP1) rfEchoTx.c :
static uint8_t txPacket[PAYLOAD_LENGTH] = {"CTRLbikeObike"}; // Control Tx static uint8_t returnCheck[PAYLOAD_LENGTH] = {"bikeObike"}; // Input item checking against static uint8_t checkLength = 9; // Number of characters to check against (returnCheck & rxPacket) static uint8_t rxPacket[PAYLOAD_LENGTH + NUM_APPENDED_BYTES - 1]; ... ... int16_t status = memcmp(returnCheck, rxPacket, checkLength);
(LP2 & LP3) rfEchoRx.c :
static uint8_t rxPacket[PAYLOAD_LENGTH]; static uint8_t txPacket[PAYLOAD_LENGTH] = {"bikeObike1"}; // Change bike serial number here static uint8_t controlCheck[PAYLOAD_LENGTH] = {"CTRLbikeObike"}; // Control code to check against (Differentiate between bike & drone) static uint8_t checkLength = 13; // Number of characters to check against (controlCheck & rxPacket) ... ... int16_t status = memcmp(controlCheck, rxPacket, checkLength);
Help needed:
1. Where is a suitable place in the code to insert a 'random delay' so that LP2 & LP3 packets don't "clash"?
2. How do I keep LP1's rx mode open to receive multiple signals within the timeout? (I want LP1 to send however many rxPacket it received out onto an external arduino board)
Any help would be greatly appreciated! Thank you!