*
* Connection Manager
*
- * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-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
#include "connman.h"
-connman_bool_t connman_state_idle;
-DBusMessage *session_mode_pending = NULL;
+static connman_bool_t connman_state_idle;
+static DBusMessage *session_mode_pending = NULL;
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *data)
connman_dbus_dict_append_basic(&dict, "OfflineMode",
DBUS_TYPE_BOOLEAN, &offlinemode);
- connman_dbus_dict_append_array(&dict, "AvailableDebugs",
- DBUS_TYPE_STRING, __connman_debug_list_available, NULL);
- connman_dbus_dict_append_array(&dict, "EnabledDebugs",
- DBUS_TYPE_STRING, __connman_debug_list_enabled, NULL);
-
sessionmode = __connman_session_mode();
connman_dbus_dict_append_basic(&dict, "SessionMode",
DBUS_TYPE_BOOLEAN,
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
-static GDBusMethodTable manager_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties },
- { "SetProperty", "sv", "", set_property,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "GetTechnologies", "", "a(oa{sv})", get_technologies },
- { "RemoveProvider", "o", "", remove_provider },
- { "GetServices", "", "a(oa{sv})", get_services },
- { "ConnectProvider", "a{sv}", "o", connect_provider,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "RegisterAgent", "o", "", register_agent },
- { "UnregisterAgent", "o", "", unregister_agent },
- { "RegisterCounter", "ouu", "", register_counter },
- { "UnregisterCounter", "o", "", unregister_counter },
- { "CreateSession", "a{sv}o", "o", create_session },
- { "DestroySession", "o", "", destroy_session },
- { "RequestPrivateNetwork", "", "oa{sv}h",
- request_private_network,
- G_DBUS_METHOD_FLAG_ASYNC },
- { "ReleasePrivateNetwork", "o", "",
- release_private_network },
+static const GDBusMethodTable manager_methods[] = {
+ { GDBUS_METHOD("GetProperties",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ get_properties) },
+ { GDBUS_ASYNC_METHOD("SetProperty",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
+ NULL, set_property) },
+ { GDBUS_METHOD("GetTechnologies",
+ NULL, GDBUS_ARGS({ "technologies", "a(oa{sv})" }),
+ get_technologies) },
+ { GDBUS_METHOD("RemoveProvider",
+ GDBUS_ARGS({ "provider", "o" }), NULL,
+ remove_provider) },
+ { GDBUS_METHOD("GetServices",
+ NULL, GDBUS_ARGS({ "services", "a(oa{sv})" }),
+ get_services) },
+ { GDBUS_ASYNC_METHOD("ConnectProvider",
+ GDBUS_ARGS({ "provider", "a{sv}" }),
+ GDBUS_ARGS({ "path", "o" }),
+ connect_provider) },
+ { GDBUS_METHOD("RegisterAgent",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ register_agent) },
+ { GDBUS_METHOD("UnregisterAgent",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ unregister_agent) },
+ { GDBUS_METHOD("RegisterCounter",
+ GDBUS_ARGS({ "path", "o" }, { "accuracy", "u" },
+ { "period", "u" }),
+ NULL, register_counter) },
+ { GDBUS_METHOD("UnregisterCounter",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ unregister_counter) },
+ { GDBUS_METHOD("CreateSession",
+ GDBUS_ARGS({ "settings", "a{sv}" },
+ { "notifier", "o" }),
+ GDBUS_ARGS({ "session", "o" }),
+ create_session) },
+ { GDBUS_METHOD("DestroySession",
+ GDBUS_ARGS({ "session", "o" }), NULL,
+ destroy_session) },
+ { GDBUS_ASYNC_METHOD("RequestPrivateNetwork",
+ NULL, GDBUS_ARGS({ "path", "o" },
+ { "settings", "a{sv}" },
+ { "socket", "h" }),
+ request_private_network) },
+ { GDBUS_METHOD("ReleasePrivateNetwork",
+ GDBUS_ARGS({ "path", "o" }), NULL,
+ release_private_network) },
{ },
};
-static GDBusSignalTable manager_signals[] = {
- { "PropertyChanged", "sv" },
- { "TechnologyAdded", "oa{sv}" },
- { "TechnologyRemoved", "o" },
- { "ServicesAdded", "a(oa{sv})" },
- { "ServicesRemoved", "ao" },
+static const GDBusSignalTable manager_signals[] = {
+ { GDBUS_SIGNAL("PropertyChanged",
+ GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
+ { GDBUS_SIGNAL("TechnologyAdded",
+ GDBUS_ARGS({ "path", "o" },
+ { "properties", "a{sv}" })) },
+ { GDBUS_SIGNAL("TechnologyRemoved",
+ GDBUS_ARGS({ "path", "o" })) },
+ { GDBUS_SIGNAL("ServicesChanged",
+ GDBUS_ARGS({ "changed", "a(oa{sv})" },
+ { "removed", "ao" })) },
{ },
};