Skip to content

Commit 926a4ff

Browse files
authored
Merge pull request #135 from brentru/fix-fona-disconnect-err
Add _disconnect function to AdafruitIO_FONA.h
2 parents a5f380e + fc40d71 commit 926a4ff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/AdafruitIO_FONA.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ class AdafruitIO_FONA : public AdafruitIO {
123123

124124
_status = AIO_NET_DISCONNECTED;
125125
}
126+
127+
/**************************************************************************/
128+
/*!
129+
@brief Disconnects from Adafruit IO and the cellular network.
130+
*/
131+
/**************************************************************************/
132+
void _disconnect() {
133+
if (!_fona->enableGPRS(false)) {
134+
AIO_DEBUG_PRINTLN("Failed to turn off GPRS.");
135+
}
136+
_status = AIO_NET_DISCONNECTED;
137+
}
126138
};
127139

128140
#endif // ADAFRUITIO_FONA_H

0 commit comments

Comments
 (0)