Working some more on GPRS support
This commit is contained in:
parent
fbcb1b9d0b
commit
3511d5e805
26
po/fr.po
26
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:33+0100\n"
|
||||
"POT-Creation-Date: 2011-01-04 18:53+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:1270 ../src/gsm.c:1494 ../src/gsm.c:1554
|
||||
#: ../src/gsm.c:2096
|
||||
#: ../src/gsm.c:172 ../src/gsm.c:1273 ../src/gsm.c:1524 ../src/gsm.c:1584
|
||||
#: ../src/gsm.c:2126
|
||||
msgid "Unknown error"
|
||||
msgstr "Erreur inconnue"
|
||||
|
||||
@ -189,11 +189,11 @@ msgstr "Vitesse minimum pour les fax"
|
||||
msgid "Conflict with command details"
|
||||
msgstr "Conflit dans la syntaxe de commande"
|
||||
|
||||
#: ../src/gsm.c:392
|
||||
#: ../src/gsm.c:394
|
||||
msgid ": Unknown baudrate, assuming 115200"
|
||||
msgstr ": Débit inconnu, tente 115200"
|
||||
|
||||
#: ../src/gsm.c:1109
|
||||
#: ../src/gsm.c:1112
|
||||
msgid "Event not handled"
|
||||
msgstr "Événement non géré"
|
||||
|
||||
@ -472,35 +472,35 @@ msgstr "Le nom ne peut être vide"
|
||||
msgid "The number cannot be empty"
|
||||
msgstr "Le numéro ne peut être vide"
|
||||
|
||||
#: ../src/phone.c:3153
|
||||
#: ../src/phone.c:3155
|
||||
msgid "New message received"
|
||||
msgstr "Nouveau message reçu"
|
||||
|
||||
#: ../src/phone.c:3169
|
||||
#: ../src/phone.c:3171
|
||||
msgid "Message sent"
|
||||
msgstr "Message envoyé"
|
||||
|
||||
#: ../src/phone.c:3202
|
||||
#: ../src/phone.c:3204
|
||||
msgid "SIM PIN is valid"
|
||||
msgstr "Code SIM PIN valide"
|
||||
|
||||
#: ../src/phone.c:3254
|
||||
#: ../src/phone.c:3256
|
||||
msgid "Could not request new message indications"
|
||||
msgstr "Impossible d'obtenir des notifications de nouveaux messages"
|
||||
|
||||
#: ../src/phone.c:3265
|
||||
#: ../src/phone.c:3267
|
||||
msgid "Could not send message"
|
||||
msgstr "Le message n'a pas pu être envoyé"
|
||||
|
||||
#: ../src/phone.c:3273
|
||||
#: ../src/phone.c:3275
|
||||
msgid "Wrong SIM PIN code"
|
||||
msgstr "Code SIM PIN erroné"
|
||||
|
||||
#: ../src/phone.c:3309
|
||||
#: ../src/phone.c:3311
|
||||
msgid "Raw data (not shown)"
|
||||
msgstr "Données brutes (non affichées)"
|
||||
|
||||
#: ../src/phone.c:3324
|
||||
#: ../src/phone.c:3326
|
||||
msgid "Message deleted"
|
||||
msgstr "Message supprimé"
|
||||
|
||||
|
30
src/gsm.c
30
src/gsm.c
@ -265,6 +265,7 @@ static int _gsm_trigger_ccwa(GSM * gsm, char const * result);
|
||||
static int _gsm_trigger_cfun(GSM * gsm, char const * result);
|
||||
static int _gsm_trigger_cgatt(GSM * gsm, char const * result);
|
||||
static int _gsm_trigger_cgmm(GSM * gsm, char const * result);
|
||||
static int _gsm_trigger_cgreg(GSM * gsm, char const * result);
|
||||
static int _gsm_trigger_clip(GSM * gsm, char const * result);
|
||||
static int _gsm_trigger_cme_error(GSM * gsm, char const * result,
|
||||
gboolean * answered);
|
||||
@ -306,6 +307,7 @@ static GSMTrigger _gsm_triggers[] =
|
||||
GSM_TRIGGER("+CFUN: ", cfun),
|
||||
GSM_TRIGGER("+CGATT: ", cgatt),
|
||||
GSM_TRIGGER("+CGMM: ", cgmm),
|
||||
GSM_TRIGGER("+CGREG: ", cgreg),
|
||||
GSM_TRIGGER("+CLIP: ", clip),
|
||||
GSM_TRIGGER("+CME ERROR: ", cme_error),
|
||||
GSM_TRIGGER("+CMS ERROR: ", cms_error),
|
||||
@ -750,6 +752,7 @@ int gsm_event(GSM * gsm, GSMEventType type, ...)
|
||||
GSMPhoneActivity);
|
||||
break;
|
||||
case GSM_EVENT_TYPE_REGISTRATION:
|
||||
case GSM_EVENT_TYPE_GPRS_REGISTRATION:
|
||||
event->registration.n = va_arg(ap, unsigned int);
|
||||
event->registration.stat = va_arg(ap, unsigned int);
|
||||
event->registration.area = va_arg(ap, unsigned int);
|
||||
@ -1460,6 +1463,33 @@ static int _gsm_trigger_cgmm(GSM * gsm, char const * result)
|
||||
}
|
||||
|
||||
|
||||
/* gsm_trigger_cgreg */
|
||||
static int _gsm_trigger_cgreg(GSM * gsm, char const * result)
|
||||
{
|
||||
int ret;
|
||||
int res;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "DEBUG: %s(\"%s\")\n", __func__, result);
|
||||
#endif
|
||||
if((res = sscanf(result, "%u,%u,%X,%X", &gsm->event.gprs_registration.n,
|
||||
&gsm->event.gprs_registration.stat,
|
||||
&gsm->event.gprs_registration.area,
|
||||
&gsm->event.gprs_registration.cell))
|
||||
== 4)
|
||||
ret = _gsm_event_send(gsm, GSM_EVENT_TYPE_GPRS_REGISTRATION);
|
||||
else if(res == 2)
|
||||
{
|
||||
gsm->event.gprs_registration.area = 0;
|
||||
gsm->event.gprs_registration.cell = 0;
|
||||
ret = _gsm_event_send(gsm, GSM_EVENT_TYPE_GPRS_REGISTRATION);
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* gsm_trigger_clip */
|
||||
static int _gsm_trigger_clip(GSM * gsm, char const * result)
|
||||
{
|
||||
|
10
src/gsm.h
10
src/gsm.h
@ -91,6 +91,7 @@ typedef enum _GSMEventType
|
||||
GSM_EVENT_TYPE_CONTACT_LIST,
|
||||
GSM_EVENT_TYPE_FUNCTIONAL,
|
||||
GSM_EVENT_TYPE_GPRS_ATTACHMENT,
|
||||
GSM_EVENT_TYPE_GPRS_REGISTRATION,
|
||||
GSM_EVENT_TYPE_INCOMING_CALL,
|
||||
GSM_EVENT_TYPE_INCOMING_MESSAGE,
|
||||
GSM_EVENT_TYPE_MESSAGE,
|
||||
@ -111,13 +112,6 @@ typedef enum _GSMEventType
|
||||
GSM_EVENT_TYPE_UNKNOWN
|
||||
} GSMEventType;
|
||||
|
||||
typedef enum _GSMGPRSRegistrationReport
|
||||
{
|
||||
GSM_GPRS_REGISTRATION_REPORT_DISABLE = 0,
|
||||
GSM_GPRS_REGISTRATION_REPORT_ENABLE = 1,
|
||||
GSM_GPRS_REGISTRATION_REPORT_ENABLE_WITH_LOCATION = 2
|
||||
} GSMGPRSRegistrationReport;
|
||||
|
||||
typedef enum _GSMMessageFormat
|
||||
{
|
||||
GSM_MESSAGE_FORMAT_PDU = 0,
|
||||
@ -344,7 +338,7 @@ typedef union _GSMEvent
|
||||
GSMRegistrationStatus stat;
|
||||
unsigned int cell;
|
||||
unsigned int area;
|
||||
} registration;
|
||||
} registration, gprs_registration;
|
||||
|
||||
/* GSM_EVENT_TYPE_SIGNAL_LEVEL */
|
||||
struct
|
||||
|
@ -818,15 +818,15 @@ int gsm_modem_set_gprs_attachment(GSMModem * gsmm, gboolean set)
|
||||
|
||||
/* gsm_modem_set_gprs_registration_report */
|
||||
int gsm_modem_set_gprs_registration_report(GSMModem * gsmm,
|
||||
GSMGPRSRegistrationReport report)
|
||||
GSMRegistrationReport report)
|
||||
{
|
||||
char cmd[] = "AT+CGREG=X";
|
||||
|
||||
switch(report)
|
||||
{
|
||||
case GSM_GPRS_REGISTRATION_REPORT_DISABLE:
|
||||
case GSM_GPRS_REGISTRATION_REPORT_ENABLE:
|
||||
case GSM_GPRS_REGISTRATION_REPORT_ENABLE_WITH_LOCATION:
|
||||
case GSM_REGISTRATION_REPORT_DISABLE:
|
||||
case GSM_REGISTRATION_REPORT_ENABLE:
|
||||
case GSM_REGISTRATION_REPORT_ENABLE_WITH_LOCATION:
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
|
@ -99,7 +99,7 @@ int gsm_modem_set_line_presentation(GSMModem * gsmm, gboolean set);
|
||||
int gsm_modem_set_functional(GSMModem * gsmm, gboolean functional);
|
||||
int gsm_modem_set_gprs_attachment(GSMModem * gsmm, gboolean set);
|
||||
int gsm_modem_set_gprs_registration_report(GSMModem * gsmm,
|
||||
GSMGPRSRegistrationReport report);
|
||||
GSMRegistrationReport report);
|
||||
int gsm_modem_set_message_format(GSMModem * gsmm, GSMMessageFormat format);
|
||||
int gsm_modem_set_message_indications(GSMModem * gsmm, GSMMessageMode mode,
|
||||
gboolean unsollicited);
|
||||
|
@ -3143,6 +3143,8 @@ static int _phone_gsm_event(GSMEvent * event, gpointer data)
|
||||
event->gprs_attachment.attached ? TRUE
|
||||
: FALSE);
|
||||
return 0;
|
||||
case GSM_EVENT_TYPE_GPRS_REGISTRATION:
|
||||
return 0; /* XXX not used at the moment */
|
||||
case GSM_EVENT_TYPE_INCOMING_CALL:
|
||||
phone_show_call(phone, TRUE, PHONE_CALL_INCOMING, "",
|
||||
"");
|
||||
|
@ -79,6 +79,7 @@ static struct
|
||||
{ PHONE_EVENT_CALL_TERMINATED, "PHONE_EVENT_CALL_TERMINATED" },
|
||||
{ PHONE_EVENT_CALLING, "PHONE_EVENT_CALLING" },
|
||||
{ PHONE_EVENT_FUNCTIONAL, "PHONE_EVENT_FUNCTIONAL" },
|
||||
{ PHONE_EVENT_GPRS_ATTACHMENT, "PHONE_EVENT_GPRS_ATTACHMENT" },
|
||||
{ PHONE_EVENT_KEY_TONE, "PHONE_EVENT_KEY_TONE" },
|
||||
{ PHONE_EVENT_OFFLINE, "PHONE_EVENT_OFFLINE" },
|
||||
{ PHONE_EVENT_ONLINE, "PHONE_EVENT_ONLINE" },
|
||||
|
Loading…
Reference in New Issue
Block a user