void __netconfig_wifi_notify_tdls_connected_event(const char *peer_mac);
gboolean handle_tdls_disconnect(Wifi *wifi, GDBusMethodInvocation *context, gchar *peer_mac_addr);
gboolean handle_tdls_connected_peer(Wifi *wifi, GDBusMethodInvocation *context);
+gboolean handle_tdls_connect(Wifi *wifi, GDBusMethodInvocation *context, gchar *peer_mac_Addr);
+gboolean handle_tdls_discover(Wifi *wifi, GDBusMethodInvocation *context);
#ifdef __cplusplus
<arg type="b" name="allowed" direction="out"/>
</method>
<method name="TdlsDisconnect">
- <arg type="s" name="pee_mac_addr" direction="in"/>
+ <arg type="s" name="peer_mac_addr" direction="in"/>
<arg type="i" name="result" direction="out" />
</method>
<method name="TdlsConnectedPeer">
<arg type="s" name="peer_mac_addr" direction="out" />
</method>
+ <method name="TdlsConnect">
+ <arg type="s" name="peer_mac_addr" direction="in"/>
+ <arg type="i" name="result" direction="out" />
+ </method>
+ <method name="TdlsDiscover">
+ </method>
<signal name="PowerOnCompleted"></signal>
<signal name="PowerOffCompleted"></signal>
<signal name="PowerOperationFailed"></signal>
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)
{
} 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;
G_CALLBACK(handle_tdls_disconnect), NULL);
g_signal_connect(wifi_object, "handle-tdls-connected-peer",
G_CALLBACK(handle_tdls_connected_peer), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-discover",
+ G_CALLBACK(handle_tdls_discover), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-connect",
+ G_CALLBACK(handle_tdls_connect), NULL);
if (!g_dbus_interface_skeleton_export(interface_wifi, connection,
NETCONFIG_WIFI_PATH, NULL)) {