diff options
author | Abhishek Sansanwal <abhishek.s94@samsung.com> | 2018-12-13 10:51:58 +0530 |
---|---|---|
committer | Abhishek Sansanwal <abhishek.s94@samsung.com> | 2018-12-17 16:18:23 +0530 |
commit | 48e25ec7f60ffcba067708732298fd85a2b3ed47 (patch) | |
tree | c28087ff852425f2cfa0e5914982ad8f7e16d26f /src | |
parent | bf7dbf8354f076ec768ae24e61d6fb1e46c623af (diff) | |
download | connman-submit/tizen/20181217.121131.tar.gz connman-submit/tizen/20181217.121131.tar.bz2 connman-submit/tizen/20181217.121131.zip |
Added dbus method to get whether 5Ghz band is supportedsubmit/tizen/20181217.121131accepted/tizen/unified/20181218.063104
Change-Id: Ib3b189615648a35aa876eab3e3f61c47ac0c1e68
Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/connman.conf | 1 | ||||
-rw-r--r-- | src/technology.c | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/connman.conf b/src/connman.conf index e0922356..cd9eefb1 100644 --- a/src/connman.conf +++ b/src/connman.conf @@ -14,6 +14,7 @@ <deny send_destination="net.connman"/> <allow send_destination="net.connman" send_type="signal"/> <allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="GetScanState" /> + <allow send_destination="net.connman" send_interface="net.connman.Technology" send_member="Get5GhzSupported" /> <check send_destination="net.connman" send_interface="net.connman.Manager" send_member="GetTechnologies" privilege="http://tizen.org/privilege/network.get" /> <check send_destination="net.connman" send_interface="net.connman.Manager" send_member="GetProperties" privilege="http://tizen.org/privilege/network.get" /> diff --git a/src/technology.c b/src/technology.c index 6604599e..05ec0c0c 100644 --- a/src/technology.c +++ b/src/technology.c @@ -98,6 +98,9 @@ struct connman_technology { #if defined TIZEN_EXT_WIFI_MESH DBusMessage *mesh_dbus_msg; #endif +#if defined TIZEN_EXT + bool is_5_0_ghz_supported; +#endif }; static GSList *driver_list = NULL; @@ -394,6 +397,16 @@ bool connman_technology_get_wifi_tethering(const char **ssid, return true; } +#if defined TIZEN_EXT +void connman_techonology_wifi_set_5ghz_supported(struct connman_technology *wifi_technology, + bool is_5_0_ghz_supported) +{ + DBG(""); + + wifi_technology->is_5_0_ghz_supported = is_5_0_ghz_supported; +} +#endif + static void free_rfkill(gpointer data) { struct connman_rfkill *rfkill = data; @@ -1410,6 +1423,33 @@ static DBusMessage *specific_scan(DBusConnection *conn, DBusMessage *msg, void * return NULL; } +#if defined TIZEN_EXT +static DBusMessage *get_5ghz_supported(DBusConnection *conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply; + DBusMessageIter iter, dict; + struct connman_technology *technology = data; + dbus_bool_t supported = technology->is_5_0_ghz_supported; + + DBG("technology %p", technology); + + reply = dbus_message_new_method_return(msg); + if (!reply) + return NULL; + + dbus_message_iter_init_append(reply, &iter); + + connman_dbus_dict_open(&iter, &dict); + connman_dbus_dict_append_basic(&dict, "Is5GhzSupported", + DBUS_TYPE_BOOLEAN, + &supported); + + connman_dbus_dict_close(&iter, &dict); + + return reply; +} +#endif + static DBusMessage *get_scan_state(DBusConnection *conn, DBusMessage *msg, void *data) { DBusMessage *reply; @@ -1923,6 +1963,8 @@ static const GDBusMethodTable technology_methods[] = { NULL, specific_scan) }, { GDBUS_METHOD("GetScanState", NULL, GDBUS_ARGS({ "scan_state", "a{sv}" }), get_scan_state) }, + { GDBUS_METHOD("Get5GhzSupported", NULL, GDBUS_ARGS({ "supported", "a{sv}" }), + get_5ghz_supported) }, #endif #if defined TIZEN_EXT_WIFI_MESH { GDBUS_ASYNC_METHOD("MeshCommands", |