[PATCH] test: Add timeout to be compliant with GCF
by Guillaume Zajac
With some GCF test cases, default python script timeout
is too short to pass the tests.
---
test/private-chat | 2 +-
test/swap-calls | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/private-chat b/test/private-chat
index 4938a25..e7c8026 100755
--- a/test/private-chat
+++ b/test/private-chat
@@ -14,7 +14,7 @@ path = modems[0][0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.VoiceCallManager')
-mpty = manager.PrivateChat(sys.argv[1])
+mpty = manager.PrivateChat(sys.argv[1], timeout=100)
for path in mpty:
print path
diff --git a/test/swap-calls b/test/swap-calls
index 4996e0c..eeb257b 100755
--- a/test/swap-calls
+++ b/test/swap-calls
@@ -17,4 +17,4 @@ if (len(sys.argv) == 2):
manager = dbus.Interface(bus.get_object('org.ofono', modem),
'org.ofono.VoiceCallManager')
-manager.SwapCalls()
+manager.SwapCalls(timeout=100)
--
1.7.5.4
9 years, 12 months
[PATCH 01/12] Constify GDBus method tables
by Lucas De Marchi
From: Henrique Dante de Almeida <hdante(a)profusion.mobi>
Constify method tables with the following command:
find . -name '*.[ch]' -exec \
sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
---
plugins/hfp_hf.c | 2 +-
plugins/push-notification.c | 2 +-
plugins/smart-messaging.c | 2 +-
src/audio-settings.c | 2 +-
src/call-barring.c | 2 +-
src/call-forwarding.c | 2 +-
src/call-meter.c | 2 +-
src/call-settings.c | 2 +-
src/call-volume.c | 2 +-
src/cbs.c | 2 +-
src/cdma-connman.c | 2 +-
src/cdma-netreg.c | 2 +-
src/cdma-sms.c | 2 +-
src/cdma-voicecall.c | 2 +-
src/ctm.c | 2 +-
src/gnss.c | 2 +-
src/gprs.c | 4 ++--
src/handsfree.c | 2 +-
src/location-reporting.c | 2 +-
src/manager.c | 2 +-
src/message-waiting.c | 2 +-
src/message.c | 2 +-
src/modem.c | 2 +-
src/network.c | 4 ++--
src/phonebook.c | 2 +-
src/radio-settings.c | 2 +-
src/sim.c | 2 +-
src/sms.c | 2 +-
src/stk.c | 2 +-
src/ussd.c | 2 +-
src/voicecall.c | 4 ++--
31 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c
index c11525e..19a362f 100644
--- a/plugins/hfp_hf.c
+++ b/plugins/hfp_hf.c
@@ -198,7 +198,7 @@ static DBusMessage *hfp_agent_release(DBusConnection *conn,
return dbus_message_new_method_return(msg);
}
-static GDBusMethodTable agent_methods[] = {
+static const GDBusMethodTable agent_methods[] = {
{ "NewConnection", "hq", "", hfp_agent_new_connection,
G_DBUS_METHOD_FLAG_ASYNC },
{ "Release", "", "", hfp_agent_release },
diff --git a/plugins/push-notification.c b/plugins/push-notification.c
index 1c19bf2..1b8f729 100644
--- a/plugins/push-notification.c
+++ b/plugins/push-notification.c
@@ -151,7 +151,7 @@ static DBusMessage *push_notification_unregister_agent(DBusConnection *conn,
return dbus_message_new_method_return(msg);
}
-static GDBusMethodTable push_notification_methods[] = {
+static const GDBusMethodTable push_notification_methods[] = {
{ "RegisterAgent", "o", "", push_notification_register_agent },
{ "UnregisterAgent", "o", "", push_notification_unregister_agent },
{ }
diff --git a/plugins/smart-messaging.c b/plugins/smart-messaging.c
index d6d77cf..6820b20 100644
--- a/plugins/smart-messaging.c
+++ b/plugins/smart-messaging.c
@@ -268,7 +268,7 @@ static DBusMessage *smart_messaging_send_vcal(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable smart_messaging_methods[] = {
+static const GDBusMethodTable smart_messaging_methods[] = {
{ "RegisterAgent", "o", "", smart_messaging_register_agent },
{ "UnregisterAgent", "o", "", smart_messaging_unregister_agent },
{ "SendBusinessCard", "say", "o", smart_messaging_send_vcard,
diff --git a/src/audio-settings.c b/src/audio-settings.c
index 77930d9..6388c3e 100644
--- a/src/audio-settings.c
+++ b/src/audio-settings.c
@@ -117,7 +117,7 @@ static DBusMessage *audio_get_properties(DBusConnection *conn,
return audio_get_properties_reply(msg, as);
}
-static GDBusMethodTable audio_methods[] = {
+static const GDBusMethodTable audio_methods[] = {
{ "GetProperties", "", "a{sv}", audio_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ }
diff --git a/src/call-barring.c b/src/call-barring.c
index afb3fce..952e4c2 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -966,7 +966,7 @@ static DBusMessage *cb_set_passwd(DBusConnection *conn, DBusMessage *msg,
return NULL;
}
-static GDBusMethodTable cb_methods[] = {
+static const GDBusMethodTable cb_methods[] = {
{ "GetProperties", "", "a{sv}", cb_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "svs", "", cb_set_property,
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index c025942..c70d140 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -881,7 +881,7 @@ static DBusMessage *cf_disable_all(DBusConnection *conn, DBusMessage *msg,
return NULL;
}
-static GDBusMethodTable cf_methods[] = {
+static const GDBusMethodTable cf_methods[] = {
{ "GetProperties", "", "a{sv}", cf_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "sv", "", cf_set_property,
diff --git a/src/call-meter.c b/src/call-meter.c
index c3ae6f7..fd5edc2 100644
--- a/src/call-meter.c
+++ b/src/call-meter.c
@@ -646,7 +646,7 @@ static DBusMessage *cm_acm_reset(DBusConnection *conn, DBusMessage *msg,
return NULL;
}
-static GDBusMethodTable cm_methods[] = {
+static const GDBusMethodTable cm_methods[] = {
{ "GetProperties", "", "a{sv}", cm_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "svs", "", cm_set_property,
diff --git a/src/call-settings.c b/src/call-settings.c
index 94e606c..9d4ff7b 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -1330,7 +1330,7 @@ static DBusMessage *cs_set_property(DBusConnection *conn, DBusMessage *msg,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable cs_methods[] = {
+static const GDBusMethodTable cs_methods[] = {
{ "GetProperties", "", "a{sv}", cs_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "sv", "", cs_set_property,
diff --git a/src/call-volume.c b/src/call-volume.c
index a1c0392..81b7564 100644
--- a/src/call-volume.c
+++ b/src/call-volume.c
@@ -301,7 +301,7 @@ static DBusMessage *cv_set_property(DBusConnection *conn, DBusMessage *msg,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable cv_methods[] = {
+static const GDBusMethodTable cv_methods[] = {
{ "GetProperties", "", "a{sv}", cv_get_properties },
{ "SetProperty", "sv", "", cv_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/cbs.c b/src/cbs.c
index d898823..1c20cc6 100644
--- a/src/cbs.c
+++ b/src/cbs.c
@@ -540,7 +540,7 @@ static DBusMessage *cbs_set_property(DBusConnection *conn, DBusMessage *msg,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable cbs_methods[] = {
+static const GDBusMethodTable cbs_methods[] = {
{ "GetProperties", "", "a{sv}", cbs_get_properties },
{ "SetProperty", "sv", "", cbs_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/cdma-connman.c b/src/cdma-connman.c
index 0c8b061..90652e7 100644
--- a/src/cdma-connman.c
+++ b/src/cdma-connman.c
@@ -517,7 +517,7 @@ static DBusMessage *cdma_connman_set_property(DBusConnection *conn,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable cdma_connman_methods[] = {
+static const GDBusMethodTable cdma_connman_methods[] = {
{ "GetProperties", "", "a{sv}",
cdma_connman_get_properties },
{ "SetProperty", "sv", "", cdma_connman_set_property,
diff --git a/src/cdma-netreg.c b/src/cdma-netreg.c
index 1a88d33..e6074a8 100644
--- a/src/cdma-netreg.c
+++ b/src/cdma-netreg.c
@@ -107,7 +107,7 @@ static DBusMessage *network_get_properties(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable cdma_netreg_manager_methods[] = {
+static const GDBusMethodTable cdma_netreg_manager_methods[] = {
{ "GetProperties", "", "a{sv}", network_get_properties },
{ }
};
diff --git a/src/cdma-sms.c b/src/cdma-sms.c
index 12ea57e..a368124 100644
--- a/src/cdma-sms.c
+++ b/src/cdma-sms.c
@@ -43,7 +43,7 @@ struct ofono_cdma_sms {
struct ofono_atom *atom;
};
-static GDBusMethodTable cdma_sms_manager_methods[] = {
+static const GDBusMethodTable cdma_sms_manager_methods[] = {
/* TODO */
{ }
};
diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c
index f7e3b67..3d0c55e 100644
--- a/src/cdma-voicecall.c
+++ b/src/cdma-voicecall.c
@@ -405,7 +405,7 @@ static DBusMessage *voicecall_manager_tone(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
{ "GetProperties", "", "a{sv}",
voicecall_manager_get_properties },
{ "Dial", "s", "o", voicecall_manager_dial,
diff --git a/src/ctm.c b/src/ctm.c
index 9cece8a..2ff1cca 100644
--- a/src/ctm.c
+++ b/src/ctm.c
@@ -202,7 +202,7 @@ static DBusMessage *ctm_set_property(DBusConnection *conn, DBusMessage *msg,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable ctm_methods[] = {
+static const GDBusMethodTable ctm_methods[] = {
{ "GetProperties", "", "a{sv}", ctm_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "sv", "", ctm_set_property,
diff --git a/src/gnss.c b/src/gnss.c
index f4c3311..f622ed1 100644
--- a/src/gnss.c
+++ b/src/gnss.c
@@ -232,7 +232,7 @@ static DBusMessage *gnss_send_element(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable gnss_methods[] = {
+static const GDBusMethodTable gnss_methods[] = {
{ "SendPositioningElement", "s", "",
gnss_send_element, G_DBUS_METHOD_FLAG_ASYNC },
{ "RegisterPositioningRequestAgent", "o", "",
diff --git a/src/gprs.c b/src/gprs.c
index 0d25506..887422a 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1282,7 +1282,7 @@ static DBusMessage *pri_set_property(DBusConnection *conn,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable context_methods[] = {
+static const GDBusMethodTable context_methods[] = {
{ "GetProperties", "", "a{sv}", pri_get_properties },
{ "SetProperty", "sv", "", pri_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
@@ -2062,7 +2062,7 @@ static DBusMessage *gprs_get_contexts(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
{ "GetProperties", "", "a{sv}", gprs_get_properties },
{ "SetProperty", "sv", "", gprs_set_property },
{ "AddContext", "s", "o", gprs_add_context,
diff --git a/src/handsfree.c b/src/handsfree.c
index 66daaf1..2566dd8 100644
--- a/src/handsfree.c
+++ b/src/handsfree.c
@@ -270,7 +270,7 @@ static DBusMessage *handsfree_request_phone_number(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable handsfree_methods[] = {
+static const GDBusMethodTable handsfree_methods[] = {
{ "GetProperties", "", "a{sv}", handsfree_get_properties },
{ "SetProperty", "sv", "", handsfree_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/location-reporting.c b/src/location-reporting.c
index 40aae66..d279814 100644
--- a/src/location-reporting.c
+++ b/src/location-reporting.c
@@ -239,7 +239,7 @@ static DBusMessage *location_reporting_release(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable location_reporting_methods[] = {
+static const GDBusMethodTable location_reporting_methods[] = {
{ "GetProperties", "", "a{sv}", location_reporting_get_properties },
{ "Request", "", "h", location_reporting_request,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/manager.c b/src/manager.c
index 9614527..783ea76 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -80,7 +80,7 @@ static DBusMessage *manager_get_modems(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
{ "GetModems", "", "a(oa{sv})", manager_get_modems },
{ }
};
diff --git a/src/message-waiting.c b/src/message-waiting.c
index 328e193..7bd2576 100644
--- a/src/message-waiting.c
+++ b/src/message-waiting.c
@@ -368,7 +368,7 @@ static DBusMessage *mw_set_property(DBusConnection *conn, DBusMessage *msg,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable message_waiting_methods[] = {
+static const GDBusMethodTable message_waiting_methods[] = {
{ "GetProperties", "", "a{sv}", mw_get_properties },
{ "SetProperty", "sv", "", mw_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/message.c b/src/message.c
index 7cc6538..e0e7280 100644
--- a/src/message.c
+++ b/src/message.c
@@ -103,7 +103,7 @@ static DBusMessage *message_cancel(DBusConnection *conn,
}
}
-static GDBusMethodTable message_methods[] = {
+static const GDBusMethodTable message_methods[] = {
{ "GetProperties", "", "a{sv}", message_get_properties },
{ "Cancel", "", "", message_cancel },
{ }
diff --git a/src/modem.c b/src/modem.c
index 43d7e9e..f9fd37a 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -1123,7 +1123,7 @@ static DBusMessage *modem_set_property(DBusConnection *conn,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable modem_methods[] = {
+static const GDBusMethodTable modem_methods[] = {
{ "GetProperties", "", "a{sv}", modem_get_properties },
{ "SetProperty", "sv", "", modem_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/network.c b/src/network.c
index b8a8cfe..68749ba 100644
--- a/src/network.c
+++ b/src/network.c
@@ -623,7 +623,7 @@ static DBusMessage *network_operator_register(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable network_operator_methods[] = {
+static const GDBusMethodTable network_operator_methods[] = {
{ "GetProperties", "", "a{sv}", network_operator_get_properties },
{ "Register", "", "", network_operator_register,
G_DBUS_METHOD_FLAG_ASYNC },
@@ -1020,7 +1020,7 @@ static DBusMessage *network_get_operators(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable network_registration_methods[] = {
+static const GDBusMethodTable network_registration_methods[] = {
{ "GetProperties", "", "a{sv}", network_get_properties },
{ "Register", "", "", network_register,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/phonebook.c b/src/phonebook.c
index 6baf7bb..3563cee 100644
--- a/src/phonebook.c
+++ b/src/phonebook.c
@@ -479,7 +479,7 @@ static DBusMessage *import_entries(DBusConnection *conn, DBusMessage *msg,
return NULL;
}
-static GDBusMethodTable phonebook_methods[] = {
+static const GDBusMethodTable phonebook_methods[] = {
{ "Import", "", "s", import_entries,
G_DBUS_METHOD_FLAG_ASYNC },
{ }
diff --git a/src/radio-settings.c b/src/radio-settings.c
index a8637bb..132fd4a 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -601,7 +601,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
return __ofono_error_invalid_args(msg);
}
-static GDBusMethodTable radio_methods[] = {
+static const GDBusMethodTable radio_methods[] = {
{ "GetProperties", "", "a{sv}", radio_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "sv", "", radio_set_property,
diff --git a/src/sim.c b/src/sim.c
index eb25e07..b979ddd 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1067,7 +1067,7 @@ static DBusMessage *sim_reset_pin(DBusConnection *conn, DBusMessage *msg,
return NULL;
}
-static GDBusMethodTable sim_methods[] = {
+static const GDBusMethodTable sim_methods[] = {
{ "GetProperties", "", "a{sv}", sim_get_properties },
{ "SetProperty", "sv", "", sim_set_property,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/sms.c b/src/sms.c
index 26dbd89..1f64be9 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -1103,7 +1103,7 @@ int __ofono_sms_txq_cancel(struct ofono_sms *sms, const struct ofono_uuid *uuid)
return 0;
}
-static GDBusMethodTable sms_manager_methods[] = {
+static const GDBusMethodTable sms_manager_methods[] = {
{ "GetProperties", "", "a{sv}", sms_get_properties,
G_DBUS_METHOD_FLAG_ASYNC },
{ "SetProperty", "sv", "", sms_set_property,
diff --git a/src/stk.c b/src/stk.c
index e557e90..61b29bb 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -817,7 +817,7 @@ static DBusMessage *stk_select_item(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable stk_methods[] = {
+static const GDBusMethodTable stk_methods[] = {
{ "GetProperties", "", "a{sv}",stk_get_properties },
{ "SelectItem", "yo", "", stk_select_item,
G_DBUS_METHOD_FLAG_ASYNC },
diff --git a/src/ussd.c b/src/ussd.c
index d2d3621..25ef61f 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -728,7 +728,7 @@ static DBusMessage *ussd_get_properties(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable ussd_methods[] = {
+static const GDBusMethodTable ussd_methods[] = {
{ "Initiate", "s", "sv", ussd_initiate,
G_DBUS_METHOD_FLAG_ASYNC },
{ "Respond", "s", "s", ussd_respond,
diff --git a/src/voicecall.c b/src/voicecall.c
index 104b600..73b84b9 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -667,7 +667,7 @@ static DBusMessage *voicecall_answer(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable voicecall_methods[] = {
+static const GDBusMethodTable voicecall_methods[] = {
{ "GetProperties", "", "a{sv}", voicecall_get_properties },
{ "Deflect", "s", "", voicecall_deflect,
G_DBUS_METHOD_FLAG_ASYNC },
@@ -2117,7 +2117,7 @@ static DBusMessage *manager_get_calls(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
{ "GetProperties", "", "a{sv}", manager_get_properties },
{ "Dial", "ss", "o", manager_dial,
G_DBUS_METHOD_FLAG_ASYNC },
--
1.7.10.2
10 years
[PATCH mmsd 01/12] Constify GDBus tables
by Lucas De Marchi
Constify method tables with the following commands:
find . -name '*.[ch]' -exec sed -i \
's/\(c\)\(GDBusSignalTable .* =\)/\1 const \2/g' {} \;
find . -name '*.[ch]' -exec sed -i \
's/\(c\)\(GDBusMethodTable .* =\)/\1 const \2/g' {} \;
---
plugins/ofono.c | 2 +-
src/service.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index f598c5e..29e8f06 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -114,7 +114,7 @@ static DBusMessage *agent_release(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable agent_methods[] = {
+static const GDBusMethodTable agent_methods[] = {
{ "ReceiveNotification", "aya{sv}", "", agent_receive },
{ "Release", "", "", agent_release,
G_DBUS_METHOD_FLAG_NOREPLY },
diff --git a/src/service.c b/src/service.c
index 6bcdede..a269556 100644
--- a/src/service.c
+++ b/src/service.c
@@ -222,13 +222,13 @@ static DBusMessage *msg_mark_read(DBusConnection *conn,
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
-static GDBusMethodTable message_methods[] = {
+static const GDBusMethodTable message_methods[] = {
{ "MarkRead", "", "", msg_mark_read },
{ "Delete", "", "", msg_delete },
{ }
};
-static GDBusSignalTable message_signals[] = {
+static const GDBusSignalTable message_signals[] = {
{ "PropertyChanged", "sv" },
{ }
};
@@ -979,14 +979,14 @@ release_msg:
return __mms_error_trans_failure(dbus_msg);
}
-static GDBusMethodTable service_methods[] = {
+static const GDBusMethodTable service_methods[] = {
{ "SendMessage", "assa(sss)", "o", send_message },
{ "GetMessages", "", "a(oa{sv})", get_messages },
{ "GetConversation", "su", "a(oa{sv})", get_conversation },
{ }
};
-static GDBusSignalTable service_signals[] = {
+static const GDBusSignalTable service_signals[] = {
{ "MessageAdded", "oa{sv}" },
{ "MessageRemoved", "o" },
{ }
@@ -2342,12 +2342,12 @@ static DBusMessage *get_services(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
{ "GetServices", "", "a(oa{sv})", get_services },
{ }
};
-static GDBusSignalTable manager_signals[] = {
+static const GDBusSignalTable manager_signals[] = {
{ "ServiceAdded", "oa{sv}" },
{ "ServiceRemoved", "o" },
{ }
--
1.7.10.2
10 years
[PATCH mmsd 01/12] Constify GDBus tables
by Lucas De Marchi
Constify method tables with the following commands:
find . -name '*.[ch]' -exec sed -i \
's/\(c\)\(GDBusSignalTable .* =\)/\1 const \2/g' {} \;
find . -name '*.[ch]' -exec sed -i \
's/\(c\)\(GDBusMethodTable .* =\)/\1 const \2/g' {} \;
---
plugins/ofono.c | 2 +-
src/service.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index f598c5e..29e8f06 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -114,7 +114,7 @@ static DBusMessage *agent_release(DBusConnection *conn,
return NULL;
}
-static GDBusMethodTable agent_methods[] = {
+static const GDBusMethodTable agent_methods[] = {
{ "ReceiveNotification", "aya{sv}", "", agent_receive },
{ "Release", "", "", agent_release,
G_DBUS_METHOD_FLAG_NOREPLY },
diff --git a/src/service.c b/src/service.c
index 6bcdede..a269556 100644
--- a/src/service.c
+++ b/src/service.c
@@ -222,13 +222,13 @@ static DBusMessage *msg_mark_read(DBusConnection *conn,
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
-static GDBusMethodTable message_methods[] = {
+static const GDBusMethodTable message_methods[] = {
{ "MarkRead", "", "", msg_mark_read },
{ "Delete", "", "", msg_delete },
{ }
};
-static GDBusSignalTable message_signals[] = {
+static const GDBusSignalTable message_signals[] = {
{ "PropertyChanged", "sv" },
{ }
};
@@ -979,14 +979,14 @@ release_msg:
return __mms_error_trans_failure(dbus_msg);
}
-static GDBusMethodTable service_methods[] = {
+static const GDBusMethodTable service_methods[] = {
{ "SendMessage", "assa(sss)", "o", send_message },
{ "GetMessages", "", "a(oa{sv})", get_messages },
{ "GetConversation", "su", "a(oa{sv})", get_conversation },
{ }
};
-static GDBusSignalTable service_signals[] = {
+static const GDBusSignalTable service_signals[] = {
{ "MessageAdded", "oa{sv}" },
{ "MessageRemoved", "o" },
{ }
@@ -2342,12 +2342,12 @@ static DBusMessage *get_services(DBusConnection *conn,
return reply;
}
-static GDBusMethodTable manager_methods[] = {
+static const GDBusMethodTable manager_methods[] = {
{ "GetServices", "", "a(oa{sv})", get_services },
{ }
};
-static GDBusSignalTable manager_signals[] = {
+static const GDBusSignalTable manager_signals[] = {
{ "ServiceAdded", "oa{sv}" },
{ "ServiceRemoved", "o" },
{ }
--
1.7.10.2
10 years
[PATCH] Add WSP_VALUE_TYPE_TEXT support in wsp_decode_application_id()
by Jens Rehsack
From: Jens Rehsack <sno(a)NetBSD.org>
---
src/wsputil.c | 6 ++++++
1 Datei geändert, 6 Zeilen hinzugefügt(+)
diff --git a/src/wsputil.c b/src/wsputil.c
index 1b2b2b7..c4c9d62 100644
--- a/src/wsputil.c
+++ b/src/wsputil.c
@@ -496,6 +496,12 @@ gboolean wsp_decode_application_id(struct wsp_header_iter *iter,
*/
if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_SHORT) {
val = *pdu_val & 0x7f;
+ } else if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_TEXT) {
+ val_len = wsp_header_iter_get_val_len(iter);
+ val = -1;
+
+ if (out_value)
+ *out_value = pdu_val;
} else {
val_len = wsp_header_iter_get_val_len(iter);
--
1.7.10.1
10 years
[PATCH_v3] gprs: Fix wrong behavior when network is lost
by Guillaume Zajac
---
src/gprs.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 85 insertions(+), 21 deletions(-)
diff --git a/src/gprs.c b/src/gprs.c
index 0d25506..9428003 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1436,6 +1436,78 @@ void ofono_gprs_resume_notify(struct ofono_gprs *gprs)
update_suspended_property(gprs, FALSE);
}
+static void gprs_attached_update(struct ofono_gprs *gprs);
+
+static void gprs_deactivate_for_release(const struct ofono_error *error,
+ void *data)
+{
+ struct pri_context *ctx = data;
+ struct ofono_gprs *gprs = ctx->gprs;
+ DBusConnection *conn = ofono_dbus_get_connection();
+ dbus_bool_t value;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ DBG("Deactivating context failed with error: %s",
+ telephony_error_to_str(error));
+
+ return;
+ }
+
+ pri_reset_context_settings(ctx);
+ release_context(ctx);
+
+ value = FALSE;
+ ofono_dbus_signal_property_changed(conn, ctx->path,
+ OFONO_CONNECTION_CONTEXT_INTERFACE,
+ "Active", DBUS_TYPE_BOOLEAN, &value);
+
+ /*
+ * If "Attached" property was about to be signalled as TRUE but there
+ * were still active contexts, try again to signal "Attached" property
+ * to registered applications after active contexts have been released.
+ */
+ gprs_attached_update(gprs);
+}
+
+static gboolean check_active_contexts(struct ofono_gprs *gprs)
+{
+ GSList *l;
+ struct pri_context *ctx;
+
+ for (l = gprs->contexts; l; l = l->next) {
+ ctx = l->data;
+
+ if (ctx->active == TRUE)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void deactivate_active_contexts(struct ofono_gprs *gprs)
+{
+ GSList *l;
+ struct pri_context *ctx;
+
+ for (l = gprs->contexts; l; l = l->next) {
+ struct ofono_gprs_context *gc;
+
+ ctx = l->data;
+
+ if (ctx->active == FALSE)
+ continue;
+
+ /* This context is already being messed with */
+ if (ctx->pending)
+ continue;
+
+ gc = ctx->context_driver;
+
+ gc->driver->deactivate_primary(gc, ctx->context.cid,
+ gprs_deactivate_for_release, ctx);
+ }
+}
+
static void gprs_attached_update(struct ofono_gprs *gprs)
{
DBusConnection *conn = ofono_dbus_get_connection();
@@ -1450,30 +1522,22 @@ static void gprs_attached_update(struct ofono_gprs *gprs)
if (attached == gprs->attached)
return;
- gprs->attached = attached;
-
- if (gprs->attached == FALSE) {
- GSList *l;
- struct pri_context *ctx;
-
- for (l = gprs->contexts; l; l = l->next) {
- ctx = l->data;
-
- if (ctx->active == FALSE)
- continue;
-
- pri_reset_context_settings(ctx);
- release_context(ctx);
-
- value = FALSE;
- ofono_dbus_signal_property_changed(conn, ctx->path,
- OFONO_CONNECTION_CONTEXT_INTERFACE,
- "Active", DBUS_TYPE_BOOLEAN, &value);
- }
-
+ /*
+ * If an active context is found, a PPP session might be still active
+ * at driver level. "Attached" = TRUE property can't be signalled to
+ * the applications registered on GPRS properties.
+ * Active contexts have to be deactivated.
+ */
+ if (attached == FALSE) {
+ deactivate_active_contexts(gprs);
gprs->bearer = -1;
+ } else if (check_active_contexts(gprs) == TRUE) {
+ deactivate_active_contexts(gprs);
+ return;
}
+ gprs->attached = attached;
+
path = __ofono_atom_get_path(gprs->atom);
value = attached;
ofono_dbus_signal_property_changed(conn, path,
--
1.7.5.4
10 years
[PATCH] bluez version 4.99 is required.
by Marko Saukko
bluez 4.99 introduced key_size to bt_security struct that is used in
ofono, thus the requirement needs to be higher.
Signed-off-by: Marko Saukko <marko.saukko(a)gmail.com>
---
configure.ac | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 251a726..9f77a3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,8 +177,8 @@ AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
[disable Bluetooth modem support]),
[enable_bluetooth=${enableval}])
if (test "${enable_bluetooth}" != "no"); then
- PKG_CHECK_MODULES(BLUEZ, bluez >= 4.30, dummy=yes,
- AC_MSG_ERROR(Bluetooth library >= 4.30 is required))
+ PKG_CHECK_MODULES(BLUEZ, bluez >= 4.99, dummy=yes,
+ AC_MSG_ERROR(Bluetooth library >= 4.99 is required))
fi
AC_SUBST(BLUEZ_CFLAGS)
AC_SUBST(BLUEZ_LIBS)
--
1.7.7
10 years
Re: ofono-tests internet context: DNS works, ping wget and ssh do not (Connection Refused)
by Denis Kenzior
Hi Darren,
On 05/09/2012 05:46 PM, Darren Hart wrote:
> I have successfully used ofono-tests to enable,online,activate,and
> create-internet-context. I have an IP address and added the opendns servers. DNS
> appears to be working and the route looks sane-ish.
>
Please keep in mind that oFono is only signaling settings to an external
component (e.g. a connection manager like ConnMan). So route
assignment, DNS entry assignment, etc are not done by oFono. oFono only
brings up the interface and assigns the local IPv4 address.
> However, ping, wget, and ssh all fail. ping just sits there, wget and ssh both
> fail with Connection Refused.
>
> Is there something obvious/common I might be running into?
>
> I'm using ofono 1.5. The steps I took for context follow:
>
> # ./enable-modem
> Connecting modem /mbm_0...
>
> # ./online-modem
> Setting modem /mbm_0 online...
>
> # ./activate-context
>
These steps are fine, is your context pre-configured already? What does
the output of list-contexts look like?
> # ./create-internet-context
> Found context /mbm_0/context1
>
Generally you do this _before_ activate_context and you give parameters
for the context settings. e.g. create-internet-context
"apn.operator.com" "username" "password"
> # ifconfig usb0
> usb0 Link encap:Ethernet HWaddr 02:80:37:EC:02:00
> inet addr:10.25.40.80 Bcast:10.25.40.95 Mask:255.255.255.224
> inet6 addr: fe80::80:37ff:feec:200/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:6 errors:0 dropped:0 overruns:0 frame:0
> TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:846 (846.0 B) TX bytes:28270 (27.6 KiB)
That looks good.
>
> # cat /etc/resolv.conf
> # Generated by Connection Manager
> nameserver 208.67.222.222
> nameserver 208.67.220.220
> nameserver 127.0.0.1
>
> # route -n
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 0.0.0.0 10.25.40.66 0.0.0.0 UG 0 0 0 usb0
> 10.25.40.64 0.0.0.0 255.255.255.224 U 0 0 0 usb0
> 10.25.40.66 0.0.0.0 255.255.255.255 UH 0 0 0 usb0
> 172.18.7.170 10.25.40.66 255.255.255.255 UGH 0 0 0 usb0
>
The route assignment seems fine, I assume you're using connman?
> # ping dvhart.com
> PING dvhart.com (184.154.165.98): 56 data bytes
> ^C
> --- dvhart.com ping statistics ---
> 1 packets transmitted, 0 packets received, 100% packet loss
>
> # wget http://www.dvhart.com/darren/hello
> Connecting to www.dvhart.com (184.154.165.98:80)
> wget: can't connect to remote host (184.154.165.98): Connection refused
>
> # ssh dvhart(a)dvhart.com
> ssh: Exited: Error connecting: Connection refused
>
> After disabling usb0 and bringup eth0, all of the above commands work as
> expected.
>
>
> And finally, I saved the output of list-modems off, but I don't recall
> when in the process, but I'm including it for the modem information, etc:
>
> # ./list-modems
> [ /mbm_0 ]
> Features = gprs net cbs ussd gps sms stk rat sim
> Emergency = 0
> Powered = 1
> Lockdown = 0
> Interfaces = org.ofono.ConnectionManager org.ofono.NetworkRegistration org.ofono.CellBroadcast org.ofono.SupplementaryServices org.ofono.LocationReporting org.ofono.SmartMessaging org.ofono.PushNotification org.ofono.MessageManager org.ofono.SimToolkit org.ofono.RadioSettings org.ofono.SimManager
> Online = 1
> Model = F5521gw
> Revision = R2A07(R2A07)
> Type = hardware
> Serial = 356215040140315
> Manufacturer = Ericsson
> [ org.ofono.ConnectionManager ]
> Powered = 1
> Attached = 1
> Bearer = none
> Suspended = 0
> RoamingAllowed = 0
> [ org.ofono.NetworkRegistration ]
> Status = registered
> Strength = 80
> Name = AT&T
> LocationAreaCode = 33998
> Mode = auto-only
> MobileCountryCode = 310
> Technology = hspa
> CellId = 13805302
> MobileNetworkCode = 410
I see you're on AT&T. What APN are you using, the WAP-only APN or
something that allows actual internet connections?
> [ org.ofono.CellBroadcast ]
> Topics =
> Powered = 1
> [ org.ofono.SupplementaryServices ]
> State = idle
> [ org.ofono.LocationReporting ]
> Type = nmea
> Enabled = 0
> [ org.ofono.SmartMessaging ]
> [ org.ofono.PushNotification ]
> [ org.ofono.MessageManager ]
> Alphabet = default
> UseDeliveryReports = 0
> Bearer = cs-preferred
> ServiceCenterAddress = +13123149810
> [ org.ofono.SimToolkit ]
> IdleModeIcon =
> MainMenuTitle =
> MainMenu =
> MainMenuIcon =
> [ org.ofono.RadioSettings ]
> TechnologyPreference = any
> [ org.ofono.SimManager ]
> Retries = [pin2 = 3] [puk2 = 10] [pin = 3] [puk = 10]
> MobileCountryCode = 310
> FixedDialing = 0
> SubscriberNumbers =
> PreferredLanguages = en
> BarredDialing = 0
> CardIdentifier = 89014104254691314226
> LockedPins =
> MobileNetworkCode = 410
> SubscriberIdentity = 310410469131422
> Present = 1
> PinRequired = none
>
This looks sane?
Regards,
-Denis
10 years
[PATCH_v2] atmodem: Fix crash on context activation.
by Guillaume Zajac
Shutdown PPP session if modem did not do it.
---
drivers/atmodem/gprs-context.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index 16893ce..100c80b 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -239,6 +239,17 @@ static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
memcpy(gcd->username, ctx->username, sizeof(ctx->username));
memcpy(gcd->password, ctx->password, sizeof(ctx->password));
+ /*
+ * For some modem, mainly Huawei branded, when GPRS is no more attached
+ * to the network, oFono core will reset context although the modem
+ * has not ended ppp sesssion at driver level.
+ * In this case trigger a disconnection manually and send an error.
+ */
+ if (gcd->ppp != NULL && gcd->state == STATE_ACTIVE) {
+ g_at_ppp_shutdown(gcd->ppp);
+ goto error;
+ }
+
gcd->state = STATE_ENABLING;
if (gcd->vendor == OFONO_VENDOR_ZTE) {
--
1.7.4.1
10 years
[PATCH 0/2] mmsd: GetConversation
by Ronald Tessier
These patches concern mmsd and are related to lastest patches applied.
Ronald Tessier (2):
test: Add python get-conversation test
TODO: Update TODO to remove GetConversation entry
Makefile.am | 3 ++-
TODO | 10 ----------
test/get-conversation | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 11 deletions(-)
create mode 100755 test/get-conversation
--
1.7.4.1
10 years