Skip to content

Commit

Permalink
removed GSM_STAY_ONLINE option
Browse files Browse the repository at this point in the history
  • Loading branch information
ppescher committed Aug 8, 2016
1 parent fa5ac88 commit b9e6533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
35 changes: 6 additions & 29 deletions OpenTracker/gsm.ino
Original file line number Diff line number Diff line change
Expand Up @@ -345,37 +345,14 @@ int gsm_get_modem_status() {
}

int gsm_disconnect() {
int ret = 0;
#if GSM_STAY_ONLINE
debug_print(F("gsm_disconnect() disabled"));

//close connection, if previous attempts left it open
gsm_port.print("AT+QICLOSE");
gsm_port.print("\r");
gsm_wait_for_reply(0,0);

ret = 1;
#else
debug_print(F("gsm_disconnect() started"));

//disconnect GSM
gsm_port.print("AT+QIDEACT");
gsm_port.print("\r");
gsm_wait_for_reply(0,0);

//check if result contains DEACT OK
char *tmp = strstr(modem_reply, "DEACT OK");

if(tmp!=NULL) {
debug_print(F("gsm_disconnect(): DEACT OK found"));
ret = 1;
} else {
debug_print(F("gsm_disconnect(): DEACT OK not found."));
}
#endif
debug_print(F("gsm_disconnect() started"));

//close connection, if previous attempts left it open
gsm_port.print("AT+QICLOSE\r");
gsm_wait_for_reply(0,0);

debug_print(F("gsm_disconnect() completed"));
return ret;
return 1;
}

int gsm_set_apn() {
Expand Down
1 change: 0 additions & 1 deletion OpenTracker/tracker.h.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#define GSM_MODEM_COMMAND_TIMEOUT 10
#define GSM_SEND_FAILURES_REBOOT 30 // 0=disabled, increase to set the number of GSM failures that will trigger a reboot of the opentracker device
#define GSM_STAY_ONLINE 1 // 0=disconnect GPRS session after each send (Default). 1=keep data session active, only close TCP connection

#define ENGINE_RUNNING_LOG_FAST_AS_POSSIBLE 0 // 1=when the engine is running send interval is ignored

Expand Down

0 comments on commit b9e6533

Please sign in to comment.