Skip to contentSkip to conversation

dbus: Add Terminated error

PATCH In review Philippe Nunes 2 participants 4 messages Sep 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 dbus: Add Terminated error

---
 src/dbus.c  |    8 ++++++++
 src/ofono.h |    1 +
 2 files changed, 9 insertions(+)
src/dbus.c +8 -0
index 3f5c12d..1f9f9ba 100644
@@ -409,6 +409,14 @@ DBusMessage *__ofono_error_not_recognized(DBusMessage *msg)
 					"String not recognized as USSD/SS");
 }
 
+DBusMessage *__ofono_error_terminated_by_network(DBusMessage *msg)
+{
+	return g_dbus_create_error(msg, OFONO_ERROR_INTERFACE
+					".Terminated",
+					"Operation is terminated by the"
+					" network");
+}
+
 DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
 						DBusMessage *msg)
 {
src/ofono.h +1 -0
index aca81b4..e20d8fa 100644
@@ -66,6 +66,7 @@ DBusMessage *__ofono_error_emergency_active(DBusMessage *msg);
 DBusMessage *__ofono_error_incorrect_password(DBusMessage *msg);
 DBusMessage *__ofono_error_not_allowed(DBusMessage *msg);
 DBusMessage *__ofono_error_not_recognized(DBusMessage *msg);
+DBusMessage *__ofono_error_terminated_by_network(DBusMessage *msg);
 
 DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
 						DBusMessage *msg);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v4 2/2 ussd: Recover idle state after a transaction error

The "USSD terminated by network" notification is handled to recover the idle state in case of USSD transaction error.

---
 src/ussd.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
src/ussd.c +10 -0
index 74888b2..60b1f6b 100644
@@ -414,6 +414,16 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
 		return;
 	}
 
+	if (status == OFONO_USSD_STATUS_TERMINATED) {
+		ussd_change_state(ussd, USSD_STATE_IDLE);
+
+		if (ussd->pending == NULL)
+			return;
+
+		reply = __ofono_error_terminated_by_network(ussd->pending);
+		goto out;
+	}
+
 	if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
 		ussd_change_state(ussd, USSD_STATE_IDLE);
 
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH v4 2/2] ussd: Recover idle state after a transaction error

Hi Philippe,

Quoted 6 lines · Philippe Nunes

The "USSD terminated by network" notification is handled to recover the idle state in case of USSD transaction error.

---
  src/ussd.c |   10 ++++++++++
  1 file changed, 10 insertions(+)

Patch has been applied, thanks.

Regards,
-Denis

#3 lore raw
In reply to Philippe Nunes

Hi Philippe,

Quoted 5 lines · Philippe Nunes
---
  src/dbus.c  |    8 ++++++++
  src/ofono.h |    1 +
  2 files changed, 9 insertions(+)

The patch has been applied with a few changes:

src/dbus.c DBusMessage *__ofono_error_not_recognized(DBusMessage *msg) · line 412

Quoted 9 lines
src/dbus.c +1 -0
index 3f5c12d..1f9f9ba 100644
@@ -409,6 +409,14 @@ DBusMessage *__ofono_error_not_recognized(DBusMessage *msg)
  					"String not recognized as USSD/SS");
  }
 
+DBusMessage *__ofono_error_terminated_by_network(DBusMessage *msg)

I amended the patch to read '__ofono_error_network_terminated'

src/dbus.c DBusMessage *__ofono_error_not_recognized(DBusMessage *msg) · line 416

Quoted 4 lines
src/dbus.c +4 -0
+{
+	return g_dbus_create_error(msg, OFONO_ERROR_INTERFACE
+					".Terminated",
+					"Operation is terminated by the"

and changed "is" to "was"

Quoted 11 lines
src/dbus.c +3 -0
+					" network");
+}
+
  DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
  						DBusMessage *msg)
  {
src/ofono.h +0 -0
index aca81b4..e20d8fa 100644

src/ofono.h DBusMessage *__ofono_error_emergency_active(DBusMessage *msg); · line 72

Quoted 7 lines
src/ofono.h +1 -0
@@ -66,6 +66,7 @@ DBusMessage *__ofono_error_emergency_active(DBusMessage *msg);
  DBusMessage *__ofono_error_incorrect_password(DBusMessage *msg);
  DBusMessage *__ofono_error_not_allowed(DBusMessage *msg);
  DBusMessage *__ofono_error_not_recognized(DBusMessage *msg);
+DBusMessage *__ofono_error_terminated_by_network(DBusMessage *msg);
 
  DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
  						DBusMessage *msg);

Regards,
-Denis