summaryrefslogtreecommitdiffstats
path: root/src/sim.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-01-12 11:27:31 -0600
committerDenis Kenzior <denkenz@gmail.com>2010-01-12 11:27:31 -0600
commit0382f6435357ec41be496702aa8d27bd6e1bf4c3 (patch)
tree4adfc3c8fdd0018205a5508f1abead37b884f639 /src/sim.c
parent2b231c3f8487f51ee0691e2e97ef1207bbf79e0d (diff)
downloadofono-0382f6435357ec41be496702aa8d27bd6e1bf4c3.tar.bz2
Refactor: Rename & Restructure cphs_support
- Rename to cphs_service_table to be more inline with the specification. - Since the spec allows arbitrary length service tables, use an unsigned char * return instead of a short. - Use bit_field function instead of defining an enum
Diffstat (limited to 'src/sim.c')
-rw-r--r--src/sim.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sim.c b/src/sim.c
index 502dd372..1d17fa35 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -89,7 +89,7 @@ struct ofono_sim {
unsigned char *efli;
unsigned char efli_length;
enum ofono_sim_cphs_phase cphs_phase;
- unsigned short cphs_support;
+ unsigned char cphs_service_table[2];
struct ofono_watchlist *ready_watches;
const struct ofono_sim_driver *driver;
void *driver_data;
@@ -969,7 +969,7 @@ static void sim_cphs_information_read_cb(int ok, int length, int record,
else if (data[0] >= 0x02)
sim->cphs_phase = OFONO_SIM_CPHS_PHASE_2G;
- sim->cphs_support = (data[2] << 8) | data[1];
+ memcpy(sim->cphs_service_table, data + 1, 2);
ready:
ofono_sim_set_ready(sim);
@@ -1729,17 +1729,17 @@ enum ofono_sim_phase ofono_sim_get_phase(struct ofono_sim *sim)
enum ofono_sim_cphs_phase ofono_sim_get_cphs_phase(struct ofono_sim *sim)
{
if (sim == NULL)
- return OFONO_SIM_CPHS_NONE;
+ return OFONO_SIM_CPHS_PHASE_NONE;
return sim->cphs_phase;
}
-unsigned short ofono_sim_get_cphs_support(struct ofono_sim *sim)
+const unsigned char *ofono_sim_get_cphs_service_table(struct ofono_sim *sim)
{
if (sim == NULL)
- return 0;
+ return NULL;
- return sim->cphs_support;
+ return sim->cphs_service_table;
}
unsigned int ofono_sim_add_ready_watch(struct ofono_sim *sim,