|
Arduino LMIC 6.0.1
Arduino LoRaWAN(r) MAC in C
|
The LMIC radio driver operates asynchronously. Operations are started by calling the os_radio() function with a parameter describing the operation to be performed.
Various parameters in the LMIC structure are as input to control the operation; others are updated to return results.
The radio is reset, and put to sleep. This operation is synchronous.
A frame is transmitted. The parameters are given in "Common parameters" and "Transmit parameters" below.
When the operation completes, LMIC.osjob is scheduled.
A single frame is received at the specified time, and the radio is put back to sleep if no frame is found.
When the operation completes, LMIC.osjob is scheduled.
The radio is placed in continuous receive mode. If a frame is received, LMIC.osjob is scheduled. Continuous receive is explicitly canceled by calling os_radio(RADIO_RST) or implicitly by calling any other radio function.
This operation is not supported in FSK mode.
This operation is identical to os_radio(RADIO_RXON), but redundant calls are suppressed. That is, if the radio is already in receive mode, the radio stays in receive mode without any change in state. In contrast, RADIO_RXON expects the radio to be idle, and will issue an assertion failure if the radio is in any other state.
This is like os_radio(RADIO_TX), but the transmission is scheduled at LMIC.txend.
This is the "radio parameter setting", and it encodes several radio settings.
This specifies the frequency, in Hertz.
Updated for LoRa operations only; the IRQ flags at the time of interrupt.
When asynchronous operations complete, LMIC.radio.pRadioDoneJob->func is used as the callback function, and LMIC.radio.pRadioDoneJob is used to schedule the work.
This specifies the transmit power in dBm.
The array of data to be sent.
The length of the array to be sent.
For RADIO_TX_AT, an input parameter, for the scheduled TX time.
For all transmissions, updated to the OS time at which the TX end interrupt was recognized.
How long to monitor for LBT, in OS ticks.
Maximum RSSI on channel before transmit.
Filled with data received.
Set to number of bytes received in total.
Input: When to start receiving, in OS tick time. Only used for os_radio(RADIO_RX); not used for continuous receive.
Output: time of RXDONE interrupt. (Note: FSK timeout doesn't currently set this cell on RX timeout.)
The timeout in symbols. Only used for os_radio(RADIO_RX); not used for continuous receive.
If the bit LMIC_RADIO_FLAGS_NO_RX_IQ_INVERSION is set, disable IQ inversion during receive.
Set to SNR * 4 after LoRa receive. (Set to 0 for FSK receive.)
Set to RSSI + RSSI_OFF after LoRa receive. (Set to 0 for FSK receive; RSSI_OFF is 64.) You must subtract RSSI_OFF from LMIC.rssi to get the RSSI in dB.