diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp index 84d82832..5c9b697c 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp +++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp @@ -289,6 +289,10 @@ float PhysicalLayer::getSNR() { return(RADIOLIB_ERR_UNSUPPORTED); } +int16_t PhysicalLayer::scanChannel() { + return(RADIOLIB_ERR_UNSUPPORTED); +} + int32_t PhysicalLayer::random(int32_t max) { if(max == 0) { return(0); diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.h b/src/protocols/PhysicalLayer/PhysicalLayer.h index fa0ec231..ef5dd93e 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.h +++ b/src/protocols/PhysicalLayer/PhysicalLayer.h @@ -302,6 +302,14 @@ class PhysicalLayer { */ virtual float getSNR(); + /*! + \brief Check whether the current communication channel is free or occupied. Performs CAD for LoRa modules, + or RSSI measurement for FSK modules. + \returns RADIOLIB_CHANNEL_FREE when channel is free, + RADIOLIB_PREAMBLE_DETECTEDwhen occupied or other \ref status_codes. + */ + virtual int16_t scanChannel(); + /*! \brief Get truly random number in range 0 - max. \param max The maximum value of the random number (non-inclusive).