From 3a2c08debbcb28fca560f55c0bb93b947c248e77 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 1 May 2010 19:12:03 +0000 Subject: [PATCH] Fixed sending the SIM PIN on the Openmoko Freerunner --- src/gsm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gsm.c b/src/gsm.c index 8088349..7c4c63d 100644 --- a/src/gsm.c +++ b/src/gsm.c @@ -50,7 +50,7 @@ typedef enum _GSMPriority typedef enum _GSMQuirk { GSM_QUIRK_NONE = 0, - GSM_QUIRK_CPIN_QUOTES + GSM_QUIRK_CPIN_QUOTES_NEWLINE } GSMQuirk; typedef void (*GSMCommandCallback)(GSM * gsm); @@ -165,7 +165,7 @@ static struct } _gsm_models[] = { { "\"Neo1973 GTA02 Embedded GSM Modem\"", - GSM_QUIRK_CPIN_QUOTES }, + GSM_QUIRK_CPIN_QUOTES_NEWLINE }, { NULL, 0 } }; @@ -851,11 +851,11 @@ static int _gsm_modem_enter_sim_pin(GSM * gsm, char const * code) _gsm_event(gsm, GSM_EVENT_TYPE_ERROR, GSM_ERROR_SIM_PIN_WRONG); return 1; } - len = sizeof(cmd) + 1 + strlen(code) + 1; + len = sizeof(cmd) + 1 + strlen(code) + 2; if((buf = malloc(len)) == NULL) return 1; - if(gsm->quirks & GSM_QUIRK_CPIN_QUOTES) - snprintf(buf, len, "%s\"%s\"", cmd, code); + if(gsm->quirks & GSM_QUIRK_CPIN_QUOTES_NEWLINE) + snprintf(buf, len, "%s\"%s\"\n", cmd, code); else snprintf(buf, len, "%s%s", cmd, code); ret = _gsm_queue_full(gsm, GSM_PRIORITY_HIGH, buf,