2 * Copyright (c) 2011 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.
17 #ifndef __TIZEN_NETWORK_CONNECTION_PROFILE_H__
18 #define __TIZEN_NETWORK_CONNECTION_PROFILE_H__
27 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
32 * @brief Security type of Wi-Fi
36 CONNECTION_WIFI_SECURITY_TYPE_NONE = 0, /**< Security disabled */
37 CONNECTION_WIFI_SECURITY_TYPE_WEP = 1, /**< WEP */
38 CONNECTION_WIFI_SECURITY_TYPE_WPA_PSK = 2, /**< WPA-PSK */
39 CONNECTION_WIFI_SECURITY_TYPE_WPA2_PSK = 3, /**< WPA2-PSK */
40 CONNECTION_WIFI_SECURITY_TYPE_EAP = 4, /**< EAP */
41 } connection_wifi_security_type_e;
44 * @brief Below encryption modes are used in infrastructure and ad-hoc mode
48 CONNECTION_WIFI_ENCRYPTION_TYPE_NONE = 0, /**< Encryption disabled */
49 CONNECTION_WIFI_ENCRYPTION_TYPE_WEP = 1, /**< WEP */
50 CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP = 2, /**< TKIP */
51 CONNECTION_WIFI_ENCRYPTION_TYPE_AES = 3, /**< AES */
52 CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED = 4, /**< TKIP and AES are both supported */
53 } connection_wifi_encryption_type_e;
61 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
66 * @brief This enumeration defines the cellular protocol type.
70 CONNECTION_CELLULAR_NETWORK_TYPE_UNKNOWN = 0, /**< Not defined */
71 CONNECTION_CELLULAR_NETWORK_TYPE_GPRS = 1, /**< GPRS type */
72 CONNECTION_CELLULAR_NETWORK_TYPE_EDGE = 2, /**< EDGE type */
73 CONNECTION_CELLULAR_NETWORK_TYPE_UMTS = 3, /**< UMTS type */
74 } connection_cellular_network_type_e;
77 * @breif This enum indicates cellular service type
81 CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN = 0, /**< Unknown */
82 CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET = 1, /**< Established for Internet */
83 CONNECTION_CELLULAR_SERVICE_TYPE_MMS = 2, /**< Established for MMS */
84 CONNECTION_CELLULAR_SERVICE_TYPE_WAP = 3, /**< Established for WAP */
85 CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET = 4, /**< Established for prepaid internet service */
86 CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS = 5, /**< Established for prepaid MMS service */
87 } connection_cellular_service_type_e;
90 * @brief Cellular Authentication Type
94 CONNECTION_CELLULAR_AUTH_TYPE_NONE = 0, /**< No authentication */
95 CONNECTION_CELLULAR_AUTH_TYPE_PAP = 1, /**< PAP authentication */
96 CONNECTION_CELLULAR_AUTH_TYPE_CHAP = 2, /**< CHAP authentication */
97 } connection_cellular_auth_type_e;
105 * @addtogroup CAPI_NETWORK_CONNECTION_PROFILE_MODULE
110 * @brief The handle of profile
112 typedef void* connection_profile_h;
115 * @brief This enumeration defines the profile state type.
119 CONNECTION_PROFILE_STATE_DISCONNECTED = 0, /**< Disconnected state */
120 CONNECTION_PROFILE_STATE_ASSOCIATION = 1, /**< Association state */
121 CONNECTION_PROFILE_STATE_CONFIGURATION = 2, /**< Configuration state */
122 CONNECTION_PROFILE_STATE_CONNECTED = 3, /**< Connected state */
123 } connection_profile_state_e;
126 * @brief Enumerations of Address family
130 CONNECTION_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
131 CONNECTION_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type */
132 } connection_address_family_e;
135 * @brief Net IP configuration Type
139 CONNECTION_IP_CONFIG_TYPE_NONE = 0, /**< Not defined */
140 CONNECTION_IP_CONFIG_TYPE_STATIC = 1, /**< Manual IP configuration */
141 CONNECTION_IP_CONFIG_TYPE_DYNAMIC = 2, /**< Config IP using DHCP client*/
142 CONNECTION_IP_CONFIG_TYPE_AUTO = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
143 CONNECTION_IP_CONFIG_TYPE_FIXED = 4, /**< Indicates an IP address that can not be modified */
144 } connection_ip_config_type_e;
147 * @brief This enumeration defines the proxy method type.
151 CONNECTION_PROXY_TYPE_DIRECT = 0, /**< Direct connection */
152 CONNECTION_PROXY_TYPE_AUTO = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
153 CONNECTION_PROXY_TYPE_MANUAL = 2, /**< Manual configuration */
154 } connection_proxy_type_e;
157 * @enum connection_profile_type_e
158 * @brief Enumerations of network connection type.
161 CONNECTION_PROFILE_TYPE_CELLULAR = 0, /**< Cellular type */
162 CONNECTION_PROFILE_TYPE_WIFI = 1, /**< Wi-Fi type */
163 CONNECTION_PROFILE_TYPE_ETHERNET = 2, /**< Ethernet type */
164 } connection_profile_type_e;
167 * @brief Creates the profile handle.
168 * @remarks @a profile must be released with connection_profile_destroy().
169 * @param[in] type The type of profile
170 * @param[out] profile The handle of the profile
171 * @return 0 on success, otherwise negative error value.
172 * @retval #CONNECTION_ERROR_NONE Successful
173 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
174 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
175 * @see connection_profile_destroy()
177 int connection_profile_create(connection_profile_type_e type, connection_profile_h* profile);
180 * @brief Destroys the profile handle.
181 * @param[out] connection The handle to the connection
182 * @return 0 on success, otherwise negative error value.
183 * @retval #CONNECTION_ERROR_NONE Successful
184 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
185 * @see connection_profile_create()
187 int connection_profile_destroy(connection_profile_h profile);
190 * @brief Clons the profile handle.
191 * @remarks @a cloned_profile must be released with connection_profile_destroy().
192 * @param[in] origin_profile The handle of origin profile
193 * @param[out] cloned_profile The handle of cloned profile
194 * @return 0 on success, otherwise negative error value.
195 * @retval #CONNECTION_ERROR_NONE Successful
196 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
197 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
198 * @see connection_profile_destroy()
200 int connection_profile_clone(connection_profile_h* cloned_profile, connection_profile_h origin_profile);
203 * @brief Gets the profile name.
204 * @remarks @a profile_name must be released with free() by you.
205 * @param[in] profile The handle of profile
206 * @param[out] profile_name The name of profile
207 * @return 0 on success, otherwise negative error value.
208 * @retval #CONNECTION_ERROR_NONE Successful
209 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
210 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
212 int connection_profile_get_name(connection_profile_h profile, char** profile_name);
215 * @brief Gets the network type.
216 * @param[in] profile The handle of profile
217 * @param[out] type The type of profile
218 * @return 0 on success, otherwise negative error value.
219 * @retval #CONNECTION_ERROR_NONE Successful
220 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
221 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
223 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e* type);
226 * @brief Gets the name of network interface. For example, eth0 and pdp0.
227 * @remarks @a interface_name must be released with free() by you.
228 * @param[in] profile The handle of profile
229 * @param[out] interface_name The name of network interface
230 * @return 0 on success, otherwise negative error value.
231 * @retval #CONNECTION_ERROR_NONE Successful
232 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
233 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
235 int connection_profile_get_network_interface_name(connection_profile_h profile, char** interface_name);
238 * @brief Gets the network type.
239 * @param[in] profile The handle of profile
240 * @param[out] state The state of profile
241 * @return 0 on success, otherwise negative error value.
242 * @retval #CONNECTION_ERROR_NONE Successful
243 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
244 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
246 int connection_profile_get_state(connection_profile_h profile, connection_profile_state_e* state);
249 * @brief Gets the IP config type.
250 * @param[in] profile The handle of profile
251 * @param[in] address_family The address family
252 * @param[out] type The type of IP config
253 * @return 0 on success, otherwise negative error value.
254 * @retval #CONNECTION_ERROR_NONE Successful
255 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
256 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
258 int connection_profile_get_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e* type);
261 * @brief Gets the IP address.
262 * @remarks @a ip_address must be released with free() by you.
263 * @param[in] profile The handle of profile
264 * @param[in] address_family The address family
265 * @param[out] ip_address The IP address
266 * @return 0 on success, otherwise negative error value.
267 * @retval #CONNECTION_ERROR_NONE Successful
268 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
269 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
270 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
271 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
273 int connection_profile_get_ip_address(connection_profile_h profile, connection_address_family_e address_family, char** ip_address);
276 * @brief Gets the Subnet Mask.
277 * @remarks @a subnet_mask must be released with free() by you.
278 * @param[in] profile The handle of profile
279 * @param[in] address_family The address family
280 * @param[out] subnet_mask The subnet mask
281 * @return 0 on success, otherwise negative error value.
282 * @retval #CONNECTION_ERROR_NONE Successful
283 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
284 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
285 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
286 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
288 int connection_profile_get_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, char** subnet_mask);
291 * @brief Gets the Gateway address.
292 * @remarks @a gateway_address must be released with free() by you.
293 * @param[in] profile The handle of profile
294 * @param[in] address_family The address family
295 * @param[out] gateway_address The gateway address
296 * @return 0 on success, otherwise negative error value.
297 * @retval #CONNECTION_ERROR_NONE Successful
298 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
299 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
300 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
301 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
303 int connection_profile_get_gateway_address(connection_profile_h profile, connection_address_family_e address_family, char** gateway_address);
306 * @brief Gets the DNS address.
307 * @remarks The allowance of DNS address is 2. @a dns_address must be released with free() by you.
308 * @param[in] profile The handle of profile
309 * @param[in] order The order of DNS address. It starts from 1, which means first DNS address.
310 * @param[in] address_family The address family
311 * @param[out] dns_address The DNS address
312 * @return 0 on success, otherwise negative error value.
313 * @retval #CONNECTION_ERROR_NONE Successful
314 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
315 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
316 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
317 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
319 int connection_profile_get_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, char** dns_address);
322 * @brief Gets the Proxy type.
323 * @param[in] profile The handle of profile
324 * @param[out] type The type of proxy
325 * @return 0 on success, otherwise negative error value.
326 * @retval #CONNECTION_ERROR_NONE Successful
327 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
328 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
330 int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e* type);
333 * @brief Gets the Proxy address.
334 * @remarks @a proxy_address must be released with free() by you.
335 * @param[in] profile The handle of profile
336 * @param[in] address_family The address family
337 * @param[out] proxy_address The proxy address
338 * @return 0 on success, otherwise negative error value.
339 * @retval #CONNECTION_ERROR_NONE Successful
340 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
341 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
342 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
343 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
345 int connection_profile_get_proxy_address(connection_profile_h profile, connection_address_family_e address_family, char** proxy_address);
348 * @brief Sets the IP config type.
349 * @param[in] profile The handle of profile
350 * @param[in] address_family The address family
351 * @param[in] type The type of IP config
352 * @return 0 on success, otherwise negative error value.
353 * @retval #CONNECTION_ERROR_NONE Successful
354 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
355 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
357 int connection_profile_set_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e type);
360 * @brief Sets the IP address.
361 * @param[in] profile The handle of profile
362 * @param[in] address_family The address family
363 * @param[in] ip_address The IP address
364 * @return 0 on success, otherwise negative error value.
365 * @retval #CONNECTION_ERROR_NONE Successful
366 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
367 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
368 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
370 int connection_profile_set_ip_address(connection_profile_h profile, connection_address_family_e address_family, const char* ip_address);
373 * @brief Sets the Subnet Mask.
374 * @param[in] profile The handle of profile
375 * @param[in] address_family The address family
376 * @param[in] subnet_mask The subnet mask
377 * @return 0 on success, otherwise negative error value.
378 * @retval #CONNECTION_ERROR_NONE Successful
379 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
380 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
381 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
383 int connection_profile_set_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, const char* subnet_mask);
386 * @brief Sets the Gateway address.
387 * @param[in] profile The handle of profile
388 * @param[in] address_family The address family
389 * @param[in] gateway_address The gateway address
390 * @return 0 on success, otherwise negative error value.
391 * @retval #CONNECTION_ERROR_NONE Successful
392 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
393 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
394 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
396 int connection_profile_set_gateway_address(connection_profile_h profile, connection_address_family_e address_family, const char* gateway_address);
399 * @brief Sets the DNS address.
400 * @remarks The allowance of DNS address is 2.
401 * @param[in] profile The handle of profile
402 * @param[in] order The order of DNS address. It starts from 1, which means first DNS address.
403 * @param[in] address_family The address family
404 * @param[in] dns_address The DNS address
405 * @return 0 on success, otherwise negative error value.
406 * @retval #CONNECTION_ERROR_NONE Successful
407 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
408 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
409 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
411 int connection_profile_set_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, const char* dns_address);
414 * @brief Sets the Proxy type.
415 * @param[in] profile The handle of profile
416 * @param[in] type The type of proxy
417 * @return 0 on success, otherwise negative error value.
418 * @retval #CONNECTION_ERROR_NONE Successful
419 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
420 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
422 int connection_profile_set_proxy_type(connection_profile_h profile, connection_proxy_type_e type);
425 * @brief Sets the Proxy address.
426 * @param[in] profile The handle of profile
427 * @param[in] address_family The address family
428 * @param[in] gateway_address The gateway address
429 * @return 0 on success, otherwise negative error value.
430 * @retval #CONNECTION_ERROR_NONE Successful
431 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
432 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
433 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
435 int connection_profile_set_proxy_address(connection_profile_h profile, connection_address_family_e address_family, const char* proxy_address);
438 * @brief Called when the state of profile is changed.
439 * @param[in] profile The handle of profile
440 * @param[in] is_requested Indicates whether this change is requested or not
441 * @param[in] user_data The user data passed from the callback registration function
442 * @see connection_profile_set_state_changed_cb()
443 * @see connection_profile_unset_state_changed_cb()
445 typedef void(*connection_profile_state_changed_cb)(connection_profile_h profile, bool is_requested, void* user_data);
448 * @brief Registers the callback called when the state of profile is changed.
449 * @param[in] profile The handle of profile
450 * @param[in] callback The callback function to be called
451 * @param[in] user_data The user data passed to the callback function
452 * @return 0 on success, otherwise negative error value.
453 * @retval #CONNECTION_ERROR_NONE Successful
454 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
455 * @see connection_profile_state_changed_cb()
456 * @see connection_profile_unset_state_changed_cb()
457 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
459 int connection_profile_set_state_changed_cb(connection_profile_h profile, connection_profile_state_changed_cb callback, void* user_data);
462 * @brief Unregisters the callback called when the state of profile is changed.
463 * @param[in] profile The handle of profile
464 * @return 0 on success, otherwise negative error value.
465 * @retval #CONNECTION_ERROR_NONE Successful
466 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
467 * @see connection_profile_state_changed_cb()
468 * @see connection_profile_set_state_changed_cb()
470 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
478 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
483 * @brief Gets the ESSID(Extended Service Set Identifier).
484 * @remarks @a essid must be released with free() by you.
485 * @param[in] profile The handle of profile
486 * @param[out] essid The ESSID
487 * @return 0 on success, otherwise negative error value.
488 * @retval #CONNECTION_ERROR_NONE Successful
489 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
490 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
492 int connection_profile_get_wifi_essid(connection_profile_h profile, char** essid);
495 * @brief Gets the BSSID(Basic Service Set Identifier).
496 * @remarks @a bssid must be released with free() by you.
497 * @param[in] profile The handle of profile
498 * @param[out] bssid The BSSID
499 * @return 0 on success, otherwise negative error value.
500 * @retval #CONNECTION_ERROR_NONE Successful
501 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
502 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
504 int connection_profile_get_wifi_bssid(connection_profile_h profile, char** bssid);
507 * @brief Gets the RSSI.
508 * @param[in] profile The handle of profile
509 * @param[out] rssi The RSSI
510 * @return 0 on success, otherwise negative error value.
511 * @retval #CONNECTION_ERROR_NONE Successful
512 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
514 int connection_profile_get_wifi_rssi(connection_profile_h profile, int* rssi);
517 * @brief Gets the frequency (MHz).
518 * @param[in] profile The handle of profile
519 * @param[out] frequency The frequency
520 * @return 0 on success, otherwise negative error value.
521 * @retval #CONNECTION_ERROR_NONE Successful
522 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
524 int connection_profile_get_wifi_frequency(connection_profile_h profile, int* frequency);
527 * @brief Gets the max speed (Mbps).
528 * @param[in] profile The handle of profile
529 * @param[out] max_speed The max speed
530 * @return 0 on success, otherwise negative error value.
531 * @retval #CONNECTION_ERROR_NONE Successful
532 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
534 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int* max_speed);
537 * @brief Gets the security mode of Wi-Fi.
538 * @param[in] profile The handle of profile
539 * @param[out] type The type of Wi-Fi security
540 * @return 0 on success, otherwise negative error value.
541 * @retval #CONNECTION_ERROR_NONE Successful
542 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
543 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
545 int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e* type);
548 * @brief Gets the security mode of Wi-Fi.
549 * @param[in] profile The handle of profile
550 * @param[out] type The type of Wi-Fi security
551 * @return 0 on success, otherwise negative error value.
552 * @retval #CONNECTION_ERROR_NONE Successful
553 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
554 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
556 int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e* type);
559 * @brief Checks whether passphrase is required.
560 * @param[in] profile The handle of profile
561 * @param[out] required Indicates whether passphrase is required or not
562 * @return 0 on success, otherwise negative error value.
563 * @retval #CONNECTION_ERROR_NONE Successful
564 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
566 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile, bool* required);
569 * @brief Sets the passphrase of Wi-Fi WPA.
570 * @param[in] profile The handle of profile
571 * @param[in] passphrase The passphrase of Wi-Fi security
572 * @return 0 on success, otherwise negative error value.
573 * @retval #CONNECTION_ERROR_NONE Successful
574 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
576 int connection_profile_set_wifi_passphrase(connection_profile_h profile, const char* passphrase);
579 * @brief Checks whether WPS(Wi-Fi Protected Setup) is supported.
580 * @remarks If WPS is supported, you can connect access point with WPS by wifi_connect_with_wps().
581 * @param[in] profile The handle of profile
582 * @param[out] supported Indicates whether WPS is supported or not
583 * @return 0 on success, otherwise negative error value.
584 * @retval #CONNECTION_ERROR_NONE Successful
585 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
587 int connection_profile_is_wifi_wps_supported(connection_profile_h profile, bool* supported);
595 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
600 * @brief Gets the cellular network type.
601 * @param[in] profile The handle of profile
602 * @param[out] type The type of cellular
603 * @return 0 on success, otherwise negative error value.
604 * @retval #CONNECTION_ERROR_NONE Successful
605 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
606 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
608 int connection_profile_get_cellular_network_type(connection_profile_h profile, connection_cellular_network_type_e* type);
611 * @brief Gets the service type.
612 * @param[in] profile The handle of profile
613 * @param[out] type The type of cellular service
614 * @return 0 on success, otherwise negative error value.
615 * @retval #CONNECTION_ERROR_NONE Successful
616 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
617 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
619 int connection_profile_get_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e* type);
622 * @brief Gets the APN(access point name).
623 * @remarks @a apn must be released with free() by you.
624 * @param[in] profile The handle of profile
625 * @param[out] apn The name of APN
626 * @return 0 on success, otherwise negative error value.
627 * @retval #CONNECTION_ERROR_NONE Successful
628 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
629 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
631 int connection_profile_get_cellular_apn(connection_profile_h profile, char** apn);
634 * @brief Gets the authentication information.
635 * @remarks @a user_name and @a password must be released with free() by you.
636 * @param[in] profile The handle of profile
637 * @param[out] type The type of authentication
638 * @param[out] user_name The user name
639 * @param[out] password The password
640 * @return 0 on success, otherwise negative error value.
641 * @retval #CONNECTION_ERROR_NONE Successful
642 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
643 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
644 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
646 int connection_profile_get_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e* type, char** user_name, char** password);
649 * @brief Gets the home URL.
650 * @remarks @a home_url must be released with free() by you.
651 * @param[in] profile The handle of profile
652 * @param[out] home_url The home URL
653 * @return 0 on success, otherwise negative error value.
654 * @retval #CONNECTION_ERROR_NONE Successful
655 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
656 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
658 int connection_profile_get_cellular_home_url(connection_profile_h profile, char** home_url);
661 * @brief Gets the state of roaming.
662 * @param[in] profile The handle of profile
663 * @param[out] is_roaming Indicates whether cellular is in roaming or not
664 * @return 0 on success, otherwise negative error value.
665 * @retval #CONNECTION_ERROR_NONE Successful
666 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
668 int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming);
671 * @brief Sets the service type.
672 * @param[in] profile The handle of profile
673 * @param[out] type The type of cellular service
674 * @return 0 on success, otherwise negative error value.
675 * @retval #CONNECTION_ERROR_NONE Successful
676 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
678 int connection_profile_set_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e service_type);
681 * @brief Sets the APN(Access Point Name).
682 * @param[in] profile The handle of profile
683 * @param[out] apn The name of APN
684 * @return 0 on success, otherwise negative error value.
685 * @retval #CONNECTION_ERROR_NONE Successful
686 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
688 int connection_profile_set_cellular_apn(connection_profile_h profile, const char* apn);
691 * @brief Sets the Athentication information.
692 * @param[in] profile The handle of profile
693 * @param[out] type The type of authentication
694 * @param[out] user_name The user name
695 * @param[out] password The password
696 * @return 0 on success, otherwise negative error value.
697 * @retval #CONNECTION_ERROR_NONE Successful
698 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
700 int connection_profile_set_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e type, const char* user_name, const char* password);
703 * @brief Sets the home URL.
704 * @param[in] profile The handle of profile
705 * @param[out] home_url The home URL
706 * @return 0 on success, otherwise negative error value.
707 * @retval #CONNECTION_ERROR_NONE Successful
708 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
710 int connection_profile_set_cellular_home_url(connection_profile_h profile, const char* home_url);
722 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */