Tizen 2.1 base
[platform/core/telephony/tel-plugin-imc.git] / packaging / 0020-s_sim.c-Fix-get-lock-info.patch
1 From 6c206b12570762126bf0a35f6c0054edc14aa14b Mon Sep 17 00:00:00 2001
2 From: Philippe Nunes <philippe.nunes@linux.intel.com>
3 Date: Fri, 11 Jan 2013 17:20:31 +0100
4 Subject: [PATCH 20/23] s_sim.c: Fix get lock info
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
7
8 The "lock_type" parameter used by the AT command AT+XPINCNT[=lock_type]
9 shall be an integer type when used with our PR3 modem whereas this is
10 a string for the Lunchbox modem.
11 ---
12  src/s_sim.c |   18 +++++++++---------
13  1 file changed, 9 insertions(+), 9 deletions(-)
14
15 diff --git a/src/s_sim.c b/src/s_sim.c
16 index a74bf7c..a96594b 100644
17 --- a/src/s_sim.c
18 +++ b/src/s_sim.c
19 @@ -2961,7 +2961,7 @@ static TReturn s_get_lock_info(CoreObject *o, UserRequest *ur)
20         TcoreATRequest *req = NULL;
21         TcorePending *pending = NULL;
22         char *cmd_str = NULL;
23 -       char *lock_type = NULL;
24 +       int lock_type = 0;
25         const struct treq_sim_get_lock_info *req_data;
26         struct s_sim_property *sp = NULL;
27  
28 @@ -2981,37 +2981,37 @@ static TReturn s_get_lock_info(CoreObject *o, UserRequest *ur)
29  
30         switch (req_data->type) {
31         case SIM_FACILITY_PS:
32 -               lock_type = "PS";
33 +               lock_type = 9; // IMSI lock
34                 break;
35  
36         case SIM_FACILITY_SC:
37 -               lock_type = "SC";
38 +               lock_type = 1;
39                 break;
40  
41         case SIM_FACILITY_FD:
42 -               lock_type = "FD";
43 +               lock_type = 2;
44                 break;
45  
46         case SIM_FACILITY_PN:
47 -               lock_type = "PN";
48 +               lock_type = 5;
49                 break;
50  
51         case SIM_FACILITY_PU:
52 -               lock_type = "PU";
53 +               lock_type = 6;
54                 break;
55  
56         case SIM_FACILITY_PP:
57 -               lock_type = "PP";
58 +               lock_type = 7;
59                 break;
60  
61         case SIM_FACILITY_PC:
62 -               lock_type = "PC";
63 +               lock_type = 8;
64                 break;
65  
66         default:
67                 break;
68         }
69 -       cmd_str = g_strdup_printf("AT+XPINCNT =\"%s\"", lock_type);
70 +       cmd_str = g_strdup_printf("AT+XPINCNT =%d", lock_type);
71         req = tcore_at_request_new(cmd_str, "+XPINCNT:", TCORE_AT_SINGLELINE);
72  
73         dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d", req->cmd, req->prefix, strlen(req->cmd));
74 -- 
75 1.7.10.4
76