Class ConnectionManager
Definition
- Namespace:
- Tizen.Network.Connection
- Assembly:
- Tizen.Network.Connection.dll
This is the ConnectionManager class. It provides functions to manage data connections.
public static class ConnectionManager
- Inheritance
-
objectConnection
Manager
Properties
View SourceBluetoothState
The state of the Bluetooth connection.
Declaration
public static ConnectionState BluetoothState { get; }
Property Value
Type | Description |
---|---|
Connection |
Bluetooth connection state. |
CellularState
The state of the cellular connection.
Declaration
public static CellularState CellularState { get; }
Property Value
Type | Description |
---|---|
Cellular |
Cellular network state. |
CurrentConnection
The type and state of the current profile for data connection.
Declaration
public static ConnectionItem CurrentConnection { get; }
Property Value
Type | Description |
---|---|
Connection |
Instance of ConnectionItem. |
EthernetCableState
Checks if the ethernet cable is attached or not.
Declaration
public static EthernetCableState EthernetCableState { get; }
Property Value
Type | Description |
---|---|
Ethernet |
Ethernet cable state. |
EthernetState
The Ethernet connection state.
Declaration
public static ConnectionState EthernetState { get; }
Property Value
Type | Description |
---|---|
Connection |
Ethernet connection state. |
WiFiState
The state of the Wi-Fi connection.
Declaration
public static ConnectionState WiFiState { get; }
Property Value
Type | Description |
---|---|
Connection |
WiFi connection state. |
Methods
View SourceAddRoute(AddressFamily, string, IPAddress, IPAddress)
Adds a route to the routing table.
Declaration
public static void AddRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type | Name | Description |
---|---|---|
Address |
family | The address family. |
string | interfaceName | The name of the network interface. |
System. |
hostAddress | The IP address of the host. |
System. |
gateway | The gateway address. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when an interfaceName or a hostAddress or a gateway is null. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
CreateCellularProfile(ConnectionProfileType, string)
Creates a cellular profile handle.
Declaration
public static CellularProfile CreateCellularProfile(ConnectionProfileType type, string keyword)
Parameters
Type | Name | Description |
---|---|---|
Connection |
type | The type of profile. Cellular profile type is supported. |
string | keyword | The keyword included in profile name. |
Returns
Type | Description |
---|---|
Cellular |
CellularProfile object. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when a keyword value is null. |
System. |
Thrown when a method fails due to invalid operation. |
GetAllIPv6Addresses(ConnectionType)
Gets all the IPv6 addresses of the current connection.
Declaration
public static IEnumerable<IPAddress> GetAllIPv6Addresses(ConnectionType type)
Parameters
Type | Name | Description |
---|---|---|
Connection |
type | The type of current network connection. |
Returns
Type | Description |
---|---|
System. |
A list of IPv6 addresses of the connection. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetIPAddress(AddressFamily)
Gets the IP address of the current connection.
Declaration
public static IPAddress GetIPAddress(AddressFamily family)
Parameters
Type | Name | Description |
---|---|---|
Address |
family | The address family. |
Returns
Type | Description |
---|---|
System. |
IP address of the connection (global address in case of IPv6). |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetMacAddress(ConnectionType)
Gets the MAC address of the Wi-Fi or ethernet.
Declaration
public static string GetMacAddress(ConnectionType type)
Parameters
Type | Name | Description |
---|---|---|
Connection |
type | The type of current network connection. |
Returns
Type | Description |
---|---|
string | MAC address of the Wi-Fi or ethernet. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when value is an invalid parameter. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetProxy(AddressFamily)
Gets the proxy address of the current connection.
Declaration
public static string GetProxy(AddressFamily family)
Parameters
Type | Name | Description |
---|---|---|
Address |
family | The address family. |
Returns
Type | Description |
---|---|
string | Proxy address of the connection. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetStatistics(ConnectionType, StatisticsType)
Gets the statistics information.
Declaration
public static long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type | Name | Description |
---|---|---|
Connection |
connectionType | The type of connection (only WiFi and Cellular are supported). |
Statistics |
statisticsType | The type of statistics. |
Returns
Type | Description |
---|---|
long | The statistics information associated with statisticsType. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when value is an invalid parameter. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to invalid operation. |
RemoveRoute(AddressFamily, string, IPAddress, IPAddress)
Removes a route from the routing table.
Declaration
public static void RemoveRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type | Name | Description |
---|---|---|
Address |
family | The address family. |
string | interfaceName | The name of network interface. |
System. |
hostAddress | The IP address of the host. |
System. |
gateway | The gateway address. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when an interfaceName or a hostAddress or a gateway is null. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
ResetStatistics(ConnectionType, StatisticsType)
Resets the statistics information.
Declaration
public static void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type | Name | Description |
---|---|---|
Connection |
connectionType | The type of connection (only WiFi and Cellular are supported). |
Statistics |
statisticsType | The type of statistics. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
System. |
Thrown when a value is an invalid parameter. |
System. |
Thrown when memory is not enough to continue execution. |
System. |
Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
Events
View SourceConnectionTypeChanged
An event is called when the type of the current connection is changed.
Declaration
public static event EventHandler<ConnectionTypeEventArgs> ConnectionTypeChanged
Event Type
Type | Description |
---|---|
System. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
EthernetCableStateChanged
An event for the ethernet cable is plugged [in/out] event.
Declaration
public static event EventHandler<EthernetCableStateEventArgs> EthernetCableStateChanged
Event Type
Type | Description |
---|---|
System. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
IPAddressChanged
An event is called when the IP address is changed.
Declaration
public static event EventHandler<AddressEventArgs> IPAddressChanged
Event Type
Type | Description |
---|---|
System. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |
ProxyAddressChanged
An event is called when the proxy address is changed.
Declaration
public static event EventHandler<AddressEventArgs> ProxyAddressChanged
Event Type
Type | Description |
---|---|
System. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when a feature is not supported. |
System. |
Thrown when a permission is denied. |