I am developing an application that waits for a beacon packet (comes every second) and then transmits a packet if there
are no other devices transmitting. The pseudo-code looks something like this:
waitForNextBeacon(); if (no-carrier for 5 msec) { transmitPacket(); }
My plan is to CMD_PROP_CS to check for up to 5 msec if another device is transmitting.
I started by looking at the rFListenBeforeTalk example but it appears much more complicated
than I need. In addition, I don't want it to wait until there is an open spot. I only want it to
wait for up 5 msec. If a carrier is detected before the 5 msec is up it should return immediately
indicating that the channel is busy.
The configuration for the CMD_PROP_CS is
RF_cmdPropCs = { .commandNo = CMD_PROP_CS, .pNextOp = 0, .startTrigger.triggerType = TRIG_NOW, .csConf.bEnaRssi = 0x1, // Enable RSSI as a criterion .csConf.busyOp = 0x1, // End carrier sense on channel Busy .rssiThr = -80, // Set the RSSI threshold in the application .numRssiIdle = 0x3, // Number of consecutive RSSI measurements - 1 below the threshold // needed before the channel is declared Idle .numRssiBusy = 0x3, // Number of consecutive RSSI measurements -1 above the threshold // needed before the channel is declared Busy .csEndTrigger.triggerType = TRIG_REL_START, // Trigs at a time relative to the command started .csEndTime = 20000; };
How do I make it return after 5 msec if it does not see a carrier and immediately if it does?
Victor