Skip to main content

Module lbt

Module lbt 

Source
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§

ScanTime
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_status waits.
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.