From 70a569103027b31b1300f79509fce7437a96de1c Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Mon, 27 Feb 2017 14:18:04 +0900 Subject: [PATCH] Remove Unused parameter and Add RSSI value for Peer Change-Id: I6268fa2026f0acede4c5dcd48cb3ac31a97e9cc3 Signed-off-by: Yu jiung --- packaging/csapi-network-wifi-direct.spec | 2 +- .../Interop/Interop.WiFiDirect.cs | 2 ++ .../Tizen.Network.WiFiDirect/WiFiDirectData.cs | 4 --- .../Tizen.Network.WiFiDirect/WiFiDirectPeer.cs | 42 +++++++++++++++------- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/packaging/csapi-network-wifi-direct.spec b/packaging/csapi-network-wifi-direct.spec index e90996a..7c8dcc3 100644 --- a/packaging/csapi-network-wifi-direct.spec +++ b/packaging/csapi-network-wifi-direct.spec @@ -1,6 +1,6 @@ Name: csapi-network-wifi-direct Summary: Tizen Wi-Fi Direct API for C# -Version: 1.0.2 +Version: 1.0.3 Release: 1 Group: Development/Libraries License: Apache-2.0 diff --git a/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs b/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs index ac9afc1..3f68798 100644 --- a/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs +++ b/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs @@ -219,6 +219,8 @@ internal static partial class Interop internal static extern int GetDisplayPort(string address, out int port); [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_display_throughput")] internal static extern int GetDisplayThroughput(string address, out int throughput); + [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_rssi")] + internal static extern int GetRssi(string address, out int rssi); [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_session_timer")] internal static extern int GetSessionTimer(out int seconds); [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_session_timer")] diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs index 10e2862..6112ce4 100644 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs +++ b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs @@ -40,9 +40,6 @@ namespace Tizen.Network.WiFiDirect [MarshalAsAttribute(UnmanagedType.I1)] internal bool _isGroupOwner; - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isPersistentGroupOwner; - internal WiFiDirectPrimaryDeviceType _primaryType; internal WiFiDirectSecondaryDeviceType _secondaryType; @@ -103,7 +100,6 @@ namespace Tizen.Network.WiFiDirect resultPeer._peerChannel = peer._channel; resultPeer._isPeerConnected = peer._isConnected; resultPeer._isPeerGroupOwner = peer._isGroupOwner; - resultPeer._isPeerPersistentGroupOwner = peer._isPersistentGroupOwner; resultPeer._peerPrimaryType = peer._primaryType; resultPeer._peerSecondaryType = peer._secondaryType; resultPeer._peerWpsTypes = peer._wpsTypes; diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs index a97e466..aebf2a6 100644 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs +++ b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs @@ -44,7 +44,6 @@ namespace Tizen.Network.WiFiDirect internal int _peerChannel; internal bool _isPeerConnected; internal bool _isPeerGroupOwner; - internal bool _isPeerPersistentGroupOwner; internal bool _peerP2PSupport; internal WiFiDirectPrimaryDeviceType _peerPrimaryType; internal WiFiDirectSecondaryDeviceType _peerSecondaryType; @@ -136,17 +135,6 @@ namespace Tizen.Network.WiFiDirect } /// - /// Persistent group state of the peer device. - /// - public bool IsPersistentGroupOwner - { - get - { - return _isPeerPersistentGroupOwner; - } - } - - /// /// P2P state of the peer device. /// public bool P2PSupport @@ -388,6 +376,36 @@ namespace Tizen.Network.WiFiDirect } /// + /// WiFi RSSI value of the peer device. + /// + /// + /// Wi-Fi Direct must be activated. + /// If there is any error, -1 will be returned. + /// + public int Rssi + { + get + { + if (Globals.IsActivated) + { + int rssi; + int ret = Interop.WiFiDirect.GetRssi(_peerMacAddress, out rssi); + if (ret != (int)WiFiDirectError.None) + { + Log.Error(Globals.LogTag, "Failed to get the peer RSSI, Error - " + (WiFiDirectError)ret); + return -1; + } + + return rssi; + } + + else + { + return -1; + } + } + } + /// /// (event) ConnectionStateChanged event is raised when the connection state of the peer device changes. /// public event EventHandler ConnectionStateChanged -- 2.7.4