2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
21 using Tizen.Internals.Errors;
24 namespace Tizen.Network.Connection
27 /// Enumeration for connection type.
29 public enum ConnectionType
31 Disconnected = 0, /**< Disconnected */
32 WiFi = 1, /**< Wi-Fi type */
33 Cellular = 2, /**< Cellular type */
34 Ethernet = 3, /**< Ethernet type */
35 Bluetooth = 4, /**< Bluetooth type */
36 NetProxy = 5 /**< Proxy type for internet connection (Since 3.0) */
40 /// Enumeration for address family.
42 public enum AddressFamily
49 /// Enumeration for cellular network state.
51 public enum CellularState
53 OutOfService = 0, /**< Out of service */
54 FlightMode = 1, /**< Flight mode */
55 RoamingOff = 2, /**< Roaming is turned off */
56 CallOnlyAvailable = 3, /**< Call is only available */
57 Available = 4, /**< Available but not connected yet */
58 Connected = 5, /**< Connected */
62 /// Enumeration for connection state.
64 public enum ConnectionState
66 Deactivated = 0, /**< Deactivated */
67 Disconnected = 1, /**< Disconnected */
68 Connected = 2, /**< Connected */
72 /// This enumeration defines the attached or detached state of ethernet cable.
74 public enum EthernetCableState
76 Detached = 0, /**< Ethernet cable is detached */
77 Attached = 1, /**< Ethernet cable is attached */
81 /// Enumeration for network connection type.
83 public enum ConnectionProfileType
85 Cellular = 0, /**< Cellular type */
86 WiFi = 1, /**< Wi-Fi type */
87 Ethernet = 2, /**< Ethernet type */
88 Bt = 3, /**< Bluetooth type */
92 /// Enumeration for profile state type.
94 public enum ProfileState
96 Disconnected = 0, /**< Disconnected state */
97 Association = 1, /**< Association state */
98 Configuration = 2, /**< Configuration state */
99 Connected = 3, /**< Connected state */
103 /// Enumeration for proxy method type.
105 public enum ProxyType
107 Direct = 0, /**< Direct connection */
108 Auto = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
109 Manual = 2, /**< Manual configuration */
113 /// Enumeration for IP configuration type.
115 public enum IpConfigType
117 None = 0, /**< Not defined */
118 Static = 1, /**< Manual IP configuration */
119 Dynamic = 2, /**< Config IP using DHCP client*/
120 Auto = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
121 Fixed = 4, /**< Indicates an IP address that can not be modified */
125 /// Enumeration for cellular service type.
127 public enum CellularServiceType
129 Unknown = 0, /**< Unknown */
130 Internet = 1, /**< Internet */
132 PrepaidInternet = 3, /**< Prepaid internet */
133 PrepaidMMS = 4, /**< Prepaid MMS */
134 Tethering = 5, /**< Tethering */
135 Application = 6, /**< Specific application */
138 static internal class ConnectionErrorValue
140 internal const int Base = -0x01C10000;
145 /// Enumeration for connection errors.
147 // To do : have to assign valid error code
148 public enum ConnectionError
150 None = ErrorCode.None, /**< Successful */
151 InvalidParameter = ErrorCode.InvalidParameter, /**< Invalid parameter */
152 OutOfMemoryError = ErrorCode.OutOfMemory, /**< Out of memory error */
153 InvalidOperation = ErrorCode.InvalidOperation, /**< Invalid Operation */
154 AddressFamilyNotSupported = ErrorCode.AddressFamilyNotSupported, /**< Address family not supported */
155 OperationFailed = ConnectionErrorValue.Base | 0x0401, /**< Operation failed */
156 EndOfIteration = ConnectionErrorValue.Base | 0x0402, /**< End of iteration */
157 NoConnection = ConnectionErrorValue.Base | 0x0403, /**< There is no connection */
158 NowInProgress = ErrorCode.NowInProgress, /** Now in progress */
159 AlreadyExists = ConnectionErrorValue.Base | 0x0404, /**< Already exists */
160 OperationAborted = ConnectionErrorValue.Base | 0x0405, /**< Operation is aborted */
161 DhcpFailed = ConnectionErrorValue.Base | 0x0406, /**< DHCP failed */
162 InvalidKey = ConnectionErrorValue.Base | 0x0407, /**< Invalid key */
163 NoReply = ConnectionErrorValue.Base | 0x0408, /**< No reply */
164 PermissionDenied = ErrorCode.PermissionDenied, /**< Permission denied */
165 NotSupported = ErrorCode.NotSupported /**< Not Supported */
169 /// Enumeration for profile list type.
171 public enum ProfileListType
173 Registered = 0, /**< The iterator of the registered profile */
174 Connected = 1, /**< The iterator of the connected profile */
175 Default = 2, /**< The iterator of the default profile */
179 /// Enumeration for security type of Wi-Fi.
181 public enum WiFiSecureType
183 None = 0, /**< Security disabled */
185 WpaPsk = 2, /**< WPA-PSK */
186 Wpa2Psk = 3, /**< WPA2-PSK */
191 /// Enumeration for encryption modes.
193 public enum WiFiEncryptionType
195 None = 0, /**< Encryption disabled */
197 Tkip = 2, /**< TKIP */
199 TkipAesMixed = 4, /**< TKIP and AES are both supported */
203 /// Enumeration for connection profile state.
205 public enum ConnectionProfileState
207 Disconnected = 0, /**< Disconnected state */
208 Association = 1, /**< Association state */
209 Configuration = 2, /**< Configuration state */
210 Connected = 3, /**< Connected state */
214 /// Enumeration for cellular authentication type.
216 public enum CellularAuthType
218 None = 0, /**< No authentication */
219 Pap = 1, /**< PAP authentication */
220 Chap = 2, /**< CHAP authentication */
223 public enum AddressInformationType
229 static internal class Globals
231 internal const string LogTag = "Tizen.Network.Connection";