mirror of
https://github.com/manuelbl/ttn-esp32.git
synced 2025-06-15 12:24:27 +02:00
add shutdown_method to ttn in order reduce power consumption while in deep sleep
This commit is contained in:
parent
e29477fa7e
commit
ba9c28e038
@ -72,6 +72,12 @@ public:
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* @brief Shutdown the LoRaWAN radio and reduce power consumption
|
||||
*
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* @brief Configures the pins used to communicate with the LoRaWAN radio chip.
|
||||
*
|
||||
|
@ -118,6 +118,18 @@ void TheThingsNetwork::reset()
|
||||
ttn_hal.leaveCriticalSection();
|
||||
}
|
||||
|
||||
void TheThingsNetwork::shutdown()
|
||||
{
|
||||
ttn_hal.enterCriticalSection();
|
||||
LMIC_shutdown();
|
||||
waitingReason = eWaitingNone;
|
||||
if (lmicEventQueue != nullptr)
|
||||
{
|
||||
xQueueReset(lmicEventQueue);
|
||||
}
|
||||
ttn_hal.leaveCriticalSection();
|
||||
}
|
||||
|
||||
bool TheThingsNetwork::provision(const char *devEui, const char *appEui, const char *appKey)
|
||||
{
|
||||
if (!provisioning.decodeKeys(devEui, appEui, appKey))
|
||||
|
Loading…
Reference in New Issue
Block a user