diff --git a/include/dbus.h b/include/dbus.h index 8858a164..8cd214db 100644 --- a/include/dbus.h +++ b/include/dbus.h @@ -38,6 +38,8 @@ extern "C" { #define OFONO_CALL_SETTINGS_INTERFACE "org.ofono.CallSettings" #define OFONO_CALL_VOLUME_INTERFACE OFONO_SERVICE ".CallVolume" #define OFONO_CELL_BROADCAST_INTERFACE "org.ofono.CellBroadcast" +#define OFONO_CONNECTION_CONTEXT_INTERFACE "org.ofono.ConnectionContext" +#define OFONO_CONNECTION_MANAGER_INTERFACE "org.ofono.ConnectionManager" #define OFONO_MESSAGE_MANAGER_INTERFACE "org.ofono.MessageManager" #define OFONO_MESSAGE_WAITING_INTERFACE "org.ofono.MessageWaiting" #define OFONO_NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration" @@ -47,8 +49,6 @@ extern "C" { #define OFONO_SIM_MANAGER_INTERFACE "org.ofono.SimManager" #define OFONO_VOICECALL_INTERFACE "org.ofono.VoiceCall" #define OFONO_VOICECALL_MANAGER_INTERFACE "org.ofono.VoiceCallManager" -#define OFONO_DATA_CONNECTION_MANAGER_INTERFACE "org.ofono.DataConnectionManager" -#define OFONO_DATA_CONTEXT_INTERFACE "org.ofono.PrimaryDataContext" #define OFONO_STK_INTERFACE OFONO_SERVICE ".SimToolkit" #define OFONO_SIM_APP_INTERFACE OFONO_SERVICE ".SimToolkitAgent" diff --git a/src/gprs.c b/src/gprs.c index 37afb993..ff98308e 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -282,8 +282,9 @@ static void pri_context_signal_settings(struct pri_context *ctx) DBusMessageIter iter; const char *prop = "Settings"; - signal = dbus_message_new_signal(path, OFONO_DATA_CONTEXT_INTERFACE, - "PropertyChanged"); + signal = dbus_message_new_signal(path, + OFONO_CONNECTION_CONTEXT_INTERFACE, + "PropertyChanged"); if (!signal) return; @@ -464,9 +465,8 @@ static void pri_activate_callback(const struct ofono_error *error, value = ctx->active; ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Active", DBUS_TYPE_BOOLEAN, - &value); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, &value); } static void pri_deactivate_callback(const struct ofono_error *error, void *data) @@ -495,9 +495,8 @@ static void pri_deactivate_callback(const struct ofono_error *error, void *data) value = ctx->active; ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Active", DBUS_TYPE_BOOLEAN, - &value); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, &value); } static DBusMessage *pri_set_apn(struct pri_context *ctx, DBusConnection *conn, @@ -525,9 +524,9 @@ static DBusMessage *pri_set_apn(struct pri_context *ctx, DBusConnection *conn, g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID); ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "AccessPointName", - DBUS_TYPE_STRING, &apn); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "AccessPointName", + DBUS_TYPE_STRING, &apn); return NULL; } @@ -555,9 +554,9 @@ static DBusMessage *pri_set_username(struct pri_context *ctx, g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID); ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Username", - DBUS_TYPE_STRING, &username); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Username", + DBUS_TYPE_STRING, &username); return NULL; } @@ -585,9 +584,9 @@ static DBusMessage *pri_set_password(struct pri_context *ctx, g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID); ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Password", - DBUS_TYPE_STRING, &password); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Password", + DBUS_TYPE_STRING, &password); return NULL; } @@ -616,9 +615,8 @@ static DBusMessage *pri_set_type(struct pri_context *ctx, DBusConnection *conn, g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID); ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Type", DBUS_TYPE_STRING, - &type); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Type", DBUS_TYPE_STRING, &type); return NULL; } @@ -646,9 +644,8 @@ static DBusMessage *pri_set_proto(struct pri_context *ctx, g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID); ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Protocol", DBUS_TYPE_STRING, - &str); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Protocol", DBUS_TYPE_STRING, &str); return NULL; } @@ -674,9 +671,8 @@ static DBusMessage *pri_set_name(struct pri_context *ctx, DBusConnection *conn, g_dbus_send_reply(conn, msg, DBUS_TYPE_INVALID); ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Name", DBUS_TYPE_STRING, - &name); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Name", DBUS_TYPE_STRING, &name); return NULL; } @@ -863,7 +859,8 @@ static gboolean context_dbus_register(struct pri_context *ctx) snprintf(path, sizeof(path), "%s/primarycontext%u", basepath, ctx->id); - if (!g_dbus_register_interface(conn, path, OFONO_DATA_CONTEXT_INTERFACE, + if (!g_dbus_register_interface(conn, path, + OFONO_CONNECTION_CONTEXT_INTERFACE, context_methods, context_signals, NULL, ctx, pri_context_destroy)) { ofono_error("Could not register PrimaryContext %s", path); @@ -888,7 +885,7 @@ static gboolean context_dbus_unregister(struct pri_context *ctx) idmap_put(ctx->gprs->pid_map, ctx->id); return g_dbus_unregister_interface(conn, path, - OFONO_DATA_CONTEXT_INTERFACE); + OFONO_CONNECTION_CONTEXT_INTERFACE); } static char **gprs_contexts_path_list(GSList *context_list) @@ -943,16 +940,15 @@ static void gprs_attached_update(struct ofono_gprs *gprs) value = FALSE; ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Active", DBUS_TYPE_BOOLEAN, - &value); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, &value); } } path = __ofono_atom_get_path(gprs->atom); value = attached; ofono_dbus_signal_property_changed(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE, + OFONO_CONNECTION_MANAGER_INTERFACE, "Attached", DBUS_TYPE_BOOLEAN, &value); } @@ -1153,7 +1149,7 @@ static DBusMessage *gprs_set_property(DBusConnection *conn, path = __ofono_atom_get_path(gprs->atom); ofono_dbus_signal_property_changed(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE, + OFONO_CONNECTION_MANAGER_INTERFACE, property, DBUS_TYPE_BOOLEAN, &value); return dbus_message_new_method_return(msg); @@ -1233,7 +1229,7 @@ static DBusMessage *gprs_create_context(DBusConnection *conn, if (objpath_list) { path = __ofono_atom_get_path(gprs->atom); ofono_dbus_signal_array_property_changed(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE, + OFONO_CONNECTION_MANAGER_INTERFACE, "PrimaryContexts", DBUS_TYPE_OBJECT_PATH, &objpath_list); @@ -1283,7 +1279,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error, DBusConnection *conn = ofono_dbus_get_connection(); ofono_dbus_signal_array_property_changed(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE, + OFONO_CONNECTION_MANAGER_INTERFACE, "PrimaryContexts", DBUS_TYPE_OBJECT_PATH, &objpath_list); g_strfreev(objpath_list); @@ -1334,7 +1330,7 @@ static DBusMessage *gprs_remove_context(DBusConnection *conn, if (objpath_list) { path = __ofono_atom_get_path(gprs->atom); ofono_dbus_signal_array_property_changed(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE, + OFONO_CONNECTION_MANAGER_INTERFACE, "PrimaryContexts", DBUS_TYPE_OBJECT_PATH, &objpath_list); g_strfreev(objpath_list); @@ -1469,9 +1465,8 @@ void ofono_gprs_context_deactivated(struct ofono_gprs_context *gc, value = FALSE; ofono_dbus_signal_property_changed(conn, ctx->path, - OFONO_DATA_CONTEXT_INTERFACE, - "Active", DBUS_TYPE_BOOLEAN, - &value); + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, &value); } } @@ -1625,9 +1620,9 @@ static void gprs_unregister(struct ofono_atom *atom) } ofono_modem_remove_interface(modem, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE); + OFONO_CONNECTION_MANAGER_INTERFACE); g_dbus_unregister_interface(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE); + OFONO_CONNECTION_MANAGER_INTERFACE); } static void gprs_remove(struct ofono_atom *atom) @@ -1879,17 +1874,17 @@ void ofono_gprs_register(struct ofono_gprs *gprs) struct ofono_atom *sim_atom; if (!g_dbus_register_interface(conn, path, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE, + OFONO_CONNECTION_MANAGER_INTERFACE, manager_methods, manager_signals, NULL, gprs, NULL)) { ofono_error("Could not create %s interface", - OFONO_DATA_CONNECTION_MANAGER_INTERFACE); + OFONO_CONNECTION_MANAGER_INTERFACE); return; } ofono_modem_add_interface(modem, - OFONO_DATA_CONNECTION_MANAGER_INTERFACE); + OFONO_CONNECTION_MANAGER_INTERFACE); sim_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM); diff --git a/src/modem.c b/src/modem.c index 8d47ceda..1ecc92f5 100644 --- a/src/modem.c +++ b/src/modem.c @@ -809,7 +809,7 @@ static const struct { { OFONO_MESSAGE_MANAGER_INTERFACE, "sms" }, { OFONO_SIM_MANAGER_INTERFACE, "sim" }, { OFONO_STK_INTERFACE, "stk" }, - { OFONO_DATA_CONNECTION_MANAGER_INTERFACE, "gprs" }, + { OFONO_CONNECTION_MANAGER_INTERFACE, "gprs" }, { }, };