From e78a8f174f07d10bc9a68827c120bcc81abdfc63 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 6 Jan 2012 23:46:01 +0000 Subject: [PATCH] Only repeat unknown errors on the Openmoko Freerunner --- po/fr.po | 2 +- src/modems/hayes.c | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/po/fr.po b/po/fr.po index b596e04..06f8310 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Phone 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-04 00:19+0100\n" +"POT-Creation-Date: 2012-01-07 00:41+0100\n" "PO-Revision-Date: 2010-04-24 02:07+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: DeforaOS development (French) \n" diff --git a/src/modems/hayes.c b/src/modems/hayes.c index 0c5ada7..d1ea804 100644 --- a/src/modems/hayes.c +++ b/src/modems/hayes.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2011 Pierre Pronchery */ +/* Copyright (c) 2011-2012 Pierre Pronchery */ /* This file is part of DeforaOS Desktop Phone */ /* 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 @@ -154,7 +154,8 @@ typedef enum _HayesQuirk HAYES_QUIRK_BATTERY_70 = 0x1, HAYES_QUIRK_CPIN_QUOTES = 0x2, HAYES_QUIRK_CONNECTED_LINE_DISABLED = 0x4, - HAYES_QUIRK_WANT_SMSC_IN_PDU = 0x8 + HAYES_QUIRK_WANT_SMSC_IN_PDU = 0x8, + HAYES_QUIRK_REPEAT_ON_UNKNOWN_ERROR = 0x10 } HayesQuirk; typedef struct _HayesRequestHandler @@ -452,13 +453,16 @@ static const struct { { "\"Neo1973 Embedded GSM Modem\"", HAYES_QUIRK_CPIN_QUOTES | HAYES_QUIRK_WANT_SMSC_IN_PDU - | HAYES_QUIRK_CONNECTED_LINE_DISABLED }, + | HAYES_QUIRK_CONNECTED_LINE_DISABLED + | HAYES_QUIRK_REPEAT_ON_UNKNOWN_ERROR }, { "\"Neo1973 GTA01/GTA02 Embedded GSM Modem\"", HAYES_QUIRK_CPIN_QUOTES | HAYES_QUIRK_WANT_SMSC_IN_PDU - | HAYES_QUIRK_CONNECTED_LINE_DISABLED }, + | HAYES_QUIRK_CONNECTED_LINE_DISABLED + | HAYES_QUIRK_REPEAT_ON_UNKNOWN_ERROR }, { "\"Neo1973 GTA02 Embedded GSM Modem\"", HAYES_QUIRK_CPIN_QUOTES | HAYES_QUIRK_WANT_SMSC_IN_PDU - | HAYES_QUIRK_CONNECTED_LINE_DISABLED }, + | HAYES_QUIRK_CONNECTED_LINE_DISABLED + | HAYES_QUIRK_REPEAT_ON_UNKNOWN_ERROR }, { "Nokia N900", HAYES_QUIRK_CPIN_QUOTES | HAYES_QUIRK_BATTERY_70 }, { NULL, 0 } @@ -886,7 +890,6 @@ static char * _request_attention_call_ussd(ModemPlugin * modem, ModemRequest * request) { char * ret; - Hayes * hayes = modem->priv; char const * number = request->call.number; const char cmd[] = "AT+CUSD=1,"; size_t len; @@ -3132,8 +3135,11 @@ static void _on_code_cme_error(ModemPlugin * modem, char const * answer) _on_code_cpin(modem, "SIM PUK"); _hayes_trigger(modem, MODEM_EVENT_TYPE_AUTHENTICATION); break; - case 14: /* SIM busy */ case 100: /* unknown error */ + if((hayes->quirks & HAYES_QUIRK_REPEAT_ON_UNKNOWN_ERROR) + == 0) + break; + case 14: /* SIM busy */ /* repeat the command */ if(command == NULL) break; @@ -3560,8 +3566,11 @@ static void _on_code_cms_error(ModemPlugin * modem, char const * answer) _on_code_cpin(modem, "SIM PUK"); _hayes_trigger(modem, MODEM_EVENT_TYPE_AUTHENTICATION); break; - case 314: /* SIM busy */ case 500: /* unknown error */ + if((hayes->quirks & HAYES_QUIRK_REPEAT_ON_UNKNOWN_ERROR) + == 0) + break; + case 314: /* SIM busy */ /* repeat the command */ /* FIXME duplicated from _on_code_cme_error() */ if(command == NULL)