Added a command to attach to the GPRS network

This commit is contained in:
Pierre Pronchery 2011-01-04 16:51:12 +00:00
parent 91b5e7177f
commit afa14f0d9f
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/* $Id$ */ /* $Id$ */
/* Copyright (c) 2010 Pierre Pronchery <khorben@defora.org> */ /* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Phone */ /* This file is part of DeforaOS Desktop Phone */
/* This program is free software: you can redistribute it and/or modify /* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -806,6 +806,16 @@ static void _modem_set_functional_callback(GSM * gsm)
} }
/* gsm_modem_set_gprs_attach */
int gsm_modem_set_gprs_attach(GSMModem * gsmm, gboolean set)
{
char cmd[] = "AT+CGATT=X";
cmd[9] = set ? '1' : '0';
return (gsm_queue(gsmm->gsm, cmd) != NULL) ? 0 : 1;
}
/* gsm_modem_set_message_format */ /* gsm_modem_set_message_format */
int gsm_modem_set_message_format(GSMModem * gsmm, GSMMessageFormat format) int gsm_modem_set_message_format(GSMModem * gsmm, GSMMessageFormat format)
{ {

View File

@ -97,6 +97,7 @@ int gsm_modem_set_extended_errors(GSMModem * gsmm, gboolean extended);
int gsm_modem_set_extended_ring_reports(GSMModem * gsmm, gboolean extended); int gsm_modem_set_extended_ring_reports(GSMModem * gsmm, gboolean extended);
int gsm_modem_set_line_presentation(GSMModem * gsmm, gboolean set); int gsm_modem_set_line_presentation(GSMModem * gsmm, gboolean set);
int gsm_modem_set_functional(GSMModem * gsmm, gboolean functional); int gsm_modem_set_functional(GSMModem * gsmm, gboolean functional);
int gsm_modem_set_gprs_attach(GSMModem * gsmm, gboolean set);
int gsm_modem_set_message_format(GSMModem * gsmm, GSMMessageFormat format); int gsm_modem_set_message_format(GSMModem * gsmm, GSMMessageFormat format);
int gsm_modem_set_message_indications(GSMModem * gsmm, GSMMessageMode mode, int gsm_modem_set_message_indications(GSMModem * gsmm, GSMMessageMode mode,
gboolean unsollicited); gboolean unsollicited);