From e3cb66efd5f73f825358899f4b68f61c05ee09df Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 9 Sep 2020 11:34:12 -0400 Subject: [PATCH 1/2] add disconnect method to fona --- src/AdafruitIO_FONA.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/AdafruitIO_FONA.h b/src/AdafruitIO_FONA.h index 393756fc..b740e555 100644 --- a/src/AdafruitIO_FONA.h +++ b/src/AdafruitIO_FONA.h @@ -123,6 +123,18 @@ class AdafruitIO_FONA : public AdafruitIO { _status = AIO_NET_DISCONNECTED; } + + /**************************************************************************/ + /*! + @brief Disconnects from Adafruit IO and the cellular network. + */ + /**************************************************************************/ + void _disconnect() { + if (!_fona->enableGPRS(false)) { + AIO_DEBUG_PRINTLN("Failed to turn off GPRS."); + } + _status = AIO_NET_DISCONNECTED; + } }; #endif // ADAFRUITIO_FONA_H From fc40d715c3c684b02a09bf630f549ecf4aa37a3d Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 9 Sep 2020 11:52:57 -0400 Subject: [PATCH 2/2] satisfy clang --- src/AdafruitIO_FONA.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AdafruitIO_FONA.h b/src/AdafruitIO_FONA.h index b740e555..d60f7833 100644 --- a/src/AdafruitIO_FONA.h +++ b/src/AdafruitIO_FONA.h @@ -130,10 +130,10 @@ class AdafruitIO_FONA : public AdafruitIO { */ /**************************************************************************/ void _disconnect() { - if (!_fona->enableGPRS(false)) { - AIO_DEBUG_PRINTLN("Failed to turn off GPRS."); - } - _status = AIO_NET_DISCONNECTED; + if (!_fona->enableGPRS(false)) { + AIO_DEBUG_PRINTLN("Failed to turn off GPRS."); + } + _status = AIO_NET_DISCONNECTED; } };