[SX126x] Use a default of either 8 or 12 for minSymbols in startReceiveDutyCycleAuto (#1600)

* [SX126x] Update doc of startReceiveDutyCycleAuto

Note that the minimum preamble size should be set to 12 for SF5-6.

* [SX126x] Set default for minSymbols in startReceiveDutyCycleAuto

Change default argument value to 0, then set min symbols to
8 or 12 as appropriate.
pull/1604/head
Chris Leishman 2025-09-17 08:24:33 -07:00 zatwierdzone przez GitHub
rodzic 804470eff1
commit e23bae3bbd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 13 dodań i 5 usunięć

Wyświetl plik

@ -555,6 +555,13 @@ int16_t SX126x::startReceiveDutyCycleAuto(uint16_t senderPreambleLength, uint16_
if(senderPreambleLength == 0) {
senderPreambleLength = this->preambleLengthLoRa;
}
if(minSymbols == 0) {
if (this->spreadingFactor <= 6) {
minSymbols = 12;
} else {
minSymbols = 8;
}
}
// worst case is that the sender starts transmitting when we're just less than minSymbols from going back to sleep.
// in this case, we don't catch minSymbols before going to sleep,

Wyświetl plik

@ -727,16 +727,17 @@ class SX126x: public PhysicalLayer {
If the sender preamble length is variable or unknown, the maximum expected size should be configured
on the receiver side by calling setPreambleLength prior to startReceiveDutyCycleAuto.
\param minSymbols Parameters will be chosen to ensure that the unit will catch at least this many symbols
of any preamble of the specified length. Defaults to 8.
According to Semtech, receiver requires 8 symbols to reliably latch a preamble.
This makes this method redundant when transmitter preamble length is less than 17 (2*minSymbols + 1).
\param minSymbols Ensure that the unit will catch at least this many symbols of any preamble of the specified senderPreambleLength.
To reliably latch a preamble, the receiver requires 8 symbols for SF7-12 and 12 symbols for SF5-6 (see datasheet section 6.1.1.1, version 1.2).
If set to zero, the minimum required symbols will be used. Defaults to 0.
If senderPreambleLength is less than 2*minSymbols + 1, this method is equivalent to startReceive().
\param irqFlags Sets the IRQ flags, defaults to RX done, RX timeout, CRC error and header error.
\param irqMask Sets the mask of IRQ flags that will trigger DIO1, defaults to RX done.
\returns \ref status_codes
*/
int16_t startReceiveDutyCycleAuto(uint16_t senderPreambleLength = 0, uint16_t minSymbols = 8, RadioLibIrqFlags_t irqFlags = RADIOLIB_IRQ_RX_DEFAULT_FLAGS, RadioLibIrqFlags_t irqMask = RADIOLIB_IRQ_RX_DEFAULT_MASK);
int16_t startReceiveDutyCycleAuto(uint16_t senderPreambleLength = 0, uint16_t minSymbols = 0, RadioLibIrqFlags_t irqFlags = RADIOLIB_IRQ_RX_DEFAULT_FLAGS, RadioLibIrqFlags_t irqMask = RADIOLIB_IRQ_RX_DEFAULT_MASK);
/*!
\brief Reads data received after calling startReceive method. When the packet length is not known in advance,