Re: [RFC PATCH 3/4] sim: add ofono_sim_get_mnc_length

2011-01-11 Thread Denis Kenzior
Hi Marcel,

On 01/10/2011 06:40 PM, Marcel Holtmann wrote:
 Hi Jukka,
 
  include/sim.h |1 +
  src/sim.c |8 
  2 files changed, 9 insertions(+), 0 deletions(-)

 diff --git a/include/sim.h b/include/sim.h
 index 7860e24..9b21f2e 100644
 --- a/include/sim.h
 +++ b/include/sim.h
 @@ -173,6 +173,7 @@ void ofono_sim_set_data(struct ofono_sim *sim, void 
 *data);
  void *ofono_sim_get_data(struct ofono_sim *sim);
  
  const char *ofono_sim_get_imsi(struct ofono_sim *sim);
 +unsigned int ofono_sim_get_mnc_length(struct ofono_sim *sim);
 
 so here is now the question. Do we wanna make this simple and do it like
 this or just provide functions to the MCC and MNC like we do inside the
 network registration interface?
 
 Denis, any favorites?
 

From an API point of view providing the mnc and mcc directly is a better
idea.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[RFC PATCH 3/4] sim: add ofono_sim_get_mnc_length

2011-01-10 Thread Jukka Saunamaki
---
 include/sim.h |1 +
 src/sim.c |8 
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/sim.h b/include/sim.h
index 7860e24..9b21f2e 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -173,6 +173,7 @@ void ofono_sim_set_data(struct ofono_sim *sim, void *data);
 void *ofono_sim_get_data(struct ofono_sim *sim);
 
 const char *ofono_sim_get_imsi(struct ofono_sim *sim);
+unsigned int ofono_sim_get_mnc_length(struct ofono_sim *sim);
 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);
diff --git a/src/sim.c b/src/sim.c
index 335f611..e9b1688 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1913,6 +1913,14 @@ const char *ofono_sim_get_imsi(struct ofono_sim *sim)
return sim-imsi;
 }
 
+unsigned int ofono_sim_get_mnc_length(struct ofono_sim *sim)
+{
+   if (sim == NULL)
+   return 0;
+
+   return sim-mnc_length;
+}
+
 enum ofono_sim_phase ofono_sim_get_phase(struct ofono_sim *sim)
 {
if (sim == NULL)
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono