Class ConnectionManager

Definition

Namespace:
Tizen.Network.Connection
Assembly:
Tizen.Network.Connection.dll
API Level:
3

This is the ConnectionManager class. It provides functions to manage data connections.

C#
Copy
public static class ConnectionManager
Inheritance
System.Object
ConnectionManager

Properties

View Source

BluetoothState

The state of the Bluetooth connection.

Declaration
C#
Copy
public static ConnectionState BluetoothState { get; }
Property Value
Type Description
ConnectionState

Bluetooth connection state.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.tethering.bluetooth
View Source

CellularState

The state of the cellular connection.

Declaration
C#
Copy
public static CellularState CellularState { get; }
Property Value
Type Description
CellularState

Cellular network state.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

API Level: 3
Feature: http://tizen.org/feature/network.telephony
View Source

CurrentConnection

The type and state of the current profile for data connection.

Declaration
C#
Copy
public static ConnectionItem CurrentConnection { get; }
Property Value
Type Description
ConnectionItem

Instance of ConnectionItem.

API Level: 3
View Source

EthernetCableState

Checks if the ethernet cable is attached or not.

Declaration
C#
Copy
public static EthernetCableState EthernetCableState { get; }
Property Value
Type Description
EthernetCableState

Ethernet cable state.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernet
View Source

EthernetState

The Ethernet connection state.

Declaration
C#
Copy
public static ConnectionState EthernetState { get; }
Property Value
Type Description
ConnectionState

Ethernet connection state.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernet
View Source

WiFiState

The state of the Wi-Fi connection.

Declaration
C#
Copy
public static ConnectionState WiFiState { get; }
Property Value
Type Description
ConnectionState

WiFi connection state.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.wifi

Methods

View Source

AddRoute(AddressFamily, String, IPAddress, IPAddress)

Adds a route to the routing table.

Declaration
C#
Copy
public static void AddRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type Name Description
AddressFamily family

The address family.

System.String interfaceName

The name of the network interface.

System.Net.IPAddress hostAddress

The IP address of the host.

System.Net.IPAddress gateway

The gateway address.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

System.ArgumentNullException

Thrown when an interfaceName or a hostAddress or a gateway is null.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
View Source

CreateCellularProfile(ConnectionProfileType, String)

Creates a cellular profile handle.

Declaration
C#
Copy
public static CellularProfile CreateCellularProfile(ConnectionProfileType type, string keyword)
Parameters
Type Name Description
ConnectionProfileType type

The type of profile. Cellular profile type is supported.

System.String keyword

The keyword included in profile name.

Returns
Type Description
CellularProfile

CellularProfile object.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

System.ArgumentNullException

Thrown when a keyword value is null.

System.InvalidOperationException

Thrown when a method fails due to invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.wifi
View Source

GetAllIPv6Addresses(ConnectionType)

Gets all the IPv6 addresses of the current connection.

Declaration
C#
Copy
public static IEnumerable<IPAddress> GetAllIPv6Addresses(ConnectionType type)
Parameters
Type Name Description
ConnectionType type

The type of current network connection.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Net.IPAddress>

A list of IPv6 addresses of the connection.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

GetIPAddress(AddressFamily)

Gets the IP address of the current connection.

Declaration
C#
Copy
public static IPAddress GetIPAddress(AddressFamily family)
Parameters
Type Name Description
AddressFamily family

The address family.

Returns
Type Description
System.Net.IPAddress

IP address of the connection (global address in case of IPv6).

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

GetMacAddress(ConnectionType)

Gets the MAC address of the Wi-Fi or ethernet.

Declaration
C#
Copy
public static string GetMacAddress(ConnectionType type)
Parameters
Type Name Description
ConnectionType type

The type of current network connection.

Returns
Type Description
System.String

MAC address of the Wi-Fi or ethernet.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when value is an invalid parameter.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

GetProxy(AddressFamily)

Gets the proxy address of the current connection.

Declaration
C#
Copy
public static string GetProxy(AddressFamily family)
Parameters
Type Name Description
AddressFamily family

The address family.

Returns
Type Description
System.String

Proxy address of the connection.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

GetStatistics(ConnectionType, StatisticsType)

Gets the statistics information.

Declaration
C#
Copy
public static long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type Name Description
ConnectionType connectionType

The type of connection (only WiFi and Cellular are supported).

StatisticsType statisticsType

The type of statistics.

Returns
Type Description
System.Int64

The statistics information associated with statisticsType.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when value is an invalid parameter.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

RemoveRoute(AddressFamily, String, IPAddress, IPAddress)

Removes a route from the routing table.

Declaration
C#
Copy
public static void RemoveRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type Name Description
AddressFamily family

The address family.

System.String interfaceName

The name of network interface.

System.Net.IPAddress hostAddress

The IP address of the host.

System.Net.IPAddress gateway

The gateway address.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

System.ArgumentNullException

Thrown when an interfaceName or a hostAddress or a gateway is null.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
View Source

ResetStatistics(ConnectionType, StatisticsType)

Resets the statistics information.

Declaration
C#
Copy
public static void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type Name Description
ConnectionType connectionType

The type of connection (only WiFi and Cellular are supported).

StatisticsType statisticsType

The type of statistics.

Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

System.ArgumentException

Thrown when a value is an invalid parameter.

OutOfMemoryException

Thrown when memory is not enough to continue execution.

System.InvalidOperationException

Thrown when a connection instance is invalid or when a method fails due to an invalid operation.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.gethttp://tizen.org/privilege/network.set
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi

Events

View Source

ConnectionTypeChanged

An event is called when the type of the current connection is changed.

Declaration
C#
Copy
public static event EventHandler<ConnectionTypeEventArgs> ConnectionTypeChanged
Event Type
Type Description
System.EventHandler<ConnectionTypeEventArgs>
Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

EthernetCableStateChanged

An event for the ethernet cable is plugged [in/out] event.

Declaration
C#
Copy
public static event EventHandler<EthernetCableStateEventArgs> EthernetCableStateChanged
Event Type
Type Description
System.EventHandler<EthernetCableStateEventArgs>
Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernet
View Source

IPAddressChanged

An event is called when the IP address is changed.

Declaration
C#
Copy
public static event EventHandler<AddressEventArgs> IPAddressChanged
Event Type
Type Description
System.EventHandler<AddressEventArgs>
Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
View Source

ProxyAddressChanged

An event is called when the proxy address is changed.

Declaration
C#
Copy
public static event EventHandler<AddressEventArgs> ProxyAddressChanged
Event Type
Type Description
System.EventHandler<AddressEventArgs>
Exceptions
Type Condition
System.NotSupportedException

Thrown when a feature is not supported.

UnauthorizedAccessException

Thrown when a permission is denied.

API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi