diff --git a/src/TypeDef.h b/src/TypeDef.h index e2d8c914..50173814 100644 --- a/src/TypeDef.h +++ b/src/TypeDef.h @@ -63,6 +63,31 @@ \} */ +/*! + \defgroup config_standby Standby mode type aliases. + + \{ +*/ + +/*! + \brief Default standby used by the module +*/ +#define RADIOLIB_STANDBY_DEFAULT (0x00) + +/*! + \brief Warm standby (e.g. crystal left running). +*/ +#define RADIOLIB_STANDBY_WARM (0x01) + +/*! + \brief Cold standby (e.g. only internal RC oscillator running). +*/ +#define RADIOLIB_STANDBY_COLD (0x02) + +/*! + \} +*/ + /*! \defgroup status_codes Status Codes diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp index 7d45f9e0..48704bee 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp +++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp @@ -111,6 +111,10 @@ int16_t PhysicalLayer::receive(uint8_t* data, size_t len) { } int16_t PhysicalLayer::standby() { + return(standby(RADIOLIB_STANDBY_DEFAULT)); +} + +int16_t PhysicalLayer::standby(uint8_t mode) { return(RADIOLIB_ERR_UNSUPPORTED); } diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.h b/src/protocols/PhysicalLayer/PhysicalLayer.h index a5886f53..aad936f8 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.h +++ b/src/protocols/PhysicalLayer/PhysicalLayer.h @@ -91,6 +91,13 @@ class PhysicalLayer { */ virtual int16_t standby(); + /*! + \brief Sets module to a specific standby mode. + + \returns \ref status_codes + */ + virtual int16_t standby(uint8_t mode); + /*! \brief Binary receive method. Must be implemented in module class.