From a2ca3621762fc2bafd66a8a8a4a4ff36810ddad2 Mon Sep 17 00:00:00 2001 From: jgromes Date: Fri, 25 Oct 2024 20:47:28 +0100 Subject: [PATCH] [PHY] Added set modem method --- src/protocols/PhysicalLayer/PhysicalLayer.cpp | 5 +++++ src/protocols/PhysicalLayer/PhysicalLayer.h | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp index 82eb5fba..32071f59 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp +++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp @@ -531,6 +531,11 @@ void PhysicalLayer::clearChannelScanAction() { } +int16_t PhysicalLayer::setModem(ModemType_t modem) { + (void)modem; + return(RADIOLIB_ERR_UNSUPPORTED); +} + #if RADIOLIB_INTERRUPT_TIMING void PhysicalLayer::setInterruptSetup(void (*func)(uint32_t)) { Module* mod = getMod(); diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.h b/src/protocols/PhysicalLayer/PhysicalLayer.h index c463e8b2..52b84963 100644 --- a/src/protocols/PhysicalLayer/PhysicalLayer.h +++ b/src/protocols/PhysicalLayer/PhysicalLayer.h @@ -130,6 +130,16 @@ union ChannelScanConfig_t { RSSIScanConfig_t rssi; }; +/*! + \enum ModemType_t + \brief Type of modem, used by setModem. +*/ +enum ModemType_t { + FSK = 0, + LoRa, + LRFHSS, +}; + /*! \class PhysicalLayer @@ -644,6 +654,14 @@ class PhysicalLayer { */ virtual void clearChannelScanAction(); + /*! + \brief Set modem for the radio to use. Will perform full reset and reconfigure the radio + using its default parameters. + \param modem Modem type to set. Not all modems are implemented by all radio modules! + \returns \ref status_codes + */ + virtual int16_t setModem(ModemType_t modem); + #if RADIOLIB_INTERRUPT_TIMING /*!