All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Return specific ofono errors after SS transaction
@ 2012-05-29 16:38 Philippe Nunes
  2012-05-29 16:38 ` [PATCH 1/6] common: Fix typos in error strings Philippe Nunes
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

As pointed by the first GCF tests, the user indication does not distinguish the type of error occured after an SS request.
Actually, the ofono error type .Failed is returned whatever is the telephony error.
In order to return more specific ofono error types, I introduced an utility function to map the telephony errors into ofono errors.
I extended also the ofono error types to match more closely with the telephony errors. 

Philippe Nunes (6):
  common: Fix typos in error strings
  dbus: Add new error types
  error-mapping: Add function to map telephony errors into ofono error
    types
  build: Add error-mapping utility to build
  Return specific ofono errors according telephony errors
  Extend the list of ofono error types returned by the method initiate

 Makefile.am                       |    1 +
 doc/supplementaryservices-api.txt |    6 +++
 src/call-barring.c                |   11 ++++--
 src/call-forwarding.c             |    6 ++-
 src/call-settings.c               |   18 +++++----
 src/common.c                      |   19 ++++-----
 src/dbus.c                        |   13 +++++++
 src/error-mapping.c               |   77 +++++++++++++++++++++++++++++++++++++
 src/error-mapping.h               |   25 ++++++++++++
 src/ofono.h                       |    2 +
 10 files changed, 155 insertions(+), 23 deletions(-)
 create mode 100644 src/error-mapping.c
 create mode 100644 src/error-mapping.h

-- 
1.7.9.5


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

* [PATCH 1/6] common: Fix typos in error strings
  2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
@ 2012-05-29 16:38 ` Philippe Nunes
  2012-05-30  5:22   ` Denis Kenzior
  2012-05-29 16:38 ` [PATCH 2/6] dbus: Add new error types Philippe Nunes
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

---
 src/common.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/common.c b/src/common.c
index 62f2c5d..50106ac 100644
--- a/src/common.c
+++ b/src/common.c
@@ -49,13 +49,13 @@ struct error_entry cms_errors[] = {
 	{ 10,	"Call barred" },
 	{ 21,	"Short message transfer rejected" },
 	{ 27,	"Destination out of service" },
-	{ 28,	"Unindentified subscriber" },
+	{ 28,	"Unidentified subscriber" },
 	{ 29,	"Facility rejected" },
 	{ 30,	"Unknown subscriber" },
 	{ 38,	"Network out of order" },
 	{ 41,	"Temporary failure" },
 	{ 42,	"Congestion" },
-	{ 47,	"Recources unavailable" },
+	{ 47,	"Resources unavailable" },
 	{ 50,	"Requested facility not subscribed" },
 	{ 69,	"Requested facility not implemented" },
 	{ 81,	"Invalid short message transfer reference value" },
@@ -65,8 +65,8 @@ struct error_entry cms_errors[] = {
 	{ 98,	"Message not compatible with short message protocol state" },
 	{ 99,	"Information element non-existent or not implemented" },
 	{ 111,	"Protocol error, unspecified" },
-	{ 127,	"Internetworking error, unspecified" },
-	{ 128,	"Telematic internetworking not supported" },
+	{ 127,	"Interworking error, unspecified" },
+	{ 128,	"Telematic interworking not supported" },
 	{ 129,	"Short message type 0 not supported" },
 	{ 130,	"Cannot replace short message" },
 	{ 143,	"Unspecified TP-PID error" },
@@ -89,7 +89,7 @@ struct error_entry cms_errors[] = {
 	{ 209,	"No SMS Storage capability in SIM" },
 	{ 210,	"Error in MS" },
 	{ 211,	"Memory capacity exceeded" },
-	{ 212,	"Sim application toolkit busy" },
+	{ 212,	"SIM application toolkit busy" },
 	{ 213,	"SIM data download error" },
 	{ 255,	"Unspecified error cause" },
 	{ 300,	"ME Failure" },
@@ -121,7 +121,7 @@ struct error_entry cms_errors[] = {
 struct error_entry cme_errors[] = {
 	{ 0,	"Phone failure" },
 	{ 1,	"No connection to phone" },
-	{ 2,	"Phone adapter link reserved" },
+	{ 2,	"Phone adaptor link reserved" },
 	{ 3,	"Operation not allowed" },
 	{ 4,	"Operation not supported" },
 	{ 5,	"PH_SIM PIN required" },
@@ -156,6 +156,7 @@ struct error_entry cme_errors[] = {
 	{ 46,	"Corporate personalization PIN required" },
 	{ 47,	"Corporate personalization PUK required" },
 	{ 48,	"PH-SIM PUK required" },
+	{ 50,	"Incorrect parameters" },
 	{ 100,	"Unknown error" },
 	{ 103,	"Illegal MS" },
 	{ 106,	"Illegal ME" },
@@ -204,14 +205,14 @@ struct error_entry ceer_errors[] = {
 	{ 38,	"Network out of order" },
 	{ 41,	"Temporary failure" },
 	{ 42,	"Switching equipment congestion" },
-	{ 43,	"Access information discared" },
+	{ 43,	"Access information discarded" },
 	{ 44,	"Requested circuit/channel not available" },
 	{ 47,	"Resource unavailable (unspecified)" },
 	{ 49,	"Quality of service unavailable" },
 	{ 50,	"Requested facility not subscribed" },
 	{ 55,	"Incoming calls barred within the CUG" },
 	{ 57,	"Bearer capability not authorized" },
-	{ 58,	"Bearar capability not presently available" },
+	{ 58,	"Bearer capability not presently available" },
 	{ 63,	"Service or option not available, unspecified" },
 	{ 65,	"Bearer service not implemented" },
 	{ 68,	"ACM equal to or greater than ACMmax" },
@@ -229,7 +230,7 @@ struct error_entry ceer_errors[] = {
 	{ 99,	"Information element non-existent or not implemented" },
 	{ 100,	"Conditional IE error" },
 	{ 101,	"Message not compatible with protocol state" },
-	{ 102,	"Recovery on timer expirty" },
+	{ 102,	"Recovery on timer expiry" },
 	{ 111,	"Protocol error, unspecified" },
 	{ 127,	"Interworking, unspecified" },
 };
-- 
1.7.9.5


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

* [PATCH 2/6] dbus: Add new error types
  2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
  2012-05-29 16:38 ` [PATCH 1/6] common: Fix typos in error strings Philippe Nunes
@ 2012-05-29 16:38 ` Philippe Nunes
  2012-05-30  5:23   ` Denis Kenzior
  2012-05-29 16:38 ` [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono " Philippe Nunes
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

---
 src/dbus.c  |   13 +++++++++++++
 src/ofono.h |    2 ++
 2 files changed, 15 insertions(+)

diff --git a/src/dbus.c b/src/dbus.c
index 52e3a68..5cccc32 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -375,6 +375,19 @@ DBusMessage *__ofono_error_emergency_active(DBusMessage *msg)
 				"Emergency mode active");
 }
 
+DBusMessage *__ofono_error_incorrect_password(DBusMessage *msg)
+{
+	return g_dbus_create_error(msg,
+				OFONO_ERROR_INTERFACE ".IncorrectPassword",
+				"Password is incorrect");
+}
+
+DBusMessage *__ofono_error_not_allowed(DBusMessage *msg)
+{
+	return g_dbus_create_error(msg, OFONO_ERROR_INTERFACE ".NotAllowed",
+					"Operation is not allowed");
+}
+
 void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply)
 {
 	DBusConnection *conn = ofono_dbus_get_connection();
diff --git a/src/ofono.h b/src/ofono.h
index a6f1af1..81d5f71 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -63,6 +63,8 @@ DBusMessage *__ofono_error_not_registered(DBusMessage *msg);
 DBusMessage *__ofono_error_canceled(DBusMessage *msg);
 DBusMessage *__ofono_error_access_denied(DBusMessage *msg);
 DBusMessage *__ofono_error_emergency_active(DBusMessage *msg);
+DBusMessage *__ofono_error_incorrect_password(DBusMessage *msg);
+DBusMessage *__ofono_error_not_allowed(DBusMessage *msg);
 
 void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply);
 
-- 
1.7.9.5


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

* [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono error types
  2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
  2012-05-29 16:38 ` [PATCH 1/6] common: Fix typos in error strings Philippe Nunes
  2012-05-29 16:38 ` [PATCH 2/6] dbus: Add new error types Philippe Nunes
@ 2012-05-29 16:38 ` Philippe Nunes
  2012-05-30  5:42   ` Denis Kenzior
  2012-05-29 16:38 ` [PATCH 4/6] build: Add error-mapping utility to build Philippe Nunes
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

---
 src/error-mapping.c |   77 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/error-mapping.h |   25 +++++++++++++++++
 2 files changed, 102 insertions(+)
 create mode 100644 src/error-mapping.c
 create mode 100644 src/error-mapping.h

diff --git a/src/error-mapping.c b/src/error-mapping.c
new file mode 100644
index 0000000..2012881
--- /dev/null
+++ b/src/error-mapping.c
@@ -0,0 +1,77 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <errno.h>
+
+#include <glib.h>
+
+#include <ofono/types.h>
+#include <gdbus.h>
+#include "ofono.h"
+#include "error-mapping.h"
+
+struct error_mapping_entry {
+	int error;
+	DBusMessage *(*ofono_error_func)(DBusMessage *);
+};
+
+struct error_mapping_entry cme_errors_mapping[] = {
+	{ 3,	__ofono_error_not_allowed },
+	{ 4,	__ofono_error_not_supported },
+	{ 16,	__ofono_error_incorrect_password },
+	{ 30,	__ofono_error_not_registered },
+	{ 31,	__ofono_error_timed_out },
+	{ 32,	__ofono_error_access_denied },
+	{ 50,	__ofono_error_invalid_args },
+};
+
+DBusMessage *telephony_error_to_ofono_err(const struct ofono_error *error,
+						DBusMessage *msg)
+{
+	struct error_mapping_entry *e;
+	int maxentries;
+	int i;
+
+	switch (error->type) {
+	case OFONO_ERROR_TYPE_CME:
+		e = cme_errors_mapping;
+		maxentries = sizeof(cme_errors_mapping) /
+					sizeof(struct error_mapping_entry);
+		for (i = 0; i < maxentries; i++)
+			if (e[i].error == error->error)
+				return e[i].ofono_error_func(msg);
+		break;
+	case OFONO_ERROR_TYPE_CMS:
+		return __ofono_error_failed(msg);
+	case OFONO_ERROR_TYPE_CEER:
+		return __ofono_error_failed(msg);
+	default:
+		return __ofono_error_failed(msg);
+	}
+
+	return __ofono_error_failed(msg);
+}
diff --git a/src/error-mapping.h b/src/error-mapping.h
new file mode 100644
index 0000000..9909f9b
--- /dev/null
+++ b/src/error-mapping.h
@@ -0,0 +1,25 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <gdbus.h>
+
+DBusMessage *telephony_error_to_ofono_err(const struct ofono_error *error,
+						DBusMessage *msg);
\ No newline at end of file
-- 
1.7.9.5


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

* [PATCH 4/6] build: Add error-mapping utility to build
  2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
                   ` (2 preceding siblings ...)
  2012-05-29 16:38 ` [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono " Philippe Nunes
@ 2012-05-29 16:38 ` Philippe Nunes
  2012-05-29 16:38 ` [PATCH 5/6] Return specific ofono errors according telephony errors Philippe Nunes
  2012-05-29 16:38 ` [PATCH 6/6] Extend the list of ofono error types returned by the method initiate Philippe Nunes
  5 siblings, 0 replies; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

---
 Makefile.am |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile.am b/Makefile.am
index 19844d9..e1051a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -445,6 +445,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) src/ofono.ver \
 			src/modem.c src/common.h src/common.c \
 			src/manager.c src/dbus.c src/util.h src/util.c \
 			src/network.c src/voicecall.c src/ussd.c src/sms.c \
+			src/error-mapping.h src/error-mapping.c \
 			src/call-settings.c src/call-forwarding.c \
 			src/call-meter.c src/smsutil.h src/smsutil.c \
 			src/call-barring.c src/sim.c src/stk.c \
-- 
1.7.9.5


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

* [PATCH 5/6] Return specific ofono errors according telephony errors
  2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
                   ` (3 preceding siblings ...)
  2012-05-29 16:38 ` [PATCH 4/6] build: Add error-mapping utility to build Philippe Nunes
@ 2012-05-29 16:38 ` Philippe Nunes
  2012-05-29 16:38 ` [PATCH 6/6] Extend the list of ofono error types returned by the method initiate Philippe Nunes
  5 siblings, 0 replies; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

---
 src/call-barring.c    |   11 +++++++----
 src/call-forwarding.c |    6 ++++--
 src/call-settings.c   |   18 ++++++++++--------
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/call-barring.c b/src/call-barring.c
index ddf4c73..c983d90 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -35,6 +35,7 @@
 #include "ofono.h"
 
 #include "common.h"
+#include "error-mapping.h"
 
 #define CALL_BARRING_FLAG_CACHED 0x1
 #define NUM_OF_BARRINGS 5
@@ -323,9 +324,10 @@ static void cb_ss_set_lock_callback(const struct ofono_error *error,
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Enabling/disabling Call Barring via SS failed");
+		DBG("Enabling/disabling Call Barring via SS failed with err:%s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cb->pending,
-					__ofono_error_failed(cb->pending));
+			telephony_error_to_ofono_err(error, cb->pending));
 		return;
 	}
 
@@ -485,8 +487,9 @@ static void cb_set_passwd_callback(const struct ofono_error *error, void *data)
 	if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
 		reply = dbus_message_new_method_return(cb->pending);
 	else {
-		reply = __ofono_error_failed(cb->pending);
-		DBG("Changing Call Barring password via SS failed");
+		DBG("Changing Call Barring password via SS failed with err: %s",
+				telephony_error_to_str(error));
+		reply = telephony_error_to_ofono_err(error, cb->pending);
 	}
 
 	__ofono_dbus_pending_reply(&cb->pending, reply);
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 3d9c5c1..7525479 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -35,6 +35,7 @@
 
 #include "common.h"
 #include "simutil.h"
+#include "error-mapping.h"
 
 #define CALL_FORWARDING_FLAG_CACHED	0x1
 #define CALL_FORWARDING_FLAG_CPHS_CFF	0x2
@@ -1020,10 +1021,11 @@ static void cf_ss_control_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during cf ss control set/erasure");
 
+		DBG("CF ss control set/erasure failed with error: %s",
+						telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cf->pending,
-					__ofono_error_failed(cf->pending));
+		telephony_error_to_ofono_err(error, cf->pending));
 		g_free(cf->ss_req);
 		cf->ss_req = NULL;
 		return;
diff --git a/src/call-settings.c b/src/call-settings.c
index 6bc9658..e13e3de 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -34,6 +34,7 @@
 #include "ofono.h"
 
 #include "common.h"
+#include "error-mapping.h"
 
 #define CALL_SETTINGS_FLAG_CACHED 0x1
 
@@ -477,9 +478,10 @@ static void cw_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting CW via SS failed");
+		DBG("setting CW via SS failed with error: %s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cs->pending,
-					__ofono_error_failed(cs->pending));
+			telephony_error_to_ofono_err(error, cs->pending));
 
 		return;
 	}
@@ -614,10 +616,10 @@ static void clip_cnap_colp_colr_ss_query_cb(const struct ofono_error *error,
 	const char *value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during ss control query");
+		DBG("SS control query failed with error: %s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cs->pending,
-					__ofono_error_failed(cs->pending));
-
+			telephony_error_to_ofono_err(error, cs->pending));
 		return;
 	}
 
@@ -772,10 +774,10 @@ static void clir_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir via SS failed");
+		DBG("setting clir via SS failed with error: %s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cs->pending,
-					__ofono_error_failed(cs->pending));
-
+			telephony_error_to_ofono_err(error, cs->pending));
 		return;
 	}
 
-- 
1.7.9.5


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

* [PATCH 6/6] Extend the list of ofono error types returned by the method initiate
  2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
                   ` (4 preceding siblings ...)
  2012-05-29 16:38 ` [PATCH 5/6] Return specific ofono errors according telephony errors Philippe Nunes
@ 2012-05-29 16:38 ` Philippe Nunes
  2012-05-30  5:45   ` Denis Kenzior
  5 siblings, 1 reply; 11+ messages in thread
From: Philippe Nunes @ 2012-05-29 16:38 UTC (permalink / raw)
  To: ofono

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

---
 doc/supplementaryservices-api.txt |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/supplementaryservices-api.txt b/doc/supplementaryservices-api.txt
index e855ead..687a14e 100644
--- a/doc/supplementaryservices-api.txt
+++ b/doc/supplementaryservices-api.txt
@@ -27,6 +27,12 @@ Methods		string, variant Initiate(string command)
 					 [service].Error.NotImplemented
 					 [service].Error.InvalidArguments
 					 [service].Error.InvalidFormat
+					 [service].Error.NotSupported
+					 [service].Error.NotAllowed
+					 [service].Error.IncorrectPassword
+					 [service].Error.NotRegistered
+					 [service].Error.Timedout
+					 [service].Error.AccessDenied
 					 [service].Error.Failed
 
 		string Respond(string reply)
-- 
1.7.9.5


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

* Re: [PATCH 1/6] common: Fix typos in error strings
  2012-05-29 16:38 ` [PATCH 1/6] common: Fix typos in error strings Philippe Nunes
@ 2012-05-30  5:22   ` Denis Kenzior
  0 siblings, 0 replies; 11+ messages in thread
From: Denis Kenzior @ 2012-05-30  5:22 UTC (permalink / raw)
  To: ofono

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

Hi Philippe,

On 05/29/2012 11:38 AM, Philippe Nunes wrote:
> ---
>   src/common.c |   19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
>

Patch has been applied, thanks.

Regards,
-Denis


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

* Re: [PATCH 2/6] dbus: Add new error types
  2012-05-29 16:38 ` [PATCH 2/6] dbus: Add new error types Philippe Nunes
@ 2012-05-30  5:23   ` Denis Kenzior
  0 siblings, 0 replies; 11+ messages in thread
From: Denis Kenzior @ 2012-05-30  5:23 UTC (permalink / raw)
  To: ofono

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

Hi Philippe,

On 05/29/2012 11:38 AM, Philippe Nunes wrote:
> ---
>   src/dbus.c  |   13 +++++++++++++
>   src/ofono.h |    2 ++
>   2 files changed, 15 insertions(+)
>

Patch has been applied, thanks.

Regards,
-Denis


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

* Re: [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono error types
  2012-05-29 16:38 ` [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono " Philippe Nunes
@ 2012-05-30  5:42   ` Denis Kenzior
  0 siblings, 0 replies; 11+ messages in thread
From: Denis Kenzior @ 2012-05-30  5:42 UTC (permalink / raw)
  To: ofono

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

Hi Philippe,

On 05/29/2012 11:38 AM, Philippe Nunes wrote:
> ---
>   src/error-mapping.c |   77 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   src/error-mapping.h |   25 +++++++++++++++++
>   2 files changed, 102 insertions(+)
>   create mode 100644 src/error-mapping.c
>   create mode 100644 src/error-mapping.h
>
> diff --git a/src/error-mapping.c b/src/error-mapping.c
> new file mode 100644
> index 0000000..2012881
> --- /dev/null
> +++ b/src/error-mapping.c
> @@ -0,0 +1,77 @@
> +/*
> + *
> + *  oFono - Open Source Telephony
> + *
> + *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#ifdef HAVE_CONFIG_H
> +#include<config.h>
> +#endif
> +
> +#define _GNU_SOURCE
> +#include<string.h>
> +#include<errno.h>
> +
> +#include<glib.h>
> +
> +#include<ofono/types.h>
> +#include<gdbus.h>

Is gdbus really necessary?  If it is, then it should be above ofono/types

> +#include "ofono.h"
> +#include "error-mapping.h"
> +
> +struct error_mapping_entry {
> +	int error;
> +	DBusMessage *(*ofono_error_func)(DBusMessage *);
> +};
> +
> +struct error_mapping_entry cme_errors_mapping[] = {
> +	{ 3,	__ofono_error_not_allowed },
> +	{ 4,	__ofono_error_not_supported },
> +	{ 16,	__ofono_error_incorrect_password },
> +	{ 30,	__ofono_error_not_registered },
> +	{ 31,	__ofono_error_timed_out },
> +	{ 32,	__ofono_error_access_denied },
> +	{ 50,	__ofono_error_invalid_args },
> +};
> +
> +DBusMessage *telephony_error_to_ofono_err(const struct ofono_error *error,
> +						DBusMessage *msg)
> +{
> +	struct error_mapping_entry *e;
> +	int maxentries;
> +	int i;
> +
> +	switch (error->type) {
> +	case OFONO_ERROR_TYPE_CME:
> +		e = cme_errors_mapping;
> +		maxentries = sizeof(cme_errors_mapping) /
> +					sizeof(struct error_mapping_entry);
> +		for (i = 0; i<  maxentries; i++)
> +			if (e[i].error == error->error)
> +				return e[i].ofono_error_func(msg);
> +		break;
> +	case OFONO_ERROR_TYPE_CMS:
> +		return __ofono_error_failed(msg);
> +	case OFONO_ERROR_TYPE_CEER:
> +		return __ofono_error_failed(msg);
> +	default:
> +		return __ofono_error_failed(msg);
> +	}
> +
> +	return __ofono_error_failed(msg);
> +}

Please move this to dbus.c, it isn't worth creating a brand new file for 
this.

> diff --git a/src/error-mapping.h b/src/error-mapping.h
> new file mode 100644
> index 0000000..9909f9b
> --- /dev/null
> +++ b/src/error-mapping.h
> @@ -0,0 +1,25 @@
> +/*
> + *
> + *  oFono - Open Source Telephony
> + *
> + *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> + *
> + */
> +
> +#include<gdbus.h>
> +
> +DBusMessage *telephony_error_to_ofono_err(const struct ofono_error *error,
> +						DBusMessage *msg);

I don't like the name of this function, it should be prefixed with 
__ofono_error to be in line with the rest of the __ofono_error family. 
Lets go with __ofono_error_from_error.  Syntactically it does appear 
rather unfortunate, but I can't think of anything better right now.

Declare it inside ofono.h as well, there's no need for a header file...

> \ No newline at end of file

Regards,
-Denis

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

* Re: [PATCH 6/6] Extend the list of ofono error types returned by the method initiate
  2012-05-29 16:38 ` [PATCH 6/6] Extend the list of ofono error types returned by the method initiate Philippe Nunes
@ 2012-05-30  5:45   ` Denis Kenzior
  0 siblings, 0 replies; 11+ messages in thread
From: Denis Kenzior @ 2012-05-30  5:45 UTC (permalink / raw)
  To: ofono

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

Hi Philippe,

On 05/29/2012 11:38 AM, Philippe Nunes wrote:
> ---
>   doc/supplementaryservices-api.txt |    6 ++++++
>   1 file changed, 6 insertions(+)
>

Patch has been applied with a slightly reworded commit message so it 
would be in-line with our coding style guidlines (see item M5).

Regards,
-Denis

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

end of thread, other threads:[~2012-05-30  5:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
2012-05-29 16:38 ` [PATCH 1/6] common: Fix typos in error strings Philippe Nunes
2012-05-30  5:22   ` Denis Kenzior
2012-05-29 16:38 ` [PATCH 2/6] dbus: Add new error types Philippe Nunes
2012-05-30  5:23   ` Denis Kenzior
2012-05-29 16:38 ` [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono " Philippe Nunes
2012-05-30  5:42   ` Denis Kenzior
2012-05-29 16:38 ` [PATCH 4/6] build: Add error-mapping utility to build Philippe Nunes
2012-05-29 16:38 ` [PATCH 5/6] Return specific ofono errors according telephony errors Philippe Nunes
2012-05-29 16:38 ` [PATCH 6/6] Extend the list of ofono error types returned by the method initiate Philippe Nunes
2012-05-30  5:45   ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.