diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-10-27 19:47:52 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-10-27 19:47:52 -0500 |
commit | 24d8a5722b0c72c01a04d0aa84995643db7dd705 (patch) | |
tree | 8c1533e4373731903e4cb57bfa24ace8e4da1a0c /src/cbs.c | |
parent | ed813455c2cd9e942e63b1dd6a1b64fdf6c048a8 (diff) | |
download | ofono-24d8a5722b0c72c01a04d0aa84995643db7dd705.tar.bz2 |
Refactor: replace netreg get_operator with mcc/mnc
The full operator information is useless as only mcc/mnc are really
required. The internal structures will be changing soon
Diffstat (limited to 'src/cbs.c')
-rw-r--r-- | src/cbs.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -767,7 +767,8 @@ static void netreg_watch(struct ofono_atom *atom, void *data) { struct ofono_cbs *cbs = data; - const struct ofono_network_operator *op; + const char *mcc; + const char *mnc; if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) { cbs->location_watch = 0; @@ -779,11 +780,12 @@ static void netreg_watch(struct ofono_atom *atom, cbs->location_watch = __ofono_netreg_add_status_watch(cbs->netreg, cbs_location_changed, cbs, NULL); - op = ofono_netreg_get_operator(cbs->netreg); + mcc = ofono_netreg_get_mcc(cbs->netreg); + mnc = ofono_netreg_get_mnc(cbs->netreg); - if (op) { - memcpy(cbs->mcc, op->mcc, sizeof(cbs->mcc)); - memcpy(cbs->mnc, op->mnc, sizeof(cbs->mnc)); + if (mcc && mnc) { + memcpy(cbs->mcc, mcc, sizeof(cbs->mcc)); + memcpy(cbs->mnc, mnc, sizeof(cbs->mnc)); } else { memset(cbs->mcc, 0, sizeof(cbs->mcc)); memset(cbs->mnc, 0, sizeof(cbs->mnc)); |