mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Implement listen-before-talk mechanism
- Function setRandomDelay() calls either startTransmitTimer() or startTransmitTimerSNR() - After coming back from Rx/Tx-ing, call setRandomDelay() - If channel is currently busy, call setRandomDelay()
This commit is contained in:
@@ -132,6 +132,9 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified
|
||||
*/
|
||||
virtual void startReceive() = 0;
|
||||
|
||||
/** can we detect a LoRa preamble on the current channel? */
|
||||
virtual bool isChannelActive() = 0;
|
||||
|
||||
/** are we actively receiving a packet (only called during receiving state)
|
||||
* This method is only public to facilitate debugging. Do not call.
|
||||
*/
|
||||
@@ -142,17 +145,13 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified
|
||||
|
||||
private:
|
||||
/** if we have something waiting to send, start a short random timer so we can come check for collision before actually doing
|
||||
* the transmit
|
||||
*
|
||||
* If the timer was already running, we just wait for that one to occur.
|
||||
* */
|
||||
* the transmit */
|
||||
void setRandomDelay();
|
||||
|
||||
/** random timer with certain min. and max. settings */
|
||||
void startTransmitTimer(bool withDelay = true);
|
||||
|
||||
/** if we have something waiting to send, start a short scaled timer based on SNR so we can come check for collision before actually doing
|
||||
* the transmit
|
||||
*
|
||||
* If the timer was already running, we just wait for that one to occur.
|
||||
* */
|
||||
/** timer scaled to SNR of to be flooded packet */
|
||||
void startTransmitTimerSNR(float snr);
|
||||
|
||||
void handleTransmitInterrupt();
|
||||
|
||||
Reference in New Issue
Block a user