Expand description
Listening before talking, on the SX1261 beside the concentrator.
Some bands forbid transmitting into a channel somebody else is already using. The concentrator cannot check for itself while it is busy receiving, so a gateway that needs this carries a second radio, an SX1261, wired to the same bus behind the concentrator. It samples the channel, compares what it hears against a threshold, and the concentrator asks it for permission before a trigger is armed.
That radio takes commands rather than register writes: an opcode byte, then its payload. This module builds those frames and reads the answers back. It opens no bus.
Two conversions here are worth stating plainly, because neither is what the numbers look like. A threshold in dBm is written as a doubled negative, so -80 dBm goes out as 160. And a scan time is not a duration the radio counts: it is a number of samples, and only two durations have one, so anything else is refused rather than rounded.
Re-exports§
pub use super::sx1261::REG_RSSI_WINDOW;
Structs§
- Channel
- A channel a gateway checks before it transmits on it.
Enums§
- Scan
Time - How long the radio listens for before it answers.
Constants§
- ACKNOWLEDGE_
CLEARED - What it writes once the status reads clear, to acknowledge it.
- CLEAR_
TRANSMIT_ STATUS - What the host writes to the gain control’s first mailbox to clear a transmit status.
- FREQUENCY_
TOLERANCE_ HZ - How far a transmission’s carrier may be from a check channel’s and still be that channel, in hertz. The reference allows ten kilohertz, since carriers pass through floating point on their way from a configuration file.
- GPIO_ID
- Which of the radio’s pins reports the answer back to the concentrator.
- OP_
LBT_ START - The command that starts a carrier check.
- OP_
SET_ FS - The command that puts the radio in frequency synthesis mode, which ends a check.
- OP_
SPECTRAL_ SCAN - The command that starts a spectral scan.
- OP_
WRITE_ REGISTER - The command that writes one of the radio’s own registers.
- OUTCOME_
POLLS - How many one-millisecond polls a checked transmission is given to start, and then its
status to clear: half a second each, as Semtech’s
lgw_lbt_tx_statuswaits. - SAMPLE_
INTERVAL - How long the radio waits between the samples it takes, as the radio counts it.
- SCAN_
RESULTS - How many results a spectral scan returns.
- SENSE_
LEAD_ US - How long before a packet leaves the concentrator reads the check’s answer, in microseconds, which a channel’s transmit time has to leave room for.
Functions§
- refused
- Whether the carrier check kept a started transmission off the air.
- spectral_
scan - Builds the command that starts a spectral scan.
- start
- Builds the command that starts a carrier check.
- started
- Whether the gain control reports that a transmission has started on a chain.
- stop
- Builds the two commands that end a carrier check.
- threshold_
byte - Writes a threshold the way the radio takes it.
- threshold_
dbm - Reads a threshold byte back as decibels.