From 56e4ccc1297a9033779bb7a365ffc96a1c1d11fc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 25 Mar 2009 13:19:44 +0100 Subject: [PATCH] Add skeleton for method to join networks --- doc/device-api.txt | 8 ++++++++ src/device.c | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/doc/device-api.txt b/doc/device-api.txt index a45046d..83d6531 100644 --- a/doc/device-api.txt +++ b/doc/device-api.txt @@ -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 diff --git a/src/device.c b/src/device.c index 54a74f1..d7106ea 100644 --- a/src/device.c +++ b/src/device.c @@ -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 }, -- 2.7.4