diff --git a/keywords.txt b/keywords.txt index a50032e3..ace5e993 100644 --- a/keywords.txt +++ b/keywords.txt @@ -286,6 +286,7 @@ clearPacketReceivedAction KEYWORD2 setPacketSentAction KEYWORD2 clearPacketSentAction KEYWORD2 setDataRate KEYWORD2 +checkDataRate KEYWORD2 # BellModem setModem KEYWORD2 diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp index 8b999325..f5ca56ca 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp +++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp @@ -272,6 +272,11 @@ int16_t PhysicalLayer::setDataRate(DataRate_t dr) { return(RADIOLIB_ERR_UNSUPPORTED); } +int16_t PhysicalLayer::checkDataRate(DataRate_t dr) { + (void)dr; + return(RADIOLIB_ERR_UNSUPPORTED); +} + float PhysicalLayer::getFreqStep() const { return(this->freqStep); } diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.h b/src/protocols/PhysicalLayer/PhysicalLayer.h index 513a3e1d..4847b826 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.h +++ b/src/protocols/PhysicalLayer/PhysicalLayer.h @@ -278,6 +278,13 @@ class PhysicalLayer { */ virtual int16_t setDataRate(DataRate_t dr); + /*! + \brief Check the data rate can be configured by this module. Must be implemented in module class if the module supports it. + \param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa). + \returns \ref status_codes + */ + virtual int16_t checkDataRate(DataRate_t dr); + /*! \brief Gets the module frequency step size that was set in constructor. \returns Synthesizer frequency step size in Hz.