* Re: [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM
2011-07-22 16:15 ` [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM Philippe Nunes
@ 2011-07-22 14:05 ` Denis Kenzior
2011-07-27 14:17 ` Marcel Holtmann
1 sibling, 0 replies; 13+ messages in thread
From: Denis Kenzior @ 2011-07-22 14:05 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3524 bytes --]
Hi Philippe,
On 07/22/2011 11:15 AM, Philippe Nunes wrote:
> ---
> drivers/atmodem/sim.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 95 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
> index b28f3f8..49f5245 100644
> --- a/drivers/atmodem/sim.c
> +++ b/drivers/atmodem/sim.c
> @@ -667,6 +667,95 @@ static void at_cpinr_cb(gboolean ok, GAtResult *result, gpointer user_data)
> cb(&error, retries, cbd->data);
> }
>
> +static gboolean skip_to_field(GAtResultIter *iter, const char *field)
> +{
> + char *line;
> + char *offset;
> + int field_len = field ? strlen(field) : 0;
> +
> + if (iter == NULL)
> + return FALSE;
> +
> + if (iter->l == NULL)
> + return FALSE;
> +
> + line = iter->l->data;
> +
> + if (field_len == 0) {
> + iter->line_pos = 0;
> + return TRUE;
> + }
> +
> + offset = g_strrstr(line, field);
> + if (offset == NULL)
> + return FALSE;
> +
> + iter->line_pos = (offset - line) + field_len;
> +
> + return TRUE;
> +}
> +
> +static void at_cpnnum_cb(gboolean ok, GAtResult *result, gpointer user_data)
> +{
> + struct cb_data *cbd = user_data;
> + ofono_sim_pin_retries_cb_t cb = cbd->cb;
> + GAtResultIter iter;
> + struct ofono_error error;
> + int retries[OFONO_SIM_PASSWORD_INVALID];
> + size_t i;
> +
> + decode_at_error(&error, g_at_result_final_response(result));
> +
> + if (!ok) {
> + cb(&error, NULL, cbd->data);
> + return;
> + }
> +
> + for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
> + retries[i] = -1;
> +
> + g_at_result_iter_init(&iter, result);
> +
> + /*
> + * Even if this is not really a suffix, we rely on the tag PIN1 to
> + * recognize the correct response line.
> + */
> + if (!g_at_result_iter_next(&iter, "PIN1="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PIN]))
> + goto error;
> +
> + if (!skip_to_field(&iter, "PUK1="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PUK]))
> + goto error;
> +
> + if (!skip_to_field(&iter, "PIN2="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PIN2]))
> + goto error;
> +
> + if (!skip_to_field(&iter, "PUK2="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PUK2]))
> + goto error;
I know this string is non-standard and the vendor should be ridiculed
publically. However, it seems to me there's entirely too much code for
this purpose. Have you considered using sscanf or g_strsplit_set for
this purpose?
> +
> + cb(&error, retries, cbd->data);
> +
> + return;
> +
> +error:
> + CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
> +}
> +
> static void at_pin_retries_query(struct ofono_sim *sim,
> ofono_sim_pin_retries_cb_t cb,
> void *data)
> @@ -695,6 +784,12 @@ static void at_pin_retries_query(struct ofono_sim *sim,
> return;
>
> break;
> + case OFONO_VENDOR_SPEEDUP:
> + if (g_at_chat_send(sd->chat, "AT+CPNNUM", NULL,
It is my understanding that SpeedUp also supports AT+BMCPNCNT for CPIN
queries, or are these interchangeable?
> + at_cpnnum_cb, cbd, g_free) > 0)
> + return;
> +
> + break;
> default:
> if (g_at_chat_send(sd->chat, "AT+CPINR", cpinr_prefixes,
> at_cpinr_cb, cbd, g_free) > 0)
Regards,
-Denis
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 0/4] ZTE/SpeedUp specificities
@ 2011-07-22 16:15 Philippe Nunes
2011-07-22 16:15 ` [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems Philippe Nunes
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Philippe Nunes @ 2011-07-22 16:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 829 bytes --]
On ZTE/Speedup modem, AT+CPIN? keeps returning CME ERROR 14 for a moment after successful AT+CPIN=".."
As there is no card status notification, a pooling with CPIN queries is used to detect the state change.
On SpeedUp modem (vendor id 0x1c9e), use the proprietary command AT+CPNNUM? to get the remaining SIM PIN attempts.
Philippe Nunes (4):
atmodem: Add vendor entry for SpeedUp modems
speedup: Create SIM atom with SpeedUp vendor to handle proprietary
commands
atmodem: Add a polling based on CPIN query to detect SIM state change
atmodem: Add support for the PIN counter command AT+CPNNUM
drivers/atmodem/sim.c | 151 ++++++++++++++++++++++++++++++++++++++++++++++
drivers/atmodem/vendor.h | 1 +
plugins/speedup.c | 2 +-
3 files changed, 153 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems
2011-07-22 16:15 [PATCH 0/4] ZTE/SpeedUp specificities Philippe Nunes
@ 2011-07-22 16:15 ` Philippe Nunes
2011-07-27 14:13 ` Marcel Holtmann
2011-07-22 16:15 ` [PATCH 2/4] speedup: Create SIM atom with SpeedUp vendor to handle proprietary commands Philippe Nunes
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Philippe Nunes @ 2011-07-22 16:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
---
drivers/atmodem/vendor.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/atmodem/vendor.h b/drivers/atmodem/vendor.h
index 412bc76..e4532de 100644
--- a/drivers/atmodem/vendor.h
+++ b/drivers/atmodem/vendor.h
@@ -36,4 +36,5 @@ enum ofono_vendor {
OFONO_VENDOR_NOKIA,
OFONO_VENDOR_PHONESIM,
OFONO_VENDOR_TELIT,
+ OFONO_VENDOR_SPEEDUP,
};
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/4] speedup: Create SIM atom with SpeedUp vendor to handle proprietary commands
2011-07-22 16:15 [PATCH 0/4] ZTE/SpeedUp specificities Philippe Nunes
2011-07-22 16:15 ` [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems Philippe Nunes
@ 2011-07-22 16:15 ` Philippe Nunes
2011-07-27 14:15 ` Marcel Holtmann
2011-07-22 16:15 ` [PATCH 3/4] atmodem: Add a polling based on CPIN query to detect SIM state change Philippe Nunes
2011-07-22 16:15 ` [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM Philippe Nunes
3 siblings, 1 reply; 13+ messages in thread
From: Philippe Nunes @ 2011-07-22 16:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]
---
drivers/atmodem/sim.c | 1 +
plugins/speedup.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 2690ab4..a4a09f5 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -151,6 +151,7 @@ static void at_sim_read_info(struct ofono_sim *sim, int fileid,
case OFONO_VENDOR_HUAWEI:
case OFONO_VENDOR_SIERRA:
case OFONO_VENDOR_QUALCOMM_MSM:
+ case OFONO_VENDOR_SPEEDUP:
strcat(buf, ",0,0,255"); /* Maximum possible length */
break;
}
diff --git a/plugins/speedup.c b/plugins/speedup.c
index 23ba173..9302dcc 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -330,7 +330,7 @@ static void speedup_pre_sim(struct ofono_modem *modem)
DBG("%p", modem);
ofono_devinfo_create(modem, 0, "atmodem", data->aux);
- sim = ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
+ sim = ofono_sim_create(modem, OFONO_VENDOR_SPEEDUP,
"atmodem", data->aux);
if (sim)
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/4] atmodem: Add a polling based on CPIN query to detect SIM state change
2011-07-22 16:15 [PATCH 0/4] ZTE/SpeedUp specificities Philippe Nunes
2011-07-22 16:15 ` [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems Philippe Nunes
2011-07-22 16:15 ` [PATCH 2/4] speedup: Create SIM atom with SpeedUp vendor to handle proprietary commands Philippe Nunes
@ 2011-07-22 16:15 ` Philippe Nunes
2011-07-27 14:19 ` Marcel Holtmann
2011-07-22 16:15 ` [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM Philippe Nunes
3 siblings, 1 reply; 13+ messages in thread
From: Philippe Nunes @ 2011-07-22 16:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3026 bytes --]
On ZTE/Speedup modem, AT+CPIN? keeps returning CME ERROR 14 for a moment
after successful AT+CPIN=".."
As there is no card status notification, a pooling with CPIN queries is used
to detect the state change.
---
drivers/atmodem/sim.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index a4a09f5..b28f3f8 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -46,10 +46,13 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define POLL_INTERVAL 1
+
struct sim_data {
GAtChat *chat;
unsigned int vendor;
guint ready_id;
+ guint cpin_poll_count;
};
static const char *crsm_prefix[] = { "+CRSM:", NULL };
@@ -61,6 +64,8 @@ static const char *cpinr_prefixes[] = { "+CPINR:", "+CPINRE:", NULL };
static const char *epin_prefix[] = { "*EPIN:", NULL };
static const char *none_prefix[] = { NULL };
+static void pin_status_cb(gboolean ok, GAtResult *result, gpointer user_data);
+
static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -757,6 +762,44 @@ static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, pin_type, cbd->data);
}
+static gboolean pin_status_poll(gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ struct sim_data *sd = cbd->user;
+ ofono_sim_lock_unlock_cb_t cb = cbd->cb;
+
+ if (g_at_chat_send(sd->chat, "AT+CPIN?", cpin_prefix, pin_status_cb,
+ cbd, NULL) == 0) {
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
+ g_free(cbd);
+ }
+
+ return FALSE;
+}
+
+static void pin_status_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ struct sim_data *sd = cbd->user;
+ ofono_sim_lock_unlock_cb_t cb = cbd->cb;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (error.error == 14 && sd->cpin_poll_count++ < 5) {
+ /* SIM Busy, wait and check again the pin status */
+ sd->ready_id = g_timeout_add_seconds(POLL_INTERVAL,
+ pin_status_poll, cbd);
+ return;
+ }
+
+ sd->cpin_poll_count = 0;
+ sd->ready_id = 0;
+ cb(&error, cbd->data);
+
+ g_free(cbd);
+}
+
static void at_pin_query(struct ofono_sim *sim, ofono_sim_passwd_cb_t cb,
void *data)
{
@@ -852,6 +895,18 @@ static void at_pin_send_cb(gboolean ok, GAtResult *result,
at_epev_notify,
FALSE, cbd, g_free);
return;
+ case OFONO_VENDOR_QUALCOMM_MSM:
+ case OFONO_VENDOR_SPEEDUP:
+ /* On ZTE/Speedup modem, AT+CPIN? keeps returning CME ERROR 14
+ * for a moment after successful AT+CPIN=".."
+ * As there is no card status notification, a pooling with
+ * CPIN queries is used to detect the state change
+ */
+ sd->cpin_poll_count = 0;
+
+ g_at_chat_send(sd->chat, "AT+CPIN?", cpin_prefix,
+ pin_status_cb, cbd, NULL);
+ return;
}
done:
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM
2011-07-22 16:15 [PATCH 0/4] ZTE/SpeedUp specificities Philippe Nunes
` (2 preceding siblings ...)
2011-07-22 16:15 ` [PATCH 3/4] atmodem: Add a polling based on CPIN query to detect SIM state change Philippe Nunes
@ 2011-07-22 16:15 ` Philippe Nunes
2011-07-22 14:05 ` Denis Kenzior
2011-07-27 14:17 ` Marcel Holtmann
3 siblings, 2 replies; 13+ messages in thread
From: Philippe Nunes @ 2011-07-22 16:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2871 bytes --]
---
drivers/atmodem/sim.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 insertions(+), 0 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index b28f3f8..49f5245 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -667,6 +667,95 @@ static void at_cpinr_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, retries, cbd->data);
}
+static gboolean skip_to_field(GAtResultIter *iter, const char *field)
+{
+ char *line;
+ char *offset;
+ int field_len = field ? strlen(field) : 0;
+
+ if (iter == NULL)
+ return FALSE;
+
+ if (iter->l == NULL)
+ return FALSE;
+
+ line = iter->l->data;
+
+ if (field_len == 0) {
+ iter->line_pos = 0;
+ return TRUE;
+ }
+
+ offset = g_strrstr(line, field);
+ if (offset == NULL)
+ return FALSE;
+
+ iter->line_pos = (offset - line) + field_len;
+
+ return TRUE;
+}
+
+static void at_cpnnum_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_sim_pin_retries_cb_t cb = cbd->cb;
+ GAtResultIter iter;
+ struct ofono_error error;
+ int retries[OFONO_SIM_PASSWORD_INVALID];
+ size_t i;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, NULL, cbd->data);
+ return;
+ }
+
+ for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
+ retries[i] = -1;
+
+ g_at_result_iter_init(&iter, result);
+
+ /*
+ * Even if this is not really a suffix, we rely on the tag PIN1 to
+ * recognize the correct response line.
+ */
+ if (!g_at_result_iter_next(&iter, "PIN1="))
+ goto error;
+
+ if (!g_at_result_iter_next_number(&iter,
+ &retries[OFONO_SIM_PASSWORD_SIM_PIN]))
+ goto error;
+
+ if (!skip_to_field(&iter, "PUK1="))
+ goto error;
+
+ if (!g_at_result_iter_next_number(&iter,
+ &retries[OFONO_SIM_PASSWORD_SIM_PUK]))
+ goto error;
+
+ if (!skip_to_field(&iter, "PIN2="))
+ goto error;
+
+ if (!g_at_result_iter_next_number(&iter,
+ &retries[OFONO_SIM_PASSWORD_SIM_PIN2]))
+ goto error;
+
+ if (!skip_to_field(&iter, "PUK2="))
+ goto error;
+
+ if (!g_at_result_iter_next_number(&iter,
+ &retries[OFONO_SIM_PASSWORD_SIM_PUK2]))
+ goto error;
+
+ cb(&error, retries, cbd->data);
+
+ return;
+
+error:
+ CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
+}
+
static void at_pin_retries_query(struct ofono_sim *sim,
ofono_sim_pin_retries_cb_t cb,
void *data)
@@ -695,6 +784,12 @@ static void at_pin_retries_query(struct ofono_sim *sim,
return;
break;
+ case OFONO_VENDOR_SPEEDUP:
+ if (g_at_chat_send(sd->chat, "AT+CPNNUM", NULL,
+ at_cpnnum_cb, cbd, g_free) > 0)
+ return;
+
+ break;
default:
if (g_at_chat_send(sd->chat, "AT+CPINR", cpinr_prefixes,
at_cpinr_cb, cbd, g_free) > 0)
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems
2011-07-22 16:15 ` [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems Philippe Nunes
@ 2011-07-27 14:13 ` Marcel Holtmann
0 siblings, 0 replies; 13+ messages in thread
From: Marcel Holtmann @ 2011-07-27 14:13 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
Hi Philippe,
> drivers/atmodem/vendor.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/4] speedup: Create SIM atom with SpeedUp vendor to handle proprietary commands
2011-07-22 16:15 ` [PATCH 2/4] speedup: Create SIM atom with SpeedUp vendor to handle proprietary commands Philippe Nunes
@ 2011-07-27 14:15 ` Marcel Holtmann
0 siblings, 0 replies; 13+ messages in thread
From: Marcel Holtmann @ 2011-07-27 14:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
Hi Philippe,
> drivers/atmodem/sim.c | 1 +
> plugins/speedup.c | 2 +-
> 2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
> index 2690ab4..a4a09f5 100644
> --- a/drivers/atmodem/sim.c
> +++ b/drivers/atmodem/sim.c
> @@ -151,6 +151,7 @@ static void at_sim_read_info(struct ofono_sim *sim, int fileid,
> case OFONO_VENDOR_HUAWEI:
> case OFONO_VENDOR_SIERRA:
> case OFONO_VENDOR_QUALCOMM_MSM:
> + case OFONO_VENDOR_SPEEDUP:
sort this one before the QUALCOMM_MSM quirk.
> strcat(buf, ",0,0,255"); /* Maximum possible length */
> break;
> }
> diff --git a/plugins/speedup.c b/plugins/speedup.c
> index 23ba173..9302dcc 100644
> --- a/plugins/speedup.c
> +++ b/plugins/speedup.c
> @@ -330,7 +330,7 @@ static void speedup_pre_sim(struct ofono_modem *modem)
> DBG("%p", modem);
>
> ofono_devinfo_create(modem, 0, "atmodem", data->aux);
> - sim = ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
> + sim = ofono_sim_create(modem, OFONO_VENDOR_SPEEDUP,
> "atmodem", data->aux);
And patch does not apply anymore. Please send me an updated one.
Regards
Marcel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM
2011-07-22 16:15 ` [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM Philippe Nunes
2011-07-22 14:05 ` Denis Kenzior
@ 2011-07-27 14:17 ` Marcel Holtmann
2011-08-04 7:34 ` Aygon, Bertrand
1 sibling, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2011-07-27 14:17 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3247 bytes --]
Hi Philippe,
> drivers/atmodem/sim.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 95 insertions(+), 0 deletions(-)
please include an OFONO_AT_DEBUG trace of this AT command.
> diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
> index b28f3f8..49f5245 100644
> --- a/drivers/atmodem/sim.c
> +++ b/drivers/atmodem/sim.c
> @@ -667,6 +667,95 @@ static void at_cpinr_cb(gboolean ok, GAtResult *result, gpointer user_data)
> cb(&error, retries, cbd->data);
> }
>
> +static gboolean skip_to_field(GAtResultIter *iter, const char *field)
> +{
> + char *line;
> + char *offset;
> + int field_len = field ? strlen(field) : 0;
> +
> + if (iter == NULL)
> + return FALSE;
> +
> + if (iter->l == NULL)
> + return FALSE;
> +
> + line = iter->l->data;
> +
> + if (field_len == 0) {
> + iter->line_pos = 0;
> + return TRUE;
> + }
> +
> + offset = g_strrstr(line, field);
> + if (offset == NULL)
> + return FALSE;
> +
> + iter->line_pos = (offset - line) + field_len;
> +
> + return TRUE;
> +}
What is this one doing?
Denis, can you have a look please.
> +static void at_cpnnum_cb(gboolean ok, GAtResult *result, gpointer user_data)
> +{
> + struct cb_data *cbd = user_data;
> + ofono_sim_pin_retries_cb_t cb = cbd->cb;
> + GAtResultIter iter;
> + struct ofono_error error;
> + int retries[OFONO_SIM_PASSWORD_INVALID];
> + size_t i;
> +
> + decode_at_error(&error, g_at_result_final_response(result));
> +
> + if (!ok) {
> + cb(&error, NULL, cbd->data);
> + return;
> + }
> +
> + for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
> + retries[i] = -1;
> +
> + g_at_result_iter_init(&iter, result);
> +
> + /*
> + * Even if this is not really a suffix, we rely on the tag PIN1 to
> + * recognize the correct response line.
> + */
> + if (!g_at_result_iter_next(&iter, "PIN1="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PIN]))
> + goto error;
> +
> + if (!skip_to_field(&iter, "PUK1="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PUK]))
> + goto error;
> +
> + if (!skip_to_field(&iter, "PIN2="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PIN2]))
> + goto error;
> +
> + if (!skip_to_field(&iter, "PUK2="))
> + goto error;
> +
> + if (!g_at_result_iter_next_number(&iter,
> + &retries[OFONO_SIM_PASSWORD_SIM_PUK2]))
> + goto error;
> +
> + cb(&error, retries, cbd->data);
> +
> + return;
> +
> +error:
> + CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
> +}
> +
> static void at_pin_retries_query(struct ofono_sim *sim,
> ofono_sim_pin_retries_cb_t cb,
> void *data)
> @@ -695,6 +784,12 @@ static void at_pin_retries_query(struct ofono_sim *sim,
> return;
>
> break;
> + case OFONO_VENDOR_SPEEDUP:
> + if (g_at_chat_send(sd->chat, "AT+CPNNUM", NULL,
> + at_cpnnum_cb, cbd, g_free) > 0)
> + return;
> +
> + break;
> default:
> if (g_at_chat_send(sd->chat, "AT+CPINR", cpinr_prefixes,
> at_cpinr_cb, cbd, g_free) > 0)
Regards
Marcel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/4] atmodem: Add a polling based on CPIN query to detect SIM state change
2011-07-22 16:15 ` [PATCH 3/4] atmodem: Add a polling based on CPIN query to detect SIM state change Philippe Nunes
@ 2011-07-27 14:19 ` Marcel Holtmann
0 siblings, 0 replies; 13+ messages in thread
From: Marcel Holtmann @ 2011-07-27 14:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 515 bytes --]
Hi Philippe,
> On ZTE/Speedup modem, AT+CPIN? keeps returning CME ERROR 14 for a moment
> after successful AT+CPIN=".."
> As there is no card status notification, a pooling with CPIN queries is used
> to detect the state change.
why don't we do this as part of the modem plugin and make it part of the
modem enabling call with the provided at_util_sim_state_query_new
function.
A dongle with a SIM card then just fails to get enabled. And that seems
pretty much fine to me.
Regards
Marcel
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM
2011-07-27 14:17 ` Marcel Holtmann
@ 2011-08-04 7:34 ` Aygon, Bertrand
2011-08-04 15:44 ` Marcel Holtmann
0 siblings, 1 reply; 13+ messages in thread
From: Aygon, Bertrand @ 2011-08-04 7:34 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]
Hi,
> > drivers/atmodem/sim.c | 95
> +++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 files changed, 95 insertions(+), 0 deletions(-)
>
> please include an OFONO_AT_DEBUG trace of this AT command.
I have attached a full log from a SpeedUp dongle, but here is the AT command that we are looking at:
ofonod[2534]: Aux: > AT+CPNNUM\r
ofonod[2534]: Aux: < \r\nPIN1=3; PUK1=10; PIN2=3; PUK2=10\r\r\nOK\r\n
Regards,
Bertrand
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
[-- Attachment #2: SpeedUpCPNNUM.txt --]
[-- Type: text/plain, Size: 15753 bytes --]
ofonod[2534]: src/modem.c:get_modem_property() modem 0x86e9a28 property Modem
ofonod[2534]: plugins/speedup.c:open_device() Modem /dev/ttyUSB1
ofonod[2534]: src/modem.c:get_modem_property() modem 0x86e9a28 property Aux
ofonod[2534]: plugins/speedup.c:open_device() Aux /dev/ttyUSB2
ofonod[2534]: Modem: > ATE0 +CMEE=1\r
ofonod[2534]: Aux: > ATE0 +CMEE=1\r
ofonod[2534]: Aux: < ATE0 +CMEE=1\r\r\nOK\r\n
ofonod[2534]: Aux: > AT+CFUN=1\r
ofonod[2534]: Modem: < \r\nOK\r\n
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: plugins/speedup.c:cfun_enable()
ofonod[2534]: Aux: > AT+CPIN?\r
ofonod[2534]: Aux: < \r\n+CME ERROR: 14\r\n
ofonod[2534]: Aux: > AT+CPIN?\r
ofonod[2534]: Aux: < \r\n+CME ERROR: 14\r\n
ofonod[2534]: Aux: > AT+CPIN?\r
ofonod[2534]: Aux: < \r\n+CPIN: READY\r\n\r\nOK\r\n
ofonod[2534]: examples/emulator.c:powered_watch() Adding modem 0x86e9a28 to the list
ofonod[2534]: examples/emulator.c:create_tcp() Created server_watch: 50
ofonod[2534]: examples/emulator.c:create_tcp() Created server_watch: 51
ofonod[2534]: src/modem.c:modem_change_state() old state: 0, new state: 1
ofonod[2534]: plugins/speedup.c:speedup_pre_sim() 0x86e9a28
ofonod[2534]: Aux: > AT+GCAP\r
ofonod[2534]: Modem: > AT&C0\r
ofonod[2534]: src/sim.c:ofono_sim_add_state_watch() 0x86ea1d8
ofonod[2534]: src/sim.c:ofono_sim_add_state_watch() 0x86ea1d8
ofonod[2534]: src/sim.c:ofono_sim_add_state_watch() 0x86ea1d8
ofonod[2534]: Modem: < \r\nOK\r\n
ofonod[2534]: Aux: < \r\n+GCAP: +CGSM,+DS,+ES\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT&C0\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,12258\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,""\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 0
ofonod[2534]: Aux: > AT+CGMI\r
ofonod[2534]: Aux: < \r\nManufacturer\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,28421\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,""\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 0
ofonod[2534]: Aux: > AT+CGMM\r
ofonod[2534]: Aux: < \r\nHSPA USB MODEM\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,12037\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,""\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 0
ofonod[2534]: Aux: > AT+CGMR\r
ofonod[2534]: Aux: < \r\nLWA6R04.1.0_MG35\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CPIN?\r
ofonod[2534]: Aux: < \r\n+CPIN: READY\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: READY
ofonod[2534]: drivers/atmodem/sim.c:at_pin_retries_query()
ofonod[2534]: Aux: > AT+CGSN\r
ofonod[2534]: Aux: < \r\n355132040087829\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CPNNUM\r
ofonod[2534]: Aux: < \r\nPIN1=3; PUK1=10; PIN2=3; PUK2=10\r\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,28590\r
ofonod[2534]: Aux: < \r\n+CRSM: 106,130,""\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,28589\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,""\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 0
ofonod[2534]: Aux: > AT+CRSM=192,28438\r
ofonod[2534]: Aux: < \r\n+CRSM: 106,130,""\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,28472\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,""\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 0
ofonod[2534]: Aux: > AT+CIMI\r
ofonod[2534]: Aux: < \r\n208012901711415\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_cimi_cb() cimi_cb: 208012901711415
ofonod[2534]: src/modem.c:modem_change_state() old state: 1, new state: 2
ofonod[2534]: plugins/speedup.c:speedup_post_sim() 0x86e9a28
ofonod[2534]: drivers/atmodem/gprs-context.c:at_gprs_context_probe()
ofonod[2534]: Example History Probe for modem: 0x86e9a28
ofonod[2534]: Example Network Time Probe for modem: 0x86e9a28
ofonod[2534]: src/modem.c:modem_change_state() old state: 2, new state: 3
ofonod[2534]: Aux: > AT+CREG=?\r
ofonod[2534]: Aux: < \r\n+CREG: (0-2)\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CSCB=?\r
ofonod[2534]: Aux: < \r\n+CSCB: (0-1)\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CSCS?\r
ofonod[2534]: Aux: < \r\n+CSCS: "IRA"\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CUSD=1\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CSCS=?\r
ofonod[2534]: Aux: < \r\n+CSCS: ("IRA","GSM","UCS2")\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CSMS=?\r
ofonod[2534]: Aux: < \r\n+CSMS: (0-1)\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sms.c:at_csms_query_cb() CSMS query parsed successfully
ofonod[2534]: Aux: > AT+CGDCONT=?\r
ofonod[2534]: Aux: < \r\n+CGDCONT: (1-16),"IP",,,(0-2),(0-4)\r\n+CGDCONT: (1-16),"PPP",,,(0-2),(0-4)\r\n+CGDCONT: (1-16),"IPV6",,,(0-2),(0-4)\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,28480\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,""\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 0
ofonod[2534]: Aux: > AT+CREG=2\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CSCB=1,"0-65535"\r
ofonod[2534]: Aux: < \r\n+CMS ERROR: 314\r\n
ofonod[2534]: src/cbs.c:cbs_got_imsi() Got IMSI: 208012901711415
ofonod[2534]: Aux: > AT+CPBS=?\r
ofonod[2534]: Aux: < \r\n+CME ERROR: 14\r\n
ofonod[2534]: Aux: > AT+CSMS=1\r
ofonod[2534]: Aux: < \r\n+CSMS: 1,1,1\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CGREG=?\r
ofonod[2534]: Aux: < \r\n+CGREG: (0-2)\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=178,28489,4,4,28\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CIND=?\r
ofonod[2534]: Aux: < \r\n+CIND: ("battchg",(0-5)),("signal",(0-5)),("service",(0-1)),("call",(0-1)),("roam",(0-1)),("smsfull",(0-1)),("GPRS coverage",(0-1)),("callsetup",(0-3))\r\n\r\nOK\r\n
ofonod[2534]: src/network.c:__ofono_netreg_add_status_watch() 0x86e9958
ofonod[2534]: Aux: > AT+CSMS?\r
ofonod[2534]: Aux: < \r\n+CSMS: 1,1,1,1\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CGREG=2\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CGAUTO=0\r
ofonod[2534]: Aux: < \r\nERROR\r\n
ofonod[2534]: Aux: > AT+CGEREP=2,1\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: src/network.c:__ofono_netreg_add_status_watch() 0x86e9958
ofonod[2534]: Aux: > AT+CRSM=178,28489,5,4,28\r
ofonod[2534]: Registered handle for channel 1: 0x10006
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CMER=3,0,0,1\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CREG?\r
ofonod[2534]: Aux: < \r\n+CREG: 2,2\r\n\r\nOK\r\n
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: src/gprs.c:netreg_status_changed() 2
ofonod[2534]: src/cbs.c:cbs_location_changed() 2, -1, -1, -1, (null)(null)
ofonod[2534]: Aux: > AT+CMGF=?\r
ofonod[2534]: Aux: < \r\n+CMGF: (0-1)\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CPSB=1\r
ofonod[2534]: Aux: < \r\nERROR\r\n
ofonod[2534]: Aux: > AT+CRSM=178,28489,6,4,28\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CPMS=?\r
ofonod[2534]: Aux: < \r\n+CPMS: ("ME","MT","SM","SR"),("ME","MT","SM","SR"),("ME","MT","SM","SR")\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=178,28489,7,4,28\r
ofonod[2534]: Aux: < \r\n+CREG: 1, 1600, 3E80\r\n\r\n+CGREG: 0\r\n\r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: src/gprs.c:netreg_status_changed() 1
ofonod[2534]: src/cbs.c:cbs_location_changed() 1, 5632, 16000, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 0
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CMGF=0\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS=3,2\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,2,"20801",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_numeric_cb() Cops numeric got mcc: 208, mnc: 01
ofonod[2534]: Aux: > AT+CIND?\r
ofonod[2534]: Aux: < \r\n+CIND: 2,0,1,0,0,0,0,0\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CGATT=1\r
ofonod[2534]: Aux: < \r\n+CREG: 2\r\n\r\n+CGREG: 2\r\n\r\n+CME ERROR: 30\r\n
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: src/gprs.c:netreg_status_changed() 2
ofonod[2534]: src/cbs.c:cbs_location_changed() 2, -1, -1, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 2
ofonod[2534]: src/gprs.c:gprs_attach_callback() /speedup0 error = 1
ofonod[2534]: Aux: > AT+CRSM=178,28489,8,4,28\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CPMS="ME","ME","ME"\r
ofonod[2534]: Aux: < \r\n+CPMS: 0,23,0,23,0,23\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS=3,0\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0\r\n\r\nOK\r\n
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: Aux: > AT+CGREG?\r
ofonod[2534]: Aux: < \r\n+CGREG: 2,2\r\n\r\nOK\r\n
ofonod[2534]: src/gprs.c:registration_status_cb() /speedup0 error 0 status 2
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 2
ofonod[2534]: Aux: > AT+CPBS=?\r
ofonod[2534]: Aux: < \r\n+CPBS: ("SM","DC","FD","LD","MC","ME","RC","EN","ON")\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=178,28489,9,4,28\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CNMI=?\r
ofonod[2534]: Aux: < \r\n+CNMI: (0,1,2),(0,1,2,3),(0,2),(0,1,2),(0,1)\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sms.c:build_cnmi_string()
ofonod[2534]: drivers/atmodem/sms.c:construct_ack_pdu()
ofonod[2534]: Aux: > AT+CRSM=178,28489,10,4,28\r
ofonod[2534]: Aux: < \r\n+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 28
ofonod[2534]: Aux: > AT+CNMI=1,2,2,1,0\r
ofonod[2534]: src/simfs.c:sim_fs_op_read_block() bufoff: 0, seekoff: 39, toread: 16
ofonod[2534]: drivers/atmodem/cbs.c:at_cbs_set_topics()
ofonod[2534]: src/simfs.c:sim_fs_op_read_block() bufoff: 0, seekoff: 39, toread: 17
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: src/network.c:__ofono_netreg_add_status_watch() 0x86e9958
ofonod[2534]: src/sms.c:sms_restore_tx_queue()
ofonod[2534]: plugins/push-notification.c:sms_watch() registered
ofonod[2534]: plugins/smart-messaging.c:sms_watch() registered
ofonod[2534]: Aux: > AT+CSCB=1\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CSCB=0,"0,33,78,102,130,4352-4356"\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+CRSM=192,28437\r
ofonod[2534]: Aux: < \r\n+CRSM: 106,130,""\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CMGL=4\r
ofonod[2534]: src/simfs.c:sim_fs_op_read_block() bufoff: 0, seekoff: 39, toread: 31
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: drivers/atmodem/sms.c:at_cmgl_done()
ofonod[2534]: Aux: > AT+CGSMS=3\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: < \r\n+CREG: 2\r\n\r\n+CGREG: 2\r\n\r\n+CREG: 2\r\n\r\n+CGREG: 2\r\n\r\n+CREG: 1, 1600, 3E80\r\n\r\n+CGREG: 0\r\n
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: src/gprs.c:netreg_status_changed() 2
ofonod[2534]: src/cbs.c:cbs_location_changed() 2, -1, -1, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 2
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: src/gprs.c:netreg_status_changed() 2
ofonod[2534]: src/cbs.c:cbs_location_changed() 2, -1, -1, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 2
ofonod[2534]: src/gprs.c:netreg_status_changed() 1
ofonod[2534]: src/cbs.c:cbs_location_changed() 1, 5632, 16000, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 0
ofonod[2534]: Aux: > AT+COPS=3,2\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,2,"20801",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_numeric_cb() Cops numeric got mcc: 208, mnc: 01
ofonod[2534]: Aux: > AT+CIND?\r
ofonod[2534]: Aux: < \r\n+CIND: 2,0,1,0,0,0,0,0\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CGATT=1\r
ofonod[2534]: Aux: < \r\n+CREG: 2\r\n\r\n+CGREG: 2\r\n\r\n+CREG: 1, 1600, 3E80\r\n\r\n+CGREG: 0\r\n\r\nOK\r\n
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: src/gprs.c:netreg_status_changed() 2
ofonod[2534]: src/cbs.c:cbs_location_changed() 2, -1, -1, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 2
ofonod[2534]: src/gprs.c:netreg_status_changed() 1
ofonod[2534]: src/cbs.c:cbs_location_changed() 1, 5632, 16000, -1, (null)(null)
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 0
ofonod[2534]: src/gprs.c:gprs_attach_callback() /speedup0 error = 0
ofonod[2534]: Aux: > AT+COPS=3,0\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,0,"Orange F",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_cb() cops_cb: Orange F, 208 01 0
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, (nil)
ofonod[2534]: src/gprs.c:netreg_status_changed() 1
ofonod[2534]: src/cbs.c:cbs_location_changed() 1, 5632, 16000, -1, 20801
ofonod[2534]: src/cbs.c:cbs_location_changed() 1, 0, 0
ofonod[2534]: Aux: > AT+COPS=3,2\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,2,"20801",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_numeric_cb() Cops numeric got mcc: 208, mnc: 01
ofonod[2534]: Aux: > AT+CIND?\r
ofonod[2534]: Aux: < \r\n+CIND: 2,0,1,0,0,0,0,0\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+CGREG?\r
ofonod[2534]: Aux: < \r\n+CGREG: 2,0\r\n\r\nOK\r\n
ofonod[2534]: src/gprs.c:registration_status_cb() /speedup0 error 0 status 0
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 0
ofonod[2534]: Aux: > AT+COPS=3,0\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,0,"Orange F",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_cb() cops_cb: Orange F, 208 01 0
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, 0x86f1398
ofonod[2534]: Aux: < \r\n+CREG: 1, 1600, 3E80\r\n\r\n+CGREG: 1, 1600, 3E80\r\n
ofonod[2534]: src/gprs.c:netreg_status_changed() 1
ofonod[2534]: src/cbs.c:cbs_location_changed() 1, 5632, 16000, -1, 20801
ofonod[2534]: src/cbs.c:cbs_location_changed() 0, 1, 0
ofonod[2534]: src/gprs.c:ofono_gprs_status_notify() /speedup0 status 1
ofonod[2534]: Aux: > AT+COPS=3,2\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,2,"20801",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_numeric_cb() Cops numeric got mcc: 208, mnc: 01
ofonod[2534]: Aux: > AT+CIND?\r
ofonod[2534]: Aux: < \r\n+CIND: 2,2,1,0,0,0,1,0\r\n\r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS=3,0\r
ofonod[2534]: Aux: < \r\nOK\r\n
ofonod[2534]: Aux: > AT+COPS?\r
ofonod[2534]: Aux: < \r\n+COPS: 0,0,"Orange F",0\r\n\r\nOK\r\n
ofonod[2534]: drivers/atmodem/network-registration.c:cops_cb() cops_cb: Orange F, 208 01 0
ofonod[2534]: src/network.c:current_operator_callback() 0x86e9958, 0x86f1398
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM
2011-08-04 7:34 ` Aygon, Bertrand
@ 2011-08-04 15:44 ` Marcel Holtmann
2011-08-04 15:56 ` Aygon, Bertrand
0 siblings, 1 reply; 13+ messages in thread
From: Marcel Holtmann @ 2011-08-04 15:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 779 bytes --]
Hi Bertrand,
> > > drivers/atmodem/sim.c | 95
> > +++++++++++++++++++++++++++++++++++++++++++++++++
> > > 1 files changed, 95 insertions(+), 0 deletions(-)
> >
> > please include an OFONO_AT_DEBUG trace of this AT command.
>
> I have attached a full log from a SpeedUp dongle, but here is the AT command that we are looking at:
>
> ofonod[2534]: Aux: > AT+CPNNUM\r
> ofonod[2534]: Aux: < \r\nPIN1=3; PUK1=10; PIN2=3; PUK2=10\r\r\nOK\r\n
this is so ugly. I sometimes really question the manufactures on why
nobody can create proper AT commands. Also one fun fact, if you issue
this one on the wrong TTY, you get the answer on the other one. That
will screw up our parse big time ;)
Nevertheless, I added a patch for this now.
Regards
Marcel
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM
2011-08-04 15:44 ` Marcel Holtmann
@ 2011-08-04 15:56 ` Aygon, Bertrand
0 siblings, 0 replies; 13+ messages in thread
From: Aygon, Bertrand @ 2011-08-04 15:56 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]
Hi,
> > > > drivers/atmodem/sim.c | 95
> > > +++++++++++++++++++++++++++++++++++++++++++++++++
> > > > 1 files changed, 95 insertions(+), 0 deletions(-)
> > >
> > > please include an OFONO_AT_DEBUG trace of this AT command.
> >
> > I have attached a full log from a SpeedUp dongle, but here is the AT
> command that we are looking at:
> >
> > ofonod[2534]: Aux: > AT+CPNNUM\r
> > ofonod[2534]: Aux: < \r\nPIN1=3; PUK1=10; PIN2=3; PUK2=10\r\r\nOK\r\n
>
> this is so ugly. I sometimes really question the manufactures on why
> nobody can create proper AT commands. Also one fun fact, if you issue
> this one on the wrong TTY, you get the answer on the other one. That
> will screw up our parse big time ;)
AT command protocol is soooo complex :)
> Nevertheless, I added a patch for this now.
Thanks,
Bertrand
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-08-04 15:56 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22 16:15 [PATCH 0/4] ZTE/SpeedUp specificities Philippe Nunes
2011-07-22 16:15 ` [PATCH 1/4] atmodem: Add vendor entry for SpeedUp modems Philippe Nunes
2011-07-27 14:13 ` Marcel Holtmann
2011-07-22 16:15 ` [PATCH 2/4] speedup: Create SIM atom with SpeedUp vendor to handle proprietary commands Philippe Nunes
2011-07-27 14:15 ` Marcel Holtmann
2011-07-22 16:15 ` [PATCH 3/4] atmodem: Add a polling based on CPIN query to detect SIM state change Philippe Nunes
2011-07-27 14:19 ` Marcel Holtmann
2011-07-22 16:15 ` [PATCH 4/4] atmodem: Add support for the PIN counter command AT+CPNNUM Philippe Nunes
2011-07-22 14:05 ` Denis Kenzior
2011-07-27 14:17 ` Marcel Holtmann
2011-08-04 7:34 ` Aygon, Bertrand
2011-08-04 15:44 ` Marcel Holtmann
2011-08-04 15:56 ` Aygon, Bertrand
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.