Browse Source

Add poweroff

v_master
Volodymyr Shymanskyy 7 years ago
parent
commit
4908d78f62
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      examples/AllFunctions/AllFunctions.ino

+ 10
- 4
examples/AllFunctions/AllFunctions.ino View File

@ -30,6 +30,7 @@
//#define DUMP_AT_COMMANDS //#define DUMP_AT_COMMANDS
#define TINY_GSM_DEBUG SerialMon
// Set phone numbers, if you want to test SMS and Calls // Set phone numbers, if you want to test SMS and Calls
//#define SMS_TARGET "+380xxxxxxxxx" //#define SMS_TARGET "+380xxxxxxxxx"
@ -70,6 +71,9 @@ void loop() {
return; return;
} }
String modemInfo = modem.getModemInfo();
DBG("Modem:", modemInfo);
// Unlock your SIM card with a PIN // Unlock your SIM card with a PIN
//modem.simUnlock("1234"); //modem.simUnlock("1234");
@ -87,9 +91,6 @@ void loop() {
bool res; bool res;
String modemInfo = modem.getModemInfo();
DBG("Modem:", modemInfo);
String ccid = modem.getSimCCID(); String ccid = modem.getSimCCID();
DBG("CCID:", ccid); DBG("CCID:", ccid);
@ -147,9 +148,14 @@ void loop() {
modem.gprsDisconnect(); modem.gprsDisconnect();
DBG("GPRS disconnected"); DBG("GPRS disconnected");
// Try to power-off (modem may decide to restart automatically)
// To turn off modem completely, please use Reset/Enable pins
modem.poweroff();
DBG("Poweroff.");
// Do nothing forevermore // Do nothing forevermore
while (true) { while (true) {
delay(1000);
modem.maintain();
} }
} }

Loading…
Cancel
Save