Add skeleton for method to join networks
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 25 Mar 2009 12:19:44 +0000 (13:19 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 25 Mar 2009 12:19:44 +0000 (13:19 +0100)
doc/device-api.txt
src/device.c

index a45046d91435dc23caeea6797885c0a78d162eb0..83d6531195cb33c90abecd329d2e80376811722b 100644 (file)
@@ -22,6 +22,14 @@ Methods              dict GetProperties()
                        Possible Errors: [service].Error.InvalidArguments
                                         [service].Error.DoesNotExist
 
+               void JoinNetwork(dict network)
+
+                       Join network specified by the given properties. The
+                       properties for WiFi networks can be WiFi.SSID,
+                       WiFi.Security and WiFi.Passphrase.
+
+                       Possible Errors: [service].Error.InvalidArguments
+
                object CreateNetwork(dict network)
 
                        Creates a network object from the specified
index 54a74f198cdde0b7800706aa0540a80fdcc04d11..d7106eaf5b90970926a3e27bb748176f59b64583 100644 (file)
@@ -470,6 +470,18 @@ static DBusMessage *set_property(DBusConnection *conn,
        return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
+static DBusMessage *join_network(DBusConnection *conn,
+                                       DBusMessage *msg, void *data)
+{
+       DBG("conn %p", conn);
+
+       if (__connman_security_check_privilege(msg,
+                                       CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0)
+               return __connman_error_permission_denied(msg);
+
+       return __connman_error_invalid_arguments(msg);
+}
+
 static DBusMessage *create_network(DBusConnection *conn,
                                        DBusMessage *msg, void *data)
 {
@@ -527,6 +539,7 @@ static DBusMessage *propose_scan(DBusConnection *conn,
 static GDBusMethodTable device_methods[] = {
        { "GetProperties", "",      "a{sv}", get_properties },
        { "SetProperty",   "sv",    "",      set_property   },
+       { "JoinNetwork",   "a{sv}", "",      join_network   },
        { "CreateNetwork", "a{sv}", "o",     create_network },
        { "RemoveNetwork", "o",     "",      remove_network },
        { "ProposeScan",   "",      "",      propose_scan   },