From 54b442ce14978da6ade5f9091c54d1593a066fda Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 2 Feb 2011 23:02:48 +0000 Subject: [PATCH] Let the GPRS plug-in disconnect from the network again --- src/gsm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gsm.c b/src/gsm.c index ea0f55e..7c4f23e 100644 --- a/src/gsm.c +++ b/src/gsm.c @@ -996,12 +996,6 @@ GSMCommand * gsm_queue(GSM * gsm, char const * command) if(command == NULL || command[0] == '\0') return NULL; - if(gsm->mode == GSM_MODE_DATA && strcmp(command, "ATH") == 0) /* XXX */ - { - gsm_event(gsm, GSM_EVENT_TYPE_GPRS_ATTACHMENT, 0); - gsm_reset(gsm, 0, NULL); - return NULL; - } if((gsmc = gsm_command_new(command)) == NULL) return NULL; if(gsm_queue_command(gsm, gsmc) == 0) @@ -1017,9 +1011,17 @@ int gsm_queue_command(GSM * gsm, GSMCommand * gsmc) GSMPriority priority; GSList * l; GSMCommand * p; + char const * q; if(gsmc == NULL) return 1; + if(gsm->mode == GSM_MODE_DATA && (p = gsm_command_get_command(gsmc)) + && strcmp(p, "ATH") == 0) /* XXX */ + { + gsm_event(gsm, GSM_EVENT_TYPE_GPRS_ATTACHMENT, 0); + gsm_reset(gsm, 0, NULL); + return 0; + } /* the GSM_PRIORITY_HIGHEST priority is meant to avoid races */ if((priority = gsm_command_get_priority(gsmc)) > GSM_PRIORITY_HIGH) priority = GSM_PRIORITY_HIGH;