Added a callback when setting the GPRS network attachment status
This commit is contained in:
parent
7dd0006ba2
commit
8a4b58698e
8
po/fr.po
8
po/fr.po
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Phone 0.0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-04 18:53+0100\n"
|
||||
"POT-Creation-Date: 2011-01-04 22:44+0100\n"
|
||||
"PO-Revision-Date: 2010-04-24 02:07+0200\n"
|
||||
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
|
||||
"Language-Team: French\n"
|
||||
@ -112,8 +112,8 @@ msgstr "Délai d'attente du réseau dépassé"
|
||||
msgid "Network not allowed - emergency calls only"
|
||||
msgstr "Réseau non autorisé - appels d'urgence uniquement"
|
||||
|
||||
#: ../src/gsm.c:172 ../src/gsm.c:1273 ../src/gsm.c:1524 ../src/gsm.c:1584
|
||||
#: ../src/gsm.c:2126
|
||||
#: ../src/gsm.c:172 ../src/gsm.c:1280 ../src/gsm.c:1531 ../src/gsm.c:1591
|
||||
#: ../src/gsm.c:2133
|
||||
msgid "Unknown error"
|
||||
msgstr "Erreur inconnue"
|
||||
|
||||
@ -193,7 +193,7 @@ msgstr "Conflit dans la syntaxe de commande"
|
||||
msgid ": Unknown baudrate, assuming 115200"
|
||||
msgstr ": Débit inconnu, tente 115200"
|
||||
|
||||
#: ../src/gsm.c:1112
|
||||
#: ../src/gsm.c:1119
|
||||
msgid "Event not handled"
|
||||
msgstr "Événement non géré"
|
||||
|
||||
|
@ -858,6 +858,13 @@ int gsm_is_functional(GSM * gsm)
|
||||
}
|
||||
|
||||
|
||||
/* gsm_is_gprs_attached */
|
||||
int gsm_is_gprs_attached(GSM * gsm)
|
||||
{
|
||||
return gsm_modem_is_gprs_attached(gsm->modem);
|
||||
}
|
||||
|
||||
|
||||
/* gsm_is_mute */
|
||||
int gsm_is_mute(GSM * gsm)
|
||||
{
|
||||
|
@ -431,6 +431,7 @@ int gsm_message_send(GSM * gsm, char const * number, GSMEncoding encoding,
|
||||
int gsm_is_alive(GSM * gsm);
|
||||
int gsm_is_call_waiting_control(GSM * gsm);
|
||||
int gsm_is_functional(GSM * gsm);
|
||||
int gsm_is_gprs_attached(GSM * gsm);
|
||||
int gsm_is_mute(GSM * gsm);
|
||||
int gsm_is_phone_active(GSM * gsm);
|
||||
int gsm_is_pin_needed(GSM * gsm);
|
||||
|
20
src/modem.c
20
src/modem.c
@ -464,6 +464,15 @@ int gsm_modem_is_functional(GSMModem * gsmm)
|
||||
}
|
||||
|
||||
|
||||
/* gsm_modem_is_gprs_attached */
|
||||
int gsm_modem_is_gprs_attached(GSMModem * gsmm)
|
||||
{
|
||||
char const cmd[] = "AT+CGATT?";
|
||||
|
||||
return (gsm_queue(gsmm->gsm, cmd) != NULL) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
/* gsm_modem_is_mute */
|
||||
int gsm_modem_is_mute(GSMModem * gsmm)
|
||||
{
|
||||
@ -807,12 +816,21 @@ static void _modem_set_functional_callback(GSM * gsm)
|
||||
|
||||
|
||||
/* gsm_modem_set_gprs_attachment */
|
||||
static void _modem_set_gprs_attachment_callback(GSM * gsm);
|
||||
|
||||
int gsm_modem_set_gprs_attachment(GSMModem * gsmm, gboolean set)
|
||||
{
|
||||
char cmd[] = "AT+CGATT=X";
|
||||
|
||||
cmd[9] = set ? '1' : '0';
|
||||
return (gsm_queue(gsmm->gsm, cmd) != NULL) ? 0 : 1;
|
||||
return gsm_queue_full(gsmm->gsm, GSM_PRIORITY_NORMAL, cmd,
|
||||
GSM_ERROR_UNKNOWN, _modem_set_gprs_attachment_callback);
|
||||
}
|
||||
|
||||
static void _modem_set_gprs_attachment_callback(GSM * gsm)
|
||||
{
|
||||
/* did it really work? */
|
||||
gsm_is_gprs_attached(gsm);
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,6 +78,7 @@ int gsm_modem_get_signal_level(GSMModem * gsmm);
|
||||
int gsm_modem_is_alive(GSMModem * gsmm);
|
||||
int gsm_modem_is_call_waiting_control(GSMModem * gsmm);
|
||||
int gsm_modem_is_functional(GSMModem * gsmm);
|
||||
int gsm_modem_is_gprs_attached(GSMModem * gsmm);
|
||||
int gsm_modem_is_mute(GSMModem * gsmm);
|
||||
int gsm_modem_is_phone_active(GSMModem * gsmm);
|
||||
int gsm_modem_is_pin_needed(GSMModem * gsmm);
|
||||
|
Loading…
Reference in New Issue
Block a user