From 3763ffa54238aaf1221446232cf5256c62e9d0ad Mon Sep 17 00:00:00 2001 From: "jooseok.park" Date: Thu, 11 Jul 2013 16:28:08 +0900 Subject: [PATCH] bug fix for that VCONFKEY_TELEPHONY_PLMN is always 0 - add plmn_id copy in on_response_get_serving_network() Change-Id: I555571735b5285c28aefb87a3da213cdd7ec273e --- packaging/tel-plugin-imc.spec | 2 +- src/s_network.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packaging/tel-plugin-imc.spec b/packaging/tel-plugin-imc.spec index 2047220..93531b3 100644 --- a/packaging/tel-plugin-imc.spec +++ b/packaging/tel-plugin-imc.spec @@ -1,7 +1,7 @@ #sbs-git:slp/pkgs/t/tel-plugin-imc Name: tel-plugin-imc Summary: imc plugin for telephony -Version: 0.1.39 +Version: 0.1.40 Release: 1 Group: Development/Libraries License: Apache diff --git a/src/s_network.c b/src/s_network.c index 8857074..47f9547 100644 --- a/src/s_network.c +++ b/src/s_network.c @@ -1047,7 +1047,6 @@ static void on_response_get_serving_network(TcorePending *p, int data_len, const const TcoreATResponse *resp = data; UserRequest *ur; struct tresp_network_get_serving_network Tresp = {0}; - char plmn[7] = {0}; char *long_plmn_name = NULL; char *short_plmn_name = NULL; char *plmn_id = NULL; @@ -1150,7 +1149,8 @@ static void on_response_get_serving_network(TcorePending *p, int data_len, const tcore_at_tok_free(tokens); } - memcpy(Tresp.plmn, plmn, 7); + if(plmn_id) + memcpy(Tresp.plmn, plmn_id, strlen(plmn_id)); tcore_network_get_access_technology(o, &(Tresp.act)); tcore_network_get_lac(o, &(Tresp.gsm.lac)); @@ -1163,7 +1163,8 @@ static void on_response_get_serving_network(TcorePending *p, int data_len, const struct tnoti_network_change network_change; memset(&network_change, 0, sizeof(struct tnoti_network_change)); - memcpy(network_change.plmn, plmn, 7); + if(plmn_id) + memcpy(network_change.plmn, plmn_id, strlen(plmn_id)); tcore_network_get_access_technology(o, &(network_change.act)); tcore_network_get_lac(o, &(network_change.gsm.lac)); @@ -1176,7 +1177,7 @@ static void on_response_get_serving_network(TcorePending *p, int data_len, const if ((AT_COPS_MODE_DEREGISTER != network_mode) && (AT_COPS_MODE_SET_ONLY != network_mode)) { /*Network identity noti*/ - memset(¬i, 0x0, sizeof(struct tnoti_network_change)); + memset(¬i, 0x0, sizeof(struct tnoti_network_identity)); if (long_plmn_name) memcpy(noti.full_name, long_plmn_name, MIN(32, strlen(long_plmn_name))); if (short_plmn_name) -- 2.7.4