Class WiFiDirectPeer

Definition

Namespace:
Tizen.Network.WiFiDirect
Assembly:
Tizen.Network.WiFiDirect.dll
API Level:
3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect

The WiFiDirectPeer class is used to handle the connection with remote devices using Wi-Fi Direct.

C#
Copy
public class WiFiDirectPeer
Inheritance
WiFiDirectPeer

Properties

View Source

Channel

The listening channel of the peer device.

Declaration
C#
Copy
public int Channel { get; }
Property Value
Type Description
System.Int32
API Level: 3
View Source

Display

The Wi-Fi display device type of the peer device.

Declaration
C#
Copy
public WiFiDirectDisplayType Display { get; }
Property Value
Type Description
WiFiDirectDisplayType
Remarks

Wi-Fi Direct must be activated. If there is any error, a default value of WiFiDirectDisplayType will be returned.

API Level: 3
View Source

DisplayAvailability

The Wi-Fi display session availability of the peer device.

Declaration
C#
Copy
public bool DisplayAvailability { get; }
Property Value
Type Description
System.Boolean
Remarks

Wi-Fi Direct must be activated. If there is any error, false will be returned.

API Level: 3
View Source

Hdcp

The HDCP information of the peer device.

Declaration
C#
Copy
public int Hdcp { get; }
Property Value
Type Description
System.Int32
Remarks

Wi-Fi Direct must be activated. If there is any error, -1 will be returned.

API Level: 3
View Source

InterfaceAddress

The Interface address of the peer device.

Declaration
C#
Copy
public string InterfaceAddress { get; }
Property Value
Type Description
System.String
API Level: 3
View Source

IpAddress

The IP address of the peer device.

Declaration
C#
Copy
public string IpAddress { get; }
Property Value
Type Description
System.String
API Level: 3
View Source

IsConnected

The connected state of the peer device.

Declaration
C#
Copy
public bool IsConnected { get; }
Property Value
Type Description
System.Boolean
API Level: 3
View Source

IsGroupOwner

The P2P group state of the peer device.

Declaration
C#
Copy
public bool IsGroupOwner { get; }
Property Value
Type Description
System.Boolean
API Level: 3
View Source

IsMiracastDevice

Checks if the peer device is a Wi-Fi display device.

Declaration
C#
Copy
public bool IsMiracastDevice { get; }
Property Value
Type Description
System.Boolean
API Level: 3
View Source

IsP2PInvitationSupported

The P2P invitation state of the peer device.

Declaration
C#
Copy
public bool IsP2PInvitationSupported { get; }
Property Value
Type Description
System.Boolean
API Level: 3
View Source

MacAddress

The MAC address of the peer device.

Declaration
C#
Copy
public string MacAddress { get; }
Property Value
Type Description
System.String
API Level: 3
View Source

Name

The name of the peer device.

Declaration
C#
Copy
public string Name { get; }
Property Value
Type Description
System.String
API Level: 3
View Source

P2PSupport

The P2P state of the peer device.

Declaration
C#
Copy
public bool P2PSupport { get; }
Property Value
Type Description
System.Boolean
API Level: 3
View Source

Port

The port of the connected peer device.

Declaration
C#
Copy
public int Port { get; }
Property Value
Type Description
System.Int32
Remarks

Wi-Fi Direct must be activated. If there is any error, -1 will be returned.

API Level: 3
View Source

PrimaryType

The primary catagory of the peer device.

Declaration
C#
Copy
public WiFiDirectPrimaryDeviceType PrimaryType { get; }
Property Value
Type Description
WiFiDirectPrimaryDeviceType
API Level: 3
View Source

Rssi

The Wi-Fi RSSI value of the peer device.

Declaration
C#
Copy
public int Rssi { get; }
Property Value
Type Description
System.Int32
Remarks

Wi-Fi Direct must be activated. If there is any error, -1 will be returned.

API Level: 3
View Source

SecondaryType

The sub category of the peer device.

Declaration
C#
Copy
public WiFiDirectSecondaryDeviceType SecondaryType { get; }
Property Value
Type Description
WiFiDirectSecondaryDeviceType
API Level: 3
View Source

ServiceCount

The number of registered services of the peer device.

Declaration
C#
Copy
public uint ServiceCount { get; }
Property Value
Type Description
System.UInt32
API Level: 3
View Source

ServiceList

The list of registered services of the peer device.

Declaration
C#
Copy
public IEnumerable<string> ServiceList { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.String>
API Level: 3
View Source

Throughput

The Wi-Fi display maximum throughput of the peer device.

Declaration
C#
Copy
public int Throughput { get; }
Property Value
Type Description
System.Int32
Remarks

Wi-Fi Direct must be activated. If there is any error, -1 will be returned.

API Level: 3
View Source

WpsTypes

The list of the supported WPS type of the peer device.

Declaration
C#
Copy
public int WpsTypes { get; }
Property Value
Type Description
System.Int32
API Level: 3

Methods

View Source

CancelConnection()

Cancels the connection now in progress.

Declaration
C#
Copy
public void CancelConnection()
Remarks

Wi-Fi Direct must be activated.

Exceptions
Type Condition
System.NotSupportedException

Thrown when the Wi-Fi Direct is not supported.

API Level: 3
View Source

CancelServiceDiscovery(WiFiDirectServiceType)

Stops the Wi-Fi Direct service discovery.

Declaration
C#
Copy
public void CancelServiceDiscovery(WiFiDirectServiceType type)
Parameters
Type Name Description
WiFiDirectServiceType type

The type of the service.

Remarks

Wi-Fi Direct must be activated.

Exceptions
Type Condition
System.NotSupportedException

Thrown during one of the following cases:

  1. When the Wi-Fi Direct is not supported.
  2. When the Wi-Fi Direct service discovery is not supported.
API Level: 3
View Source

Connect()

Connects to a specified remote device.

Declaration
C#
Copy
public void Connect()
Remarks

Wi-Fi Direct must be activated. If this succeeds, the ConnectionStateChanged event will be invoked.

Exceptions
Type Condition
System.NotSupportedException

Thrown when the Wi-Fi Direct is not supported

API Level: 3
View Source

Disconnect()

Disconnects the specified remote device.

Declaration
C#
Copy
public void Disconnect()
Remarks

Wi-Fi Direct must be activated. If this succeeds, the ConnectionStateChanged event will be invoked.

Exceptions
Type Condition
System.NotSupportedException

Thrown when the Wi-Fi Direct is not supported.

API Level: 3
View Source

SetAutoConnect()

Allows a device to connect automatically.

Declaration
C#
Copy
public void SetAutoConnect()
Remarks

Wi-Fi Direct must be activated.

Exceptions
Type Condition
System.NotSupportedException

Thrown when the Wi-Fi Direct is not supported.

API Level: 3
View Source

StartServiceDiscovery(WiFiDirectServiceType)

Starts the Wi-Fi Direct service discovery.

Declaration
C#
Copy
public void StartServiceDiscovery(WiFiDirectServiceType type)
Parameters
Type Name Description
WiFiDirectServiceType type

The type of the service.

Remarks

Wi-Fi Direct must be activated. If this succeeds, the ServiceStateChanged event will be invoked.

Exceptions
Type Condition
System.NotSupportedException

Thrown during one of the following cases:

  1. When the Wi-Fi Direct is not supported.
  2. When the Wi-Fi Direct service discovery is not supported.
API Level: 3

Events

View Source

ConnectionStateChanged

The ConnectionStateChanged event is raised when the connection state of the peer device changes.

Declaration
C#
Copy
public event EventHandler<ConnectionStateChangedEventArgs> ConnectionStateChanged
Event Type
Type Description
System.EventHandler<ConnectionStateChangedEventArgs>
API Level: 3
View Source

IpAddressAssigned

The IpAddressAssigned event is raised when the IP address of the peer device is assigned.

Declaration
C#
Copy
public event EventHandler<IpAddressAssignedEventArgs> IpAddressAssigned
Event Type
Type Description
System.EventHandler<IpAddressAssignedEventArgs>
API Level: 3
View Source

ServiceStateChanged

The ServiceStateChanged event is raised when the state of service discovery is changed.

Declaration
C#
Copy
public event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
Event Type
Type Description
System.EventHandler<ServiceStateChangedEventArgs>
API Level: 3