Let the GPRS plug-in disconnect from the network again

This commit is contained in:
Pierre Pronchery 2011-02-02 23:02:48 +00:00
parent 96f4281311
commit 54b442ce14

View File

@ -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;