From 2b28296c942fd4c624414924cb259d0b76a68f1b Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 28 May 2023 22:20:54 +0200 Subject: [PATCH] [SX128x] Added default startReceive method --- src/modules/SX126x/SX126x.cpp | 4 ++++ src/modules/SX126x/SX126x.h | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 9d0c1aec..6dbb4af2 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -539,6 +539,10 @@ int16_t SX126x::finishTransmit() { return(standby()); } +int16_t SX126x::startReceive() { + return(this->startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF, RADIOLIB_SX126X_IRQ_RX_DEFAULT, RADIOLIB_SX126X_IRQ_RX_DONE, 0)); +} + int16_t SX126x::startReceive(uint32_t timeout, uint16_t irqFlags, uint16_t irqMask, size_t len) { (void)len; int16_t state = startReceiveCommon(timeout, irqFlags, irqMask); diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index e685338a..da1de755 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -588,6 +588,14 @@ class SX126x: public PhysicalLayer { \returns \ref status_codes */ int16_t finishTransmit() override; + + /*! + \brief Interrupt-driven receive method with default parameters. + Implemented for compatibility with PhysicalLayer. + + \returns \ref status_codes + */ + int16_t startReceive(); /*! \brief Interrupt-driven receive method. DIO1 will be activated when full packet is received. @@ -599,12 +607,12 @@ class SX126x: public PhysicalLayer { For any other value, timeout will be applied and signal will be generated on DIO1 for conditions defined by irqFlags and irqMask. - \param irqFlags Sets the IRQ flags, defaults to RADIOLIB_SX126X_IRQ_RX_DEFAULT. - \param irqMask Sets the mask of IRQ flags that will trigger DIO1, defaults to RADIOLIB_SX126X_IRQ_RX_DONE. + \param irqFlags Sets the IRQ flags. + \param irqMask Sets the mask of IRQ flags that will trigger DIO1. \param len Only for PhysicalLayer compatibility, not used. \returns \ref status_codes */ - int16_t startReceive(uint32_t timeout = RADIOLIB_SX126X_RX_TIMEOUT_INF, uint16_t irqFlags = RADIOLIB_SX126X_IRQ_RX_DEFAULT, uint16_t irqMask = RADIOLIB_SX126X_IRQ_RX_DONE, size_t len = 0); + int16_t startReceive(uint32_t timeout, uint16_t irqFlags, uint16_t irqMask, size_t len); /*! \brief Interrupt-driven receive method where the device mostly sleeps and periodically wakes to listen.