Tizen 2.1 base
[platform/core/telephony/tel-plugin-imc.git] / packaging / 0002-s_modem-CGMR-response-parsing-is-compatible-with-IMC.patch
1 From 389f7a04eefccdec5f2597df0d6c836a0010b268 Mon Sep 17 00:00:00 2001
2 From: Philippe Nunes <philippe.nunes@linux.intel.com>
3 Date: Tue, 18 Sep 2012 17:47:49 +0200
4 Subject: [PATCH 02/23] s_modem: CGMR response parsing is compatible with IMC
5  PR3 modem
6 Content-Type: text/plain; charset="utf-8"
7 Content-Transfer-Encoding: 8bit
8
9 ---
10  src/s_modem.c |   21 ++++++++++++---------
11  1 file changed, 12 insertions(+), 9 deletions(-)
12
13 diff --git a/src/s_modem.c b/src/s_modem.c
14 index 88a06a7..edd1ca9 100644
15 --- a/src/s_modem.c
16 +++ b/src/s_modem.c
17 @@ -360,20 +360,23 @@ static void on_response_version(TcorePending *p, int data_len, const void *data,
18                 if (resp->lines) {
19                         line = (const char *) resp->lines->data;
20                         tokens = tcore_at_tok_new(line);
21 -                       if (g_slist_length(tokens) != 5) {
22 +                       if (g_slist_length(tokens) == 1) {
23 +                               swver = g_slist_nth_data(tokens, 0);
24 +                               dbg("version: sw=[%s]", swver);
25 +                       } else if (g_slist_length(tokens) == 5) {
26 +                               swver = g_slist_nth_data(tokens, 0);
27 +                               hwver = g_slist_nth_data(tokens, 1);
28 +                               caldate = g_slist_nth_data(tokens, 2);
29 +                               pcode = g_slist_nth_data(tokens, 3);
30 +                               id = g_slist_nth_data(tokens, 4);
31 +
32 +                               dbg("version: sw=[%s], hw=[%s], rf_cal=[%s], product_code=[%s], model_id=[%s]", swver, hwver, caldate, pcode, id);
33 +                       } else {
34                                 msg("invalid message");
35                                 goto OUT;
36                         }
37                 }
38  
39 -               swver = g_slist_nth_data(tokens, 0);
40 -               hwver = g_slist_nth_data(tokens, 1);
41 -               caldate = g_slist_nth_data(tokens, 2);
42 -               pcode = g_slist_nth_data(tokens, 3);
43 -               id = g_slist_nth_data(tokens, 4);
44 -
45 -               dbg("version: sw=[%s], hw=[%s], rf_cal=[%s], product_code=[%s], model_id=[%s]", swver, hwver, caldate, pcode, id);
46 -
47                 vi = calloc(sizeof(TelMiscVersionInformation), 1);
48                 if (NULL != swver)
49                         memcpy(vi->szSwVersion, swver, strlen(swver));
50 -- 
51 1.7.10.4
52