From 0e694f3985652697b23550d5a20ae7ef109437d9 Mon Sep 17 00:00:00 2001 From: jgromes Date: Wed, 28 Aug 2024 19:26:26 +0200 Subject: [PATCH] [SX127x] Added default startReceive arguments --- .../SX127x_Channel_Activity_Detection_Receive.ino | 4 ++-- src/modules/SX127x/SX127x.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino b/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino index 35f9d40d..f78d747a 100644 --- a/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino +++ b/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino @@ -168,9 +168,9 @@ void loop() { // check if we got a preamble if(detectedFlag) { - // LoRa preamble was detected + // LoRa preamble was detected, start reception with timeout of 100 LoRa symbols Serial.print(F("[SX1278] Preamble detected, starting reception ... ")); - state = radio.startReceive(0, RADIOLIB_SX127X_RXSINGLE); + state = radio.startReceive(100); if (state == RADIOLIB_ERR_NONE) { Serial.println(F("success!")); } else { diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h index a1df97e0..94db00ab 100644 --- a/src/modules/SX127x/SX127x.h +++ b/src/modules/SX127x/SX127x.h @@ -811,7 +811,7 @@ class SX127x: public PhysicalLayer { \returns \ref status_codes */ int16_t startReceive() override; - + /*! \brief Interrupt-driven receive method, implemented for compatibility with PhysicalLayer. \param timeout Receive mode type and/or raw timeout value in symbols. @@ -823,7 +823,7 @@ class SX127x: public PhysicalLayer { \param len Expected length of packet to be received. Required for LoRa spreading factor 6. \returns \ref status_codes */ - int16_t startReceive(uint32_t timeout, RadioLibIrqFlags_t irqFlags, RadioLibIrqFlags_t irqMask, size_t len) override; + int16_t startReceive(uint32_t timeout, RadioLibIrqFlags_t irqFlags = RADIOLIB_IRQ_RX_DEFAULT_FLAGS, RadioLibIrqFlags_t irqMask = RADIOLIB_IRQ_RX_DEFAULT_MASK, size_t len = 0) override; /*! \brief Reads data that was received after calling startReceive method. When the packet length is not known in advance,