mirror of
https://github.com/manuelbl/ttn-esp32.git
synced 2025-06-15 04:14:28 +02:00
Enable/disable ADR
This commit is contained in:
parent
513ac44268
commit
b73ed23a97
@ -221,12 +221,29 @@ public:
|
|||||||
*
|
*
|
||||||
* This value is added to RSSI measured prior to decision. It must include the guardband.
|
* This value is added to RSSI measured prior to decision. It must include the guardband.
|
||||||
* Ignored in US, EU, IN and other countries where LBT is not required.
|
* Ignored in US, EU, IN and other countries where LBT is not required.
|
||||||
* Default to 10 dB.
|
* Defaults to 10 dB.
|
||||||
*
|
*
|
||||||
* @param rssiCal RSSI calibration value, in dB
|
* @param rssiCal RSSI calibration value, in dB
|
||||||
*/
|
*/
|
||||||
void setRSSICal(int8_t rssiCal);
|
void setRSSICal(int8_t rssiCal);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether Adaptive Data Rate (ADR) is enabled.
|
||||||
|
* @return true if enabled
|
||||||
|
* @return false if disabled
|
||||||
|
*/
|
||||||
|
bool adrEnabled();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables or disabled Adaptive Data Rate (ADR).
|
||||||
|
*
|
||||||
|
* ADR is enabled by default. It optimizes data rate, airtime and energy consumption
|
||||||
|
* for devices with stable RF conditions. It should be turned off for mobile devices.
|
||||||
|
*
|
||||||
|
* @param enabled `true` to enable, `false` to disable
|
||||||
|
*/
|
||||||
|
void setAdrEnabled(bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTNMessageCallback messageCallback;
|
TTNMessageCallback messageCallback;
|
||||||
|
|
||||||
|
@ -265,6 +265,16 @@ void TheThingsNetwork::setRSSICal(int8_t rssiCal)
|
|||||||
ttn_hal.rssiCal = rssiCal;
|
ttn_hal.rssiCal = rssiCal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TheThingsNetwork::adrEnabled()
|
||||||
|
{
|
||||||
|
return LMIC.adrEnabled != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TheThingsNetwork::setAdrEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
LMIC_setAdrMode(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// --- Callbacks ---
|
// --- Callbacks ---
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user