Possible Errors: [service].Error.InvalidArguments
[service].Error.DoesNotExist
+ object AddProfile(string name)
+
+ Add a new profile with the specified name.
+
+ It is possible to create two profiles with the same
+ name. The identification is done via the object path
+ and not the name of the profile.
+
+ Possible Errors: [service].Error.InvalidArguments
+
+ void RemoveProfile(object path)
+
+ Remove profile with specified object path.
+
+ It is not possible to remove the current active
+ profile. To remove the active profile a different
+ one must be selected via ActiveProfile property
+ first.
+
+ At minium one profile must be available all the time.
+
+ Possible Errors: [service].Error.InvalidArguments
+
void RegisterAgent(object path)
Register new agent for handling user requests.
the limited usage of WiFi or Bluetooth devices might
be allowed in some situations.
+ object ActiveProfile [readwrite]
+
+ Object path of the current active profile.
+
array{object} Profiles [readonly]
List of profile object paths.
List of device object paths.
+ array{object} Services [readonly]
+
+ List of service object paths.
+
+ This list represents the available services for the
+ current selected profile. If the profile gets changed
+ then this list will be updated.
+
+ The same list is available via the profile object
+ itself. It is just provided here for convenience of
+ applications only dealing with the current active
+ profile.
+
array{object} Connections [readonly]
List of active connection object paths.
dbus_message_iter_close_container(dict, &entry);
}
+static void append_services(DBusMessageIter *dict)
+{
+ DBusMessageIter entry, value, iter;
+ const char *key = "Services";
+
+ dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
+ NULL, &entry);
+
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
+
+ dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT,
+ DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_OBJECT_PATH_AS_STRING,
+ &value);
+
+ dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_OBJECT_PATH_AS_STRING, &iter);
+ __connman_profile_list_services(&iter);
+ dbus_message_iter_close_container(&value, &iter);
+
+ dbus_message_iter_close_container(&entry, &value);
+
+ dbus_message_iter_close_container(dict, &entry);
+}
+
static void append_devices(DBusMessageIter *dict)
{
DBusMessageIter entry, value, iter;
DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+ str = __connman_profile_active();
+ if (str != NULL)
+ connman_dbus_dict_append_variant(&dict, "ActiveProfile",
+ DBUS_TYPE_OBJECT_PATH, &str);
+
append_profiles(&dict);
+ append_services(&dict);
append_devices(&dict);
append_connections(&dict);
global_offlinemode = offlinemode;
__connman_device_set_offlinemode(offlinemode);
+ } else if (g_str_equal(name, "ActiveProfile") == TRUE) {
+ const char *str;
+
+ dbus_message_iter_get_basic(&value, &str);
+
+ return __connman_error_not_supported(msg);
}
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
+static DBusMessage *add_profile(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ const char *name;
+
+ DBG("conn %p", conn);
+
+ dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID);
+
+ return __connman_error_not_supported(msg);
+}
+
+static DBusMessage *remove_profile(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ const char *path;
+
+ DBG("conn %p", conn);
+
+ dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_INVALID);
+
+ return __connman_error_not_supported(msg);
+}
+
static DBusMessage *register_agent(DBusConnection *conn,
DBusMessage *msg, void *data)
{
static GDBusMethodTable manager_methods[] = {
{ "GetProperties", "", "a{sv}", get_properties },
{ "SetProperty", "sv", "", set_property },
+ { "AddProfile", "s", "o", add_profile },
+ { "RemoveProfile", "o", "", remove_profile },
{ "RegisterAgent", "o", "", register_agent },
{ "UnregisterAgent", "o", "", unregister_agent },
{ },