aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGjermund Hodnebrog <gjermund.hodnebrog@stericsson.com>2011-05-27 13:30:20 +0200
committerSverre Vegge <sverre.vegge@stericsson.com>2011-08-02 21:54:30 +0200
commitc6f6e66431f801baf6cd73fb3e76223de31b1ea3 (patch)
tree167e25d7cd45b1c9685b67d23097440fc2ad4b6e
parent72a2fece6e59c1c95e980286bf4cc6b7ec772053 (diff)
downloadu300-c6f6e66431f801baf6cd73fb3e76223de31b1ea3.tar.gz
STK: Path parameter of *ESHLREF is hex string
An fault in the AT manual probably caused this implementation fault in the RIL. Also rewrote the for loop that was hard to read and understand. Signed-off-by: Sverre Vegge <sverre.vegge@stericsson.com>
-rw-r--r--u300-ril-stk.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/u300-ril-stk.c b/u300-ril-stk.c
index 1d19e05..0b18166 100644
--- a/u300-ril-stk.c
+++ b/u300-ril-stk.c
@@ -500,7 +500,8 @@ void onStkSimRefresh(const char *s)
int commas = 0;
char *line = NULL;
char *tok = NULL;
- int i, skip;
+ char *skip;
+ int n = 0;
int err = -1;
int response[2];
@@ -565,28 +566,26 @@ void onStkSimRefresh(const char *s)
goto exit;
}
- for (i = 0; i < commas; i += 2) {
+ /* Loop for each fileid and pathid included */
+ while (at_tok_hasmore(&tok)) {
err = at_tok_nextint(&tok, &(response[1]));
- if (err < 0) {
- /* check if response is already sent to Android */
- if (i > 0)
- goto exit;
- else
- goto error;
- }
+ if (err < 0)
+ break;
/* <pathid> is not used by Android */
- err = at_tok_nextint(&tok, &skip);
- if (err < 0) {
- /* check if response is already sent to Android */
- if (i > 0)
- goto exit;
- else
- goto error;
- }
+ err = at_tok_nextstr(&tok, &skip);
+ if (err < 0)
+ break;
RIL_onUnsolicitedResponse(RIL_UNSOL_SIM_REFRESH,
response, sizeof(response));
+ n++;
}
- goto exit;
+
+ /*
+ * At least one set of fileid and pathid is expected when sending
+ * SIM_FILE_UPDATE to Android
+ */
+ if (n > 0)
+ goto exit;
error:
LOGE("%s: failed to parse %s, default to SIM_INITIALIZATION", __func__, s);