Open Source Telephony
 help / color / mirror / Atom feed
* Expose service dialling numbers stored on SIM through SimManager.
@ 2009-08-19 20:09 Andrzej Zaborowski
  2009-08-25 16:41 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Andrzej Zaborowski @ 2009-08-19 20:09 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 5681 bytes --]

---
The ServiceDiallingNumbers property now returns a list of strings (alpha
identifiers interleaved with dialling numbers) and this is a little hacky
but returning a dictionary would make the interface more hassle to use so
I'm not sure what's better.
---
 src/sim.c     |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 src/simutil.h |    1 +
 2 files changed, 111 insertions(+), 7 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index 2298cbf..2287458 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -80,6 +80,7 @@ struct sim_manager_data {
 	int mnc_length;
 	GSList *own_numbers;
 	GSList *new_numbers;
+	GSList *service_numbers;
 	GSList *ready_notify;
 	gboolean ready;
 	GQueue *simop_q;
@@ -89,6 +90,11 @@ struct sim_manager_data {
 	unsigned char efmsisdn_records;
 };
 
+struct service_number {
+	char *id;
+	struct ofono_phone_number ph;
+};
+
 struct msisdn_set_request {
 	struct ofono_modem *modem;
 	int pending;
@@ -118,11 +124,39 @@ static char **get_own_numbers(GSList *own_numbers)
 	return ret;
 }
 
+static char **get_service_numbers(GSList *service_numbers)
+{
+	int nelem;
+	GSList *l;
+	struct service_number *num;
+	char **ret;
+
+	nelem = g_slist_length(service_numbers) * 2;
+
+	ret = g_new0(char *, nelem + 1);
+
+	nelem = 0;
+	for (l = service_numbers; l; l = l->next) {
+		num = l->data;
+
+		ret[nelem++] = g_strdup(num->id);
+		ret[nelem++] = g_strdup(phone_number_to_string(&num->ph));
+	}
+
+	return ret;
+}
+
 static void sim_file_op_free(struct sim_file_op *node)
 {
 	g_free(node);
 }
 
+static void service_number_free(struct service_number *num)
+{
+	g_free(num->id);
+	g_free(num);
+}
+
 static struct sim_manager_data *sim_manager_create()
 {
 	return g_try_new0(struct sim_manager_data, 1);
@@ -144,6 +178,13 @@ static void sim_manager_destroy(gpointer userdata)
 		data->own_numbers = NULL;
 	}
 
+	if (data->service_numbers) {
+		g_slist_foreach(data->service_numbers,
+				(GFunc)service_number_free, NULL);
+		g_slist_free(data->service_numbers);
+		data->service_numbers = NULL;
+	}
+
 	if (data->simop_source) {
 		g_source_remove(data->simop_source);
 		data->simop_source = 0;
@@ -165,6 +206,7 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 	DBusMessageIter iter;
 	DBusMessageIter dict;
 	char **own_numbers;
+	char **service_numbers;
 	unsigned char mnc_len;
 
 	reply = dbus_message_new_method_return(msg);
@@ -194,6 +236,15 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 					DBUS_TYPE_STRING, &own_numbers);
 	g_strfreev(own_numbers);
 
+	if (sim->service_numbers) {
+		service_numbers = get_service_numbers(sim->service_numbers);
+
+		ofono_dbus_dict_append_array(&dict, "ServiceDiallingNumbers",
+						DBUS_TYPE_STRING,
+						&service_numbers);
+		g_strfreev(service_numbers);
+	}
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	return reply;
@@ -476,22 +527,74 @@ static void sim_ad_read_cb(struct ofono_modem *modem, int ok,
 	}
 }
 
-static void sim_own_numbers_update(struct ofono_modem *modem)
+static void sim_sdn_read_cb(struct ofono_modem *modem, int ok,
+				enum ofono_sim_file_structure structure,
+				int length, int record,
+				const unsigned char *data,
+				int record_length, void *userdata)
 {
-	ofono_sim_read(modem, SIM_EFMSISDN_FILEID,
-			sim_msisdn_read_cb, modem->sim_manager);
+	struct sim_manager_data *sim = userdata;
+	int total;
+	struct ofono_phone_number ph;
+	char *alpha;
+	char **service_numbers;
+	DBusConnection *conn = ofono_dbus_get_connection();
+
+	if (!ok)
+		goto check;
+
+	if (structure != OFONO_SIM_FILE_STRUCTURE_FIXED)
+		return;
+
+	if (record_length < 14 || length < record_length)
+		return;
+
+	total = length / record_length;
+
+	if (sim_adn_parse(data, record_length, &ph, &alpha) == TRUE && alpha) {
+		struct service_number *sdn;
+
+		sdn = g_new(struct service_number, 1);
+		sdn->id = alpha;
+		memcpy(&sdn->ph, &ph, sizeof(struct ofono_phone_number));
+
+		sim->service_numbers =
+			g_slist_prepend(sim->service_numbers, sdn);
+	}
+
+	if (record != total)
+		return;
+
+check:
+	/* All records retrieved */
+	if (sim->service_numbers) {
+		sim->service_numbers = g_slist_reverse(sim->service_numbers);
+
+		service_numbers = get_service_numbers(sim->service_numbers);
+
+		ofono_dbus_signal_array_property_changed(conn, modem->path,
+						SIM_MANAGER_INTERFACE,
+						"ServiceDiallingNumbers",
+						DBUS_TYPE_STRING,
+						&service_numbers);
+		g_strfreev(service_numbers);
+	}
 }
 
-static void sim_mnc_length_update(struct ofono_modem *modem)
+static void sim_own_numbers_update(struct ofono_modem *modem)
 {
-	ofono_sim_read(modem, SIM_EFAD_FILEID,
-			sim_ad_read_cb, modem->sim_manager);
+	ofono_sim_read(modem, SIM_EFMSISDN_FILEID,
+			sim_msisdn_read_cb, modem->sim_manager);
 }
 
 static void sim_ready(struct ofono_modem *modem)
 {
 	sim_own_numbers_update(modem);
-	sim_mnc_length_update(modem);
+
+	ofono_sim_read(modem, SIM_EFAD_FILEID,
+			sim_ad_read_cb, modem->sim_manager);
+	ofono_sim_read(modem, SIM_EFSDN_FILEID,
+			sim_sdn_read_cb, modem->sim_manager);
 }
 
 static void sim_imsi_cb(const struct ofono_error *error, const char *imsi,
diff --git a/src/simutil.h b/src/simutil.h
index dccbe7b..de3e55e 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -22,6 +22,7 @@
 enum sim_fileid {
 	SIM_EFMSISDN_FILEID = 0x6f40,
 	SIM_EFSPN_FILEID = 0x6f46,
+	SIM_EFSDN_FILEID = 0x6f49,
 	SIM_EFAD_FILEID = 0x6fad,
 	SIM_EFPNN_FILEID = 0x6fc5,
 	SIM_EFOPL_FILEID = 0x6fc6,
-- 
1.6.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Expose service dialling numbers stored on SIM through SimManager.
  2009-08-19 20:09 Expose service dialling numbers stored on SIM through SimManager Andrzej Zaborowski
@ 2009-08-25 16:41 ` Denis Kenzior
  2009-08-26  0:43   ` Andrzej Zaborowski
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2009-08-25 16:41 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3491 bytes --]

Hi Andrew,

On Wed, Aug 19, 2009 at 3:09 PM, Andrzej Zaborowski <
andrew.zaborowski@intel.com> wrote:

> ---
> The ServiceDiallingNumbers property now returns a list of strings (alpha
> identifiers interleaved with dialling numbers) and this is a little hacky
> but returning a dictionary would make the interface more hassle to use so
> I'm not sure what's better.


Please re-base and resubmit this patch, it does not apply cleanly after the
latest round of changes.

Also, lets return a dictionary.  Applications already need to parse
GetProperties, which is a dictionary of strings to variants, so
string->string shouldn't be a big deal.


> +
> +       if (sim_adn_parse(data, record_length, &ph, &alpha) == TRUE &&
> alpha) {
> +               struct service_number *sdn;
> +
> +               sdn = g_new(struct service_number, 1);
> +               sdn->id = alpha;


Lets make sure that the id is non-empty.  If it is empty, we should we use
the phone number as the id unless you can think of something better.


>
> +               memcpy(&sdn->ph, &ph, sizeof(struct ofono_phone_number));
> +
> +               sim->service_numbers =
> +                       g_slist_prepend(sim->service_numbers, sdn);


Do we want to check for id uniqueness here?


>
> +       }
> +
> +       if (record != total)
> +               return;
> +
> +check:
> +       /* All records retrieved */
> +       if (sim->service_numbers) {
> +               sim->service_numbers =
> g_slist_reverse(sim->service_numbers);
> +
> +               service_numbers =
> get_service_numbers(sim->service_numbers);
> +
> +               ofono_dbus_signal_array_property_changed(conn, modem->path,
> +                                               SIM_MANAGER_INTERFACE,
> +                                               "ServiceDiallingNumbers",
> +                                               DBUS_TYPE_STRING,
> +                                               &service_numbers);
> +               g_strfreev(service_numbers);
> +       }
>  }
>
> -static void sim_mnc_length_update(struct ofono_modem *modem)
> +static void sim_own_numbers_update(struct ofono_modem *modem)
>  {
> -       ofono_sim_read(modem, SIM_EFAD_FILEID,
> -                       sim_ad_read_cb, modem->sim_manager);
> +       ofono_sim_read(modem, SIM_EFMSISDN_FILEID,
> +                       sim_msisdn_read_cb, modem->sim_manager);
>  }
>
>  static void sim_ready(struct ofono_modem *modem)
>  {
>        sim_own_numbers_update(modem);
> -       sim_mnc_length_update(modem);
> +
> +       ofono_sim_read(modem, SIM_EFAD_FILEID,
> +                       sim_ad_read_cb, modem->sim_manager);
> +       ofono_sim_read(modem, SIM_EFSDN_FILEID,
> +                       sim_sdn_read_cb, modem->sim_manager);
>  }
>
>  static void sim_imsi_cb(const struct ofono_error *error, const char *imsi,
> diff --git a/src/simutil.h b/src/simutil.h
> index dccbe7b..de3e55e 100644
> --- a/src/simutil.h
> +++ b/src/simutil.h
> @@ -22,6 +22,7 @@
>  enum sim_fileid {
>        SIM_EFMSISDN_FILEID = 0x6f40,
>        SIM_EFSPN_FILEID = 0x6f46,
> +       SIM_EFSDN_FILEID = 0x6f49,
>        SIM_EFAD_FILEID = 0x6fad,
>        SIM_EFPNN_FILEID = 0x6fc5,
>        SIM_EFOPL_FILEID = 0x6fc6,
> --
> 1.6.1
>
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4496 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Expose service dialling numbers stored on SIM through SimManager.
  2009-08-25 16:41 ` Denis Kenzior
@ 2009-08-26  0:43   ` Andrzej Zaborowski
  2009-08-31 20:16     ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Andrzej Zaborowski @ 2009-08-26  0:43 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

Hi,

2009/8/25 Denis Kenzior <denkenz@gmail.com>:
> Please re-base and resubmit this patch, it does not apply cleanly after the
> latest round of changes.
> Also, lets return a dictionary.  Applications already need to parse
> GetProperties, which is a dictionary of strings to variants, so
> string->string shouldn't be a big deal.
>
>>
>> +
>> +       if (sim_adn_parse(data, record_length, &ph, &alpha) == TRUE &&
>> alpha) {
>> +               struct service_number *sdn;
>> +
>> +               sdn = g_new(struct service_number, 1);
>> +               sdn->id = alpha;
>
> Lets make sure that the id is non-empty.  If it is empty, we should we use
> the phone number as the id unless you can think of something better.
>
>>
>> +               memcpy(&sdn->ph, &ph, sizeof(struct ofono_phone_number));
>> +
>> +               sim->service_numbers =
>> +                       g_slist_prepend(sim->service_numbers, sdn);
>
> Do we want to check for id uniqueness here?

Thanks for the remarks, incorporated them in the patch and updated it
to current.

Regards

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-Expose-service-dialling-numbers-stored-on-SIM-throug.patch --]
[-- Type: text/x-patch, Size: 9768 bytes --]

From eaddaf02b27fb8f299a31851d9f1bbb52f5421cc Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Date: Wed, 26 Aug 2009 04:27:04 +0200
Subject: [PATCH] Expose service dialling numbers stored on SIM through SimManager.

---
 include/dbus.h |    9 ++++
 src/dbus.c     |   80 +++++++++++++++++++++++++++++++
 src/sim.c      |  144 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 src/simutil.h  |    1 +
 4 files changed, 227 insertions(+), 7 deletions(-)

diff --git a/include/dbus.h b/include/dbus.h
index 1d9f59f..5a42119 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -52,6 +52,9 @@ void ofono_dbus_dict_append(DBusMessageIter *dict, const char *key, int type,
 void ofono_dbus_dict_append_array(DBusMessageIter *dict, const char *key,
 					int type, void *val);
 
+void ofono_dbus_dict_append_dict(DBusMessageIter *dict, const char *key,
+					int type, void *val);
+
 int ofono_dbus_signal_property_changed(DBusConnection *conn, const char *path,
 					const char *interface, const char *name,
 					int type, void *value);
@@ -62,6 +65,12 @@ int ofono_dbus_signal_array_property_changed(DBusConnection *conn,
 						const char *name, int type,
 						void *value);
 
+int ofono_dbus_signal_dict_property_changed(DBusConnection *conn,
+						const char *path,
+						const char *interface,
+						const char *name, int type,
+						void *value);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/dbus.c b/src/dbus.c
index b271e89..b2486f4 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -112,6 +112,59 @@ void ofono_dbus_dict_append_array(DBusMessageIter *dict, const char *key,
 	dbus_message_iter_close_container(dict, &entry);
 }
 
+static void append_dict_variant(DBusMessageIter *iter, int type, void *val)
+{
+	DBusMessageIter variant, array, entry;
+	char typesig[5];
+	char arraysig[6];
+	const void **val_array = *(const void ***)val;
+	int i;
+
+	arraysig[0] = DBUS_TYPE_ARRAY;
+	arraysig[1] = typesig[0] = DBUS_DICT_ENTRY_BEGIN_CHAR;
+	arraysig[2] = typesig[1] = DBUS_TYPE_STRING;
+	arraysig[3] = typesig[2] = type;
+	arraysig[4] = typesig[3] = DBUS_DICT_ENTRY_END_CHAR;
+	arraysig[5] = typesig[4] = '\0';
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+						arraysig, &variant);
+
+	dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY,
+						typesig, &array);
+
+	for (i = 0; val_array[i]; i += 2) {
+		dbus_message_iter_open_container(&array, DBUS_TYPE_DICT_ENTRY,
+							NULL, &entry);
+
+		dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
+						&(val_array[i + 0]));
+		dbus_message_iter_append_basic(&entry, type,
+						&(val_array[i + 1]));
+
+		dbus_message_iter_close_container(&array, &entry);
+	}
+
+	dbus_message_iter_close_container(&variant, &array);
+
+	dbus_message_iter_close_container(iter, &variant);
+}
+
+void ofono_dbus_dict_append_dict(DBusMessageIter *dict, const char *key,
+				int type, void *val)
+{
+	DBusMessageIter entry;
+
+	dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
+						NULL, &entry);
+
+	dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
+
+	append_dict_variant(&entry, type, val);
+
+	dbus_message_iter_close_container(dict, &entry);
+}
+
 int ofono_dbus_signal_property_changed(DBusConnection *conn,
 					const char *path,
 					const char *interface,
@@ -165,6 +218,33 @@ int ofono_dbus_signal_array_property_changed(DBusConnection *conn,
 	return g_dbus_send_message(conn, signal);
 }
 
+int ofono_dbus_signal_dict_property_changed(DBusConnection *conn,
+						const char *path,
+						const char *interface,
+						const char *name,
+						int type, void *value)
+
+{
+	DBusMessage *signal;
+	DBusMessageIter iter;
+
+	signal = dbus_message_new_signal(path, interface, "PropertyChanged");
+
+	if (!signal) {
+		ofono_error("Unable to allocate new %s.PropertyChanged signal",
+				interface);
+		return -1;
+	}
+
+	dbus_message_iter_init_append(signal, &iter);
+
+	dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &name);
+
+	append_dict_variant(&iter, type, value);
+
+	return g_dbus_send_message(conn, signal);
+}
+
 DBusMessage *__ofono_error_invalid_args(DBusMessage *msg)
 {
 	return g_dbus_create_error(msg, DBUS_GSM_ERROR_INTERFACE
diff --git a/src/sim.c b/src/sim.c
index 6f8406b..55a1ebf 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -79,6 +79,7 @@ struct ofono_sim {
 	unsigned char mnc_length;
 	GSList *own_numbers;
 	GSList *new_numbers;
+	GSList *service_numbers;
 	gboolean ready;
 	GQueue *simop_q;
 	gint simop_source;
@@ -105,6 +106,11 @@ struct sim_ready_watch {
 	ofono_destroy_func destroy;
 };
 
+struct service_number {
+	char *id;
+	struct ofono_phone_number ph;
+};
+
 static char **get_own_numbers(GSList *own_numbers)
 {
 	int nelem = 0;
@@ -127,11 +133,39 @@ static char **get_own_numbers(GSList *own_numbers)
 	return ret;
 }
 
+static char **get_service_numbers(GSList *service_numbers)
+{
+	int nelem;
+	GSList *l;
+	struct service_number *num;
+	char **ret;
+
+	nelem = g_slist_length(service_numbers) * 2;
+
+	ret = g_new0(char *, nelem + 1);
+
+	nelem = 0;
+	for (l = service_numbers; l; l = l->next) {
+		num = l->data;
+
+		ret[nelem++] = g_strdup(num->id);
+		ret[nelem++] = g_strdup(phone_number_to_string(&num->ph));
+	}
+
+	return ret;
+}
+
 static void sim_file_op_free(struct sim_file_op *node)
 {
 	g_free(node);
 }
 
+static void service_number_free(struct service_number *num)
+{
+	g_free(num->id);
+	g_free(num);
+}
+
 static DBusMessage *sim_get_properties(DBusConnection *conn,
 					DBusMessage *msg, void *data)
 {
@@ -140,6 +174,7 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 	DBusMessageIter iter;
 	DBusMessageIter dict;
 	char **own_numbers;
+	char **service_numbers;
 
 	reply = dbus_message_new_method_return(msg);
 	if (!reply)
@@ -165,6 +200,15 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 					DBUS_TYPE_STRING, &own_numbers);
 	g_strfreev(own_numbers);
 
+	if (sim->service_numbers) {
+		service_numbers = get_service_numbers(sim->service_numbers);
+
+		ofono_dbus_dict_append_dict(&dict, "ServiceDiallingNumbers",
+						DBUS_TYPE_STRING,
+						&service_numbers);
+		g_strfreev(service_numbers);
+	}
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	return reply;
@@ -444,16 +488,91 @@ static void sim_ad_read_cb(int ok,
 	}
 }
 
-static void sim_own_numbers_update(struct ofono_sim *sim)
+static gint service_number_compare(gconstpointer a, gconstpointer b)
 {
-	ofono_sim_read(sim, SIM_EFMSISDN_FILEID,
-			sim_msisdn_read_cb, sim);
+	const struct service_number *sdn = a;
+	const char *id = b;
+
+	return strcmp(sdn->id, id);
 }
 
-static void sim_mnc_length_update(struct ofono_sim *sim)
+static void sim_sdn_read_cb(int ok,
+				enum ofono_sim_file_structure structure,
+				int length, int record,
+				const unsigned char *data,
+				int record_length, void *userdata)
 {
-	ofono_sim_read(sim, SIM_EFAD_FILEID,
-			sim_ad_read_cb, sim);
+	struct ofono_sim *sim = userdata;
+	int total;
+	struct ofono_phone_number ph;
+	char *alpha;
+	char **service_numbers;
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *path = __ofono_atom_get_path(sim->atom);
+
+	if (!ok)
+		goto check;
+
+	if (structure != OFONO_SIM_FILE_STRUCTURE_FIXED)
+		return;
+
+	if (record_length < 14 || length < record_length)
+		return;
+
+	total = length / record_length;
+
+	if (sim_adn_parse(data, record_length, &ph, &alpha) == TRUE) {
+		struct service_number *sdn;
+
+		if (!alpha || alpha[0] == '\0') {
+			if (alpha)
+				g_free(alpha);
+
+			/* Use phone number if Id is unavailable */
+			alpha = g_strdup(phone_number_to_string(&ph));
+		}
+
+		if (sim->service_numbers &&
+				g_slist_find_custom(sim->service_numbers,
+					alpha, service_number_compare)) {
+			ofono_error("Duplicate EFsdn entries for `%s'\n",
+					alpha);
+			g_free(alpha);
+
+			goto check;
+		}
+
+		sdn = g_new(struct service_number, 1);
+		sdn->id = alpha;
+		memcpy(&sdn->ph, &ph, sizeof(struct ofono_phone_number));
+
+		sim->service_numbers =
+			g_slist_prepend(sim->service_numbers, sdn);
+	}
+
+	if (record != total)
+		return;
+
+check:
+	/* All records retrieved */
+	if (sim->service_numbers) {
+		sim->service_numbers = g_slist_reverse(sim->service_numbers);
+
+		service_numbers = get_service_numbers(sim->service_numbers);
+
+		ofono_dbus_signal_dict_property_changed(conn, path,
+						SIM_MANAGER_INTERFACE,
+						"ServiceDiallingNumbers",
+						DBUS_TYPE_STRING,
+						&service_numbers);
+		g_strfreev(service_numbers);
+	}
+}
+
+static void sim_own_numbers_update(struct ofono_sim *sim)
+{
+	ofono_sim_read(sim, SIM_EFMSISDN_FILEID,
+			sim_msisdn_read_cb, sim);
 }
 
 static void sim_ready(void *user)
@@ -461,7 +580,11 @@ static void sim_ready(void *user)
 	struct ofono_sim *sim = user;
 
 	sim_own_numbers_update(sim);
-	sim_mnc_length_update(sim);
+
+	ofono_sim_read(sim, SIM_EFAD_FILEID,
+			sim_ad_read_cb, sim);
+	ofono_sim_read(sim, SIM_EFSDN_FILEID,
+			sim_sdn_read_cb, sim);
 }
 
 static void sim_imsi_cb(const struct ofono_error *error, const char *imsi,
@@ -1150,6 +1273,13 @@ static void sim_remove(struct ofono_atom *atom)
 		sim->own_numbers = NULL;
 	}
 
+	if (sim->service_numbers) {
+		g_slist_foreach(sim->service_numbers,
+				(GFunc)service_number_free, NULL);
+		g_slist_free(sim->service_numbers);
+		sim->service_numbers = NULL;
+	}
+
 	if (sim->simop_source) {
 		g_source_remove(sim->simop_source);
 		sim->simop_source = 0;
diff --git a/src/simutil.h b/src/simutil.h
index dccbe7b..de3e55e 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -22,6 +22,7 @@
 enum sim_fileid {
 	SIM_EFMSISDN_FILEID = 0x6f40,
 	SIM_EFSPN_FILEID = 0x6f46,
+	SIM_EFSDN_FILEID = 0x6f49,
 	SIM_EFAD_FILEID = 0x6fad,
 	SIM_EFPNN_FILEID = 0x6fc5,
 	SIM_EFOPL_FILEID = 0x6fc6,
-- 
1.6.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Expose service dialling numbers stored on SIM through SimManager.
  2009-08-26  0:43   ` Andrzej Zaborowski
@ 2009-08-31 20:16     ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2009-08-31 20:16 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

Hi Andrew,
> Hi,
>
> 2009/8/25 Denis Kenzior <denkenz@gmail.com>:
> > Please re-base and resubmit this patch, it does not apply cleanly after
> > the latest round of changes.
> > Also, lets return a dictionary.  Applications already need to parse
> > GetProperties, which is a dictionary of strings to variants, so
> > string->string shouldn't be a big deal.

Patch has been pushed.  Thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-31 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19 20:09 Expose service dialling numbers stored on SIM through SimManager Andrzej Zaborowski
2009-08-25 16:41 ` Denis Kenzior
2009-08-26  0:43   ` Andrzej Zaborowski
2009-08-31 20:16     ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox