From e92ff2a91785cb5d85b62aa8dd601272464641fd Mon Sep 17 00:00:00 2001 From: Aaron Covrig Date: Tue, 16 Jun 2020 14:50:59 -0400 Subject: [PATCH] Enabling ADR selection --- include/TheThingsNetwork.h | 8 +++++++- src/TheThingsNetwork.cpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/TheThingsNetwork.h b/include/TheThingsNetwork.h index 0394076..527e519 100644 --- a/include/TheThingsNetwork.h +++ b/include/TheThingsNetwork.h @@ -303,7 +303,13 @@ public: bool selectSubBand(uint8_t band); //void setDrTxpow (dr_t dr, s1_t txpow); // set default/start DR/txpow - //void setAdrMode (bit_t enabled); // set ADR mode (if mobile turn off) + + /* + * @brief Enables or disables automatic data rate (ADR) for the device + * + * @param enabled boolean, when asserted true, ADR mode is enabled + */ + void setAdrMode (bool enabled); // set ADR mode (if mobile turn off) private: TTNMessageCallback messageCallback; diff --git a/src/TheThingsNetwork.cpp b/src/TheThingsNetwork.cpp index 11e751b..2d0e6e3 100644 --- a/src/TheThingsNetwork.cpp +++ b/src/TheThingsNetwork.cpp @@ -270,6 +270,8 @@ bool TheThingsNetwork::enableChannel(uint8_t channel){ return LMIC_enableChannel bool TheThingsNetwork::disableSubBand(uint8_t band){ return LMIC_disableSubBand( band ); } bool TheThingsNetwork::selectSubBand(uint8_t band){ return LMIC_selectSubBand( band ); } +void TheThingsNetwork::setAdrMode( bool adr){ LMIC_setAdrMode( adr ); } + // --- Callbacks ---