Added dbus method to get whether 5Ghz band is supported 85/195385/4 accepted/tizen/unified/20181218.063104 submit/tizen/20181217.121131
authorAbhishek Sansanwal <abhishek.s94@samsung.com>
Thu, 13 Dec 2018 05:21:58 +0000 (10:51 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Mon, 17 Dec 2018 10:48:23 +0000 (16:18 +0530)
Change-Id: Ib3b189615648a35aa876eab3e3f61c47ac0c1e68
Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
gsupplicant/gsupplicant.h
gsupplicant/supplicant.c
include/technology.h
plugins/wifi.c
src/connman.conf
src/technology.c

index 597fe75..c3ef5a0 100644 (file)
@@ -368,6 +368,9 @@ void g_supplicant_interface_set_data(GSupplicantInterface *interface,
                                                                void *data);
 void *g_supplicant_interface_get_data(GSupplicantInterface *interface);
 const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface);
+#if defined TIZEN_EXT
+bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface);
+#endif
 const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface);
 GSupplicantState g_supplicant_interface_get_state(GSupplicantInterface *interface);
 const char *g_supplicant_interface_get_wps_key(GSupplicantInterface *interface);
index e7dfcb2..bafe478 100644 (file)
@@ -214,6 +214,7 @@ struct _GSupplicantInterface {
        GSupplicantNetwork *current_network;
        struct added_network_information network_info;
 #if defined TIZEN_EXT
+       dbus_bool_t is_5_0_Ghz_supported;
        int disconnect_reason;
 #endif
 #if defined TIZEN_EXT_WIFI_MESH
@@ -1113,7 +1114,13 @@ static void interface_capability(const char *key, DBusMessageIter *iter,
                if (max_scan_ssid < 2)
                        max_scan_ssid = 0;
                interface->max_scan_ssids = max_scan_ssid;
+#if defined TIZEN_EXT
+       } else if (g_strcmp0(key, "Is5GhzSupported") == 0) {
+               dbus_bool_t is_5_0_Ghz_supported;
 
+               dbus_message_iter_get_basic(iter, &is_5_0_Ghz_supported);
+               interface->is_5_0_Ghz_supported = is_5_0_Ghz_supported;
+#endif
        } else
                SUPPLICANT_DBG("key %s type %c",
                                key, dbus_message_iter_get_arg_type(iter));
@@ -1202,6 +1209,16 @@ const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface)
        return interface->ifname;
 }
 
+#if defined TIZEN_EXT
+bool g_supplicant_interface_get_is_5_0_ghz_supported(GSupplicantInterface *interface)
+{
+       if (!interface)
+               return NULL;
+
+       return interface->is_5_0_Ghz_supported;
+}
+#endif
+
 const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface)
 {
        if (!interface)
index 73cd8e7..29cdddf 100755 (executable)
@@ -83,6 +83,10 @@ struct connman_technology_driver {
 
 int connman_technology_driver_register(struct connman_technology_driver *driver);
 void connman_technology_driver_unregister(struct connman_technology_driver *driver);
+#if defined TIZEN_EXT
+void connman_techonology_wifi_set_5ghz_supported(struct connman_technology *technology,
+               bool is_5_0_Ghz_supported);
+#endif
 
 #ifdef __cplusplus
 }
index 33425e0..71727e6 100644 (file)
@@ -3566,6 +3566,10 @@ static void interface_added(GSupplicantInterface *interface)
 {
        const char *ifname = g_supplicant_interface_get_ifname(interface);
        const char *driver = g_supplicant_interface_get_driver(interface);
+#if defined TIZEN_EXT
+       bool is_5_0_ghz_supported = g_supplicant_interface_get_is_5_0_ghz_supported(interface);
+#endif
+
        struct wifi_data *wifi;
 
        wifi = g_supplicant_interface_get_data(interface);
@@ -3589,6 +3593,9 @@ static void interface_added(GSupplicantInterface *interface)
        }
 
        connman_device_set_powered(wifi->device, true);
+#if defined TIZEN_EXT
+       connman_techonology_wifi_set_5ghz_supported(wifi_technology, is_5_0_ghz_supported);
+#endif
 }
 
 static bool is_idle(struct wifi_data *wifi)
index e092235..cd9eefb 100644 (file)
@@ -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" />
index 6604599..05ec0c0 100644 (file)
@@ -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",