Class ConnectionStatusChangedEventArgs
Definition
- Namespace:
- Tizen.Network.WiFiDirect
- Assembly:
- Tizen.Network.WiFiDirect.dll
An extended EventArgs class which contains the changed connection state during disconnecting of all peers or grouping related operations. This event is triggered for global connection status changes that affect the entire Wi-Fi Direct group or all connected peers.
public class ConnectionStatusChangedEventArgs : EventArgs
- Inheritance
-
objectSystem.EventArgsConnectionStatusChangedEventArgs
Remarks
This event is raised by the ConnectionStatusChanged event. Use this event to monitor global connection status changes such as:
- Group creation and destruction
- Disconnection of all peers
- Group owner changes
- Auto-group removal events
Example usage:
WiFiDirectManager.ConnectionStatusChanged += (sender, e) =>
{
if (e.Error == WiFiDirectError.None)
{
switch (e.ConnectionState)
{
case WiFiDirectConnectionState.GroupCreated:
Console.WriteLine("Wi-Fi Direct group created successfully");
break;
case WiFiDirectConnectionState.GroupDestroyed:
Console.WriteLine("Wi-Fi Direct group destroyed");
break;
case WiFiDirectConnectionState.DisconnectionInd:
Console.WriteLine("All peers disconnected");
break;
}
}
else
{
Console.WriteLine($"Connection status error: {e.Error}");
}
};
Properties
View SourceConnectionState
The global connection state. Represents the overall connection status affecting the Wi-Fi Direct group or all peers.
Declaration
public WiFiDirectConnectionState ConnectionState { get; }
Property Value
| Type | Description |
|---|---|
| WiFiDirectConnectionState | A WiFiDirectConnectionState enum value indicating the global connection state. |
Remarks
This event is raised by the ConnectionStatusChanged event. Use this event to monitor global connection status changes such as:
- Group creation and destruction
- Disconnection of all peers
- Group owner changes
- Auto-group removal events
Example usage:
WiFiDirectManager.ConnectionStatusChanged += (sender, e) =>
{
if (e.Error == WiFiDirectError.None)
{
switch (e.ConnectionState)
{
case WiFiDirectConnectionState.GroupCreated:
Console.WriteLine("Wi-Fi Direct group created successfully");
break;
case WiFiDirectConnectionState.GroupDestroyed:
Console.WriteLine("Wi-Fi Direct group destroyed");
break;
case WiFiDirectConnectionState.DisconnectionInd:
Console.WriteLine("All peers disconnected");
break;
}
}
else
{
Console.WriteLine($"Connection status error: {e.Error}");
}
};
Error
The Wi-Fi Direct operation result. Indicates whether the connection status change was successful or if an error occurred.
Declaration
public WiFiDirectError Error { get; }
Property Value
| Type | Description |
|---|---|
| WiFiDirectError | None if successful, otherwise the specific error code. |
Remarks
This event is raised by the ConnectionStatusChanged event. Use this event to monitor global connection status changes such as:
- Group creation and destruction
- Disconnection of all peers
- Group owner changes
- Auto-group removal events
Example usage:
WiFiDirectManager.ConnectionStatusChanged += (sender, e) =>
{
if (e.Error == WiFiDirectError.None)
{
switch (e.ConnectionState)
{
case WiFiDirectConnectionState.GroupCreated:
Console.WriteLine("Wi-Fi Direct group created successfully");
break;
case WiFiDirectConnectionState.GroupDestroyed:
Console.WriteLine("Wi-Fi Direct group destroyed");
break;
case WiFiDirectConnectionState.DisconnectionInd:
Console.WriteLine("All peers disconnected");
break;
}
}
else
{
Console.WriteLine($"Connection status error: {e.Error}");
}
};