char *peer_mac = NULL;
int is_connected = 0;
-void __netconfig_wifi_notify_tdls_event(const char *sig_name,const char *peer_mac)
+void __netconfig_wifi_notify_tdls_event(const char *sig_name, const char *peer_mac)
{
GVariantBuilder *builder;
GVariant *params;
}
params = g_variant_new("(s)", str);
- INFO("[TizenMW-->WPAS] Sent Dbus Method :[%s],value[%s]", method,str);
+ INFO("[TizenMW-->WPAS] Sent Dbus Method :[%s],value[%s]", method, str);
message = netconfig_invoke_dbus_method(SUPPLICANT_SERVICE,
if_path, SUPPLICANT_INTERFACE ".Interface", method, params);
return message;
}
+gboolean handle_tdls_connect(Wifi *wifi, GDBusMethodInvocation *context,
+ gchar *peer_mac_Addr)
+{
+ DBG("[TizenMW-->WPAS]: TDLS Setup Request: [%s]", peer_mac_Addr);
+
+ if (is_connected) {
+ ERR(" Already active TDLS Connection !!!");
+ } else {
+ GVariant *message = NULL;
+ message = __netconfig_wifi_tdls_send_dbus_str("TDLSSetup", (const char*)peer_mac_Addr);
+
+ if (message == NULL) {
+ ERR(" TDLS : failed to connect !!!");
+ netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "FailTdlsConnect");
+ return FALSE;
+ }
+
+ DBG("[TizenMW<--WPAS] TDLS DBUS Command sent successfully");
+ g_variant_unref(message);
+ is_connected = 1;
+ }
+
+ wifi_complete_tdls_connect(wifi, context, 1);
+ return TRUE;
+}
+
+gboolean handle_tdls_discover(Wifi *wifi, GDBusMethodInvocation *context)
+{
+ DBG("[TizenMW-->WPAS]: TDLS Discover Request ");
+
+ if (is_connected) {
+ ERR(" Already active TDLS Connection !!!");
+ } else {
+ GVariant *message = NULL;
+ message = __netconfig_wifi_tdls_send_dbus_str("TDLSDiscover", "ff:ff:ff:ff:ff:ff");
+
+ if (message == NULL) {
+ ERR(" TDLS : failed to discover !!!");
+ netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "FailTdlsDiscover");
+ return FALSE;
+ }
+
+ DBG("[TizenMW<--WPAS] TDLS DBUS Command sent successfully");
+ g_variant_unref(message);
+ }
+
+ wifi_complete_tdls_discover(wifi, context);
+ return TRUE;
+}
+
gboolean handle_tdls_disconnect(Wifi *wifi, GDBusMethodInvocation *context,
gchar *peer_mac_Addr)
{
DBG("[TizenMW-->WPAS]: TDLS Teardown Request: [%s]", peer_mac_Addr);
- if(!is_connected) {
+ if (!is_connected) {
ERR(" No active TDLS Connection !!!");
-
} else {
GVariant *message = NULL;
message = __netconfig_wifi_tdls_send_dbus_str("TDLSTeardown", (const char*)peer_mac_Addr);
+
+ if (message == NULL) {
+ ERR(" TDLS : failed to disconnect !!!");
+ netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_INTERNAL, "FailTdlsDisconnect");
+ return FALSE;
+ }
+
DBG("[TizenMW<--WPAS] TDLS DBUS Command sent successfully");
g_variant_unref(message);
is_connected = 0;
return TRUE;
}
-void netconfig_wifi_tlds_connected_event(GVariant *message)
+void netconfig_wifi_tdls_connected_event(GVariant *message)
{
DBG("[TizenMW<--WPAS] WiFi TDLS Connected EVENT");
__netconfig_wifi_notify_tdls_event("TDLSConnect", peer_mac);
}
-void netconfig_wifi_tlds_disconnected_event(GVariant *message)
+void netconfig_wifi_tdls_disconnected_event(GVariant *message)
{
DBG("[TizenMW<--WPAS]: WiFi TDLS Disconnected EVENT");
const gchar *peer_mac_addr = NULL;
if (g_strcmp0(peer_mac, peer_mac_addr) == 0) {
INFO("TDLS Peer Disconnected Mac Address: [%s]", peer_mac);
is_connected = 0;
- __netconfig_wifi_notify_tdls_event("TDLSDisconnect",peer_mac);
+ __netconfig_wifi_notify_tdls_event("TDLSDisconnect", peer_mac);
} else
INFO("TDLS Peer Disconnected peer_mac(%s) != peer_mac_address(%s)", peer_mac, peer_mac_addr);
}
+
+
+void netconfig_wifi_tdls_peer_found_event(GVariant *message)
+{
+ DBG("[TizenMW<--WPAS]: WiFi TDLS Discovery EVENT");
+ const gchar *peer_mac_addr = NULL;
+
+ g_variant_get(message, "(s)", &peer_mac_addr);
+ INFO("Discover Peer Mac Address: [%s]", peer_mac_addr);
+
+ __netconfig_wifi_notify_tdls_event("TDLSPeerFound", peer_mac_addr);
+}
+