2 * Copyright (c) 2011-2013 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 * @file connection_profile.h
31 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
36 * @brief Enumeration for security type of Wi-Fi.
41 CONNECTION_WIFI_SECURITY_TYPE_NONE = 0, /**< Security disabled */
42 CONNECTION_WIFI_SECURITY_TYPE_WEP = 1, /**< WEP */
43 CONNECTION_WIFI_SECURITY_TYPE_WPA_PSK = 2, /**< WPA-PSK */
44 CONNECTION_WIFI_SECURITY_TYPE_WPA2_PSK = 3, /**< WPA2-PSK */
45 CONNECTION_WIFI_SECURITY_TYPE_EAP = 4, /**< EAP */
46 } connection_wifi_security_type_e;
49 * @brief Enumeration for encryption modes.
54 CONNECTION_WIFI_ENCRYPTION_TYPE_NONE = 0, /**< Encryption disabled */
55 CONNECTION_WIFI_ENCRYPTION_TYPE_WEP = 1, /**< WEP */
56 CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP = 2, /**< TKIP */
57 CONNECTION_WIFI_ENCRYPTION_TYPE_AES = 3, /**< AES */
58 CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED = 4, /**< TKIP and AES are both supported */
59 } connection_wifi_encryption_type_e;
67 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
72 * @brief This enumeration defines the cellular protocol type.
76 CONNECTION_CELLULAR_NETWORK_TYPE_UNKNOWN = 0, /**< Not defined */
77 CONNECTION_CELLULAR_NETWORK_TYPE_GPRS = 1, /**< GPRS type */
78 CONNECTION_CELLULAR_NETWORK_TYPE_EDGE = 2, /**< EDGE type */
79 CONNECTION_CELLULAR_NETWORK_TYPE_UMTS = 3, /**< UMTS type */
80 } connection_cellular_network_type_e;
83 * @brief Enumeration for cellular service type.
88 CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN = 0, /**< Unknown */
89 CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET = 1, /**< Internet */
90 CONNECTION_CELLULAR_SERVICE_TYPE_MMS = 2, /**< MMS */
91 CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET = 3, /**< Prepaid internet */
92 CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS = 4, /**< Prepaid MMS */
93 CONNECTION_CELLULAR_SERVICE_TYPE_TETHERING = 5, /**< Tethering */
94 CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION = 6, /**< Specific application */
95 } connection_cellular_service_type_e;
98 * @brief Enumeration for cellular authentication type.
103 CONNECTION_CELLULAR_AUTH_TYPE_NONE = 0, /**< No authentication */
104 CONNECTION_CELLULAR_AUTH_TYPE_PAP = 1, /**< PAP authentication */
105 CONNECTION_CELLULAR_AUTH_TYPE_CHAP = 2, /**< CHAP authentication */
106 } connection_cellular_auth_type_e;
114 * @addtogroup CAPI_NETWORK_CONNECTION_PROFILE_MODULE
119 * @brief The profile handle.
122 typedef void* connection_profile_h;
125 * @brief Enumeration for profile state type.
130 CONNECTION_PROFILE_STATE_DISCONNECTED = 0, /**< Disconnected state */
131 CONNECTION_PROFILE_STATE_ASSOCIATION = 1, /**< Association state */
132 CONNECTION_PROFILE_STATE_CONFIGURATION = 2, /**< Configuration state */
133 CONNECTION_PROFILE_STATE_CONNECTED = 3, /**< Connected state */
134 } connection_profile_state_e;
137 * @brief Enumeration for address family.
142 CONNECTION_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
143 CONNECTION_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type */
144 } connection_address_family_e;
147 * @brief Enumeration for IP configuration type.
152 CONNECTION_IP_CONFIG_TYPE_NONE = 0, /**< Not defined */
153 CONNECTION_IP_CONFIG_TYPE_STATIC = 1, /**< Manual IP configuration */
154 CONNECTION_IP_CONFIG_TYPE_DYNAMIC = 2, /**< Config IP using DHCP client*/
155 CONNECTION_IP_CONFIG_TYPE_AUTO = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
156 CONNECTION_IP_CONFIG_TYPE_FIXED = 4, /**< Indicates an IP address that can not be modified */
157 } connection_ip_config_type_e;
160 * @brief Enumeration for proxy method type.
165 CONNECTION_PROXY_TYPE_DIRECT = 0, /**< Direct connection */
166 CONNECTION_PROXY_TYPE_AUTO = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
167 CONNECTION_PROXY_TYPE_MANUAL = 2, /**< Manual configuration */
168 } connection_proxy_type_e;
171 * @brief Enumeration for network connection type.
175 CONNECTION_PROFILE_TYPE_CELLULAR = 0, /**< Cellular type */
176 CONNECTION_PROFILE_TYPE_WIFI = 1, /**< Wi-Fi type */
177 CONNECTION_PROFILE_TYPE_ETHERNET = 2, /**< Ethernet type */
178 CONNECTION_PROFILE_TYPE_BT = 3, /**< Bluetooth type */
179 } connection_profile_type_e;
182 * @brief Creates a profile handle.
183 * @details The profile name, which you get from connection_profile_get_name(), will include the keyword you set.
186 * @privilege %http://tizen.org/privilege/network.get
187 * @remarks You must release @a profile using connection_profile_destroy().
188 * @param[in] type The type of profile\n
189 * #CONNECTION_PROFILE_TYPE_CELLULAR and #CONNECTION_PROFILE_TYPE_WIFI are supported.
190 * @param[in] keyword The keyword included in profile name
191 * @param[out] profile The handle of the profile
192 * @return @c 0 on success, otherwise negative error value
193 * @retval #CONNECTION_ERROR_NONE Successful
194 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
195 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
196 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
197 * @see connection_profile_destroy()
198 * @see connection_profile_get_name()
200 int connection_profile_create(connection_profile_type_e type, const char* keyword, connection_profile_h* profile);
203 * @brief Destroys a profile handle.
205 * @param[out] profile The handle to the profile
206 * @return @c 0 on success, otherwise a negative error value
207 * @retval #CONNECTION_ERROR_NONE Successful
208 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
209 * @see connection_profile_create()
211 int connection_profile_destroy(connection_profile_h profile);
214 * @brief Clones a profile handle.
216 * @remarks You must release @a cloned_profile using connection_profile_destroy().
217 * @param[out] cloned_profile The handle of the cloned profile
218 * @param[in] origin_profile The handle of the origin profile
219 * @return @c 0 on success, otherwise a negative error value
220 * @retval #CONNECTION_ERROR_NONE Successful
221 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
222 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
223 * @see connection_profile_destroy()
225 int connection_profile_clone(connection_profile_h* cloned_profile, connection_profile_h origin_profile);
228 * @brief Gets the profile ID.
229 * @details The separate profiles can have the same name.
230 * So, you must use this API instead of connection_profile_get_name() if you want to get the unique identification.
231 * In case you create a profile, this value will be determined when you add the profile.
234 * @remarks You must release @a profile_id using free().
235 * @param[in] profile The profile handle
236 * @param[out] profile_id The ID of the profile
237 * @return @c 0 on success, otherwise a negative error value
238 * @retval #CONNECTION_ERROR_NONE Successful
239 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
240 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
241 * @see connection_profile_get_name()
242 * @see connection_add_profile()
244 int connection_profile_get_id(connection_profile_h profile, char** profile_id);
247 * @brief Gets the profile name.
249 * @remarks You must release @a profile_name using free().
250 * @param[in] profile The profile handle
251 * @param[out] profile_name The name of the profile
252 * @return @c 0 on success, otherwise a negative error value
253 * @retval #CONNECTION_ERROR_NONE Successful
254 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
255 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
256 * @see connection_profile_get_id()
258 int connection_profile_get_name(connection_profile_h profile, char** profile_name);
261 * @brief Gets the network type.
263 * @param[in] profile The profile handle
264 * @param[out] type The type of the profile
265 * @return @c 0 on success, otherwise a negative error value
266 * @retval #CONNECTION_ERROR_NONE Successful
267 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
268 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
270 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e* type);
273 * @brief Gets the name of the network interface, e.g. eth0 and pdp0.
275 * @remarks You must release @a interface_name using free().
276 * @param[in] profile The profile handle
277 * @param[out] interface_name The name of the network interface
278 * @return @c 0 on success, otherwise a negative error value
279 * @retval #CONNECTION_ERROR_NONE Successful
280 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
281 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
283 int connection_profile_get_network_interface_name(connection_profile_h profile, char** interface_name);
286 * @brief Refreshes the profile information.
289 * @privilege %http://tizen.org/privilege/network.get
290 * @remarks You should call this function in order to get the current information because the profile information can be changed.
291 * @param[in] profile The profile handle
292 * @return @c 0 on success, otherwise a negative error value
293 * @retval #CONNECTION_ERROR_NONE Successful
294 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
295 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
296 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
297 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
299 int connection_profile_refresh(connection_profile_h profile);
302 * @brief Gets the network type.
304 * @param[in] profile The profile handle
305 * @param[out] state The state of the profile
306 * @return @c 0 on success, otherwise a negative error value
307 * @retval #CONNECTION_ERROR_NONE Successful
308 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
309 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
311 int connection_profile_get_state(connection_profile_h profile, connection_profile_state_e* state);
314 * @brief Gets the IP config type.
316 * @param[in] profile The profile handle
317 * @param[in] address_family The address family
318 * @param[out] type The type of the IP config
319 * @return @c 0 on success, otherwise a negative error value
320 * @retval #CONNECTION_ERROR_NONE Successful
321 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
322 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
324 int connection_profile_get_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e* type);
327 * @brief Gets the IP address.
329 * @remarks You must release @a ip_address using free().
330 * @param[in] profile The profile handle
331 * @param[in] address_family The address family
332 * @param[out] ip_address The IP address
333 * @return @c 0 on success, otherwise a negative error value
334 * @retval #CONNECTION_ERROR_NONE Successful
335 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
336 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
337 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
338 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
340 int connection_profile_get_ip_address(connection_profile_h profile, connection_address_family_e address_family, char** ip_address);
343 * @brief Gets the Subnet Mask.
345 * @remarks You must release @a subnet_mask using free().
346 * @param[in] profile The profile handle
347 * @param[in] address_family The address family
348 * @param[out] subnet_mask The subnet mask
349 * @return @c 0 on success, otherwise a negative error value
350 * @retval #CONNECTION_ERROR_NONE Successful
351 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
352 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
353 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
354 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
356 int connection_profile_get_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, char** subnet_mask);
359 * @brief Gets the Gateway address.
361 * @remarks You must release @a gateway_address using free().
362 * @param[in] profile The profile handle
363 * @param[in] address_family The address family
364 * @param[out] gateway_address The gateway address
365 * @return @c 0 on success, otherwise a negative error value
366 * @retval #CONNECTION_ERROR_NONE Successful
367 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
368 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
369 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
370 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
372 int connection_profile_get_gateway_address(connection_profile_h profile, connection_address_family_e address_family, char** gateway_address);
375 * @brief Gets the DNS address.
377 * @remarks The allowance of the DNS address is @c 2. You must release @a dns_address using free().
378 * @param[in] profile The profile handle
379 * @param[in] order The order of DNS address \n
380 * it starts from 1, which means first DNS address.
381 * @param[in] address_family The address family
382 * @param[out] dns_address The DNS address
383 * @return @c 0 on success, otherwise a negative error value
384 * @retval #CONNECTION_ERROR_NONE Successful
385 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
386 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
387 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
388 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
390 int connection_profile_get_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, char** dns_address);
393 * @brief Gets the Proxy type.
395 * @param[in] profile The profile handle
396 * @param[out] type The type of the proxy
397 * @return @c 0 on success, otherwise a negative error value
398 * @retval #CONNECTION_ERROR_NONE Successful
399 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
400 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
402 int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e* type);
405 * @brief Gets the Proxy address.
407 * @remarks You must release @a proxy_address using free().
408 * @param[in] profile The profile handle
409 * @param[in] address_family The address family
410 * @param[out] proxy_address The proxy address
411 * @return @c 0 on success, otherwise a negative error value
412 * @retval #CONNECTION_ERROR_NONE Successful
413 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
414 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
415 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
416 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
418 int connection_profile_get_proxy_address(connection_profile_h profile, connection_address_family_e address_family, char** proxy_address);
421 * @brief Sets the IP config type.
422 * @details If you set IP config type to #CONNECTION_IP_CONFIG_TYPE_STATIC,
423 * then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
425 * @param[in] profile The profile handle
426 * @param[in] address_family The address family
427 * @param[in] type The type of the IP config
428 * @return @c 0 on success, otherwise a negative error value
429 * @retval #CONNECTION_ERROR_NONE Successful
430 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
431 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
433 int connection_profile_set_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e type);
436 * @brief Sets the IP address.
438 * @param[in] profile The profile handle
439 * @param[in] address_family The address family
440 * @param[in] ip_address The IP address.\n
441 * If you set this value to @c NULL, then the existing value will be deleted.
442 * @return @c 0 on success, otherwise a negative error value
443 * @retval #CONNECTION_ERROR_NONE Successful
444 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
445 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
446 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
447 * @see connection_update_profile()
449 int connection_profile_set_ip_address(connection_profile_h profile, connection_address_family_e address_family, const char* ip_address);
452 * @brief Sets the Subnet Mask.
454 * @param[in] profile The profile handle
455 * @param[in] address_family The address family
456 * @param[in] subnet_mask The subnet mask. \n
457 * If you set this value to @c NULL, then the existing value will be deleted.
458 * @return @c 0 on success, otherwise a negative error value
459 * @retval #CONNECTION_ERROR_NONE Successful
460 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
461 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
462 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
463 * @see connection_update_profile()
465 int connection_profile_set_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, const char* subnet_mask);
468 * @brief Sets the Gateway address.
470 * @param[in] profile The profile handle
471 * @param[in] address_family The address family
472 * @param[in] gateway_address The gateway address. \n
473 * If you set this value to @c NULL, then the existing value will be deleted.
474 * @return @c 0 on success, otherwise a negative error value
475 * @retval #CONNECTION_ERROR_NONE Successful
476 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
477 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
478 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
479 * @see connection_update_profile()
481 int connection_profile_set_gateway_address(connection_profile_h profile, connection_address_family_e address_family, const char* gateway_address);
484 * @brief Sets the DNS address.
486 * @remarks The allowance of the DNS address is @c 2.
487 * @param[in] profile The profile handle
488 * @param[in] order The order of the DNS address. \n
489 * It starts from @c 1, which means first DNS address.
490 * @param[in] address_family The address family
491 * @param[in] dns_address The DNS address; if you set this value to NULL, then the existing value will be deleted
492 * @return @c 0 on success, otherwise a negative error value
493 * @retval #CONNECTION_ERROR_NONE Successful
494 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
495 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
496 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
497 * @see connection_update_profile()
499 int connection_profile_set_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, const char* dns_address);
502 * @brief Sets the Proxy type.
503 * @details If you set the Proxy type to #CONNECTION_PROXY_TYPE_AUTO or #CONNECTION_PROXY_TYPE_MANUAL, then Proxy will be restored.
505 * @param[in] profile The profile handle
506 * @param[in] type The type of the proxy
507 * @return @c 0 on success, otherwise a negative error value
508 * @retval #CONNECTION_ERROR_NONE Successful
509 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
510 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
511 * @see connection_update_profile()
513 int connection_profile_set_proxy_type(connection_profile_h profile, connection_proxy_type_e type);
516 * @brief Sets the Proxy address.
518 * @param[in] profile The profile handle
519 * @param[in] address_family The address family
520 * @param[in] proxy_address The proxy address. \n
521 * if you set this value to @c NULL, then the existing value will be deleted.
522 * @return @c 0 on success, otherwise a negative error value
523 * @retval #CONNECTION_ERROR_NONE Successful
524 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
525 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
526 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
527 * @see connection_update_profile()
529 int connection_profile_set_proxy_address(connection_profile_h profile, connection_address_family_e address_family, const char* proxy_address);
532 * @brief Called when the state of the profile is changed.
534 * @param[in] state The state
535 * @param[in] user_data The user data passed from the callback registration function
536 * @see connection_profile_set_state_changed_cb()
537 * @see connection_profile_unset_state_changed_cb()
539 typedef void(*connection_profile_state_changed_cb)(connection_profile_state_e state, void* user_data);
542 * @brief Registers the callback that is called when the state of profile is changed.
544 * @param[in] profile The profile handle
545 * @param[in] callback The callback function to be called
546 * @param[in] user_data The user data passed to the callback function
547 * @return @c 0 on success, otherwise a negative error value
548 * @retval #CONNECTION_ERROR_NONE Successful
549 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
550 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
551 * @post connection_opened_cb() is invoked when the state of profile is changed.
552 * @see connection_profile_state_changed_cb()
553 * @see connection_profile_unset_state_changed_cb()
555 int connection_profile_set_state_changed_cb(connection_profile_h profile, connection_profile_state_changed_cb callback, void* user_data);
558 * @brief Unregisters the callback that is called when the state of profile is changed.
560 * @param[in] profile The profile handle
561 * @return @c 0 on success, otherwise a negative error value
562 * @retval #CONNECTION_ERROR_NONE Successful
563 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
564 * @see connection_profile_state_changed_cb()
565 * @see connection_profile_set_state_changed_cb()
567 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
575 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
580 * @brief Gets the ESSID (Extended Service Set Identifier).
582 * @remarks You must release @a essid using free().
583 * @param[in] profile The profile handle
584 * @param[out] essid The ESSID
585 * @return @c 0 on success, otherwise a negative error value
586 * @retval #CONNECTION_ERROR_NONE Successful
587 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
588 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
589 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
591 int connection_profile_get_wifi_essid(connection_profile_h profile, char** essid);
594 * @brief Gets the BSSID (Basic Service Set Identifier).
596 * @remarks You must release @a bssid using free().
597 * @param[in] profile The profile handle
598 * @param[out] bssid The BSSID
599 * @return @c 0 on success, otherwise a negative error value
600 * @retval #CONNECTION_ERROR_NONE Successful
601 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
602 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
603 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
605 int connection_profile_get_wifi_bssid(connection_profile_h profile, char** bssid);
608 * @brief Gets the RSSI.
610 * @param[in] profile The profile handle
611 * @param[out] rssi The RSSI
612 * @return @c 0 on success, otherwise a negative error value
613 * @retval #CONNECTION_ERROR_NONE Successful
614 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
615 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
617 int connection_profile_get_wifi_rssi(connection_profile_h profile, int* rssi);
620 * @brief Gets the frequency (MHz).
622 * @param[in] profile The profile handle
623 * @param[out] frequency The frequency
624 * @return @c 0 on success, otherwise a negative error value
625 * @retval #CONNECTION_ERROR_NONE Successful
626 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
627 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
629 int connection_profile_get_wifi_frequency(connection_profile_h profile, int* frequency);
632 * @brief Gets the max speed (Mbps).
634 * @param[in] profile The profile handle
635 * @param[out] max_speed The max speed
636 * @return @c 0 on success, otherwise a negative error value
637 * @retval #CONNECTION_ERROR_NONE Successful
638 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
639 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
641 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int* max_speed);
644 * @brief Gets the security mode of Wi-Fi.
646 * @param[in] profile The profile handle
647 * @param[out] type The type of Wi-Fi security
648 * @return @c 0 on success, otherwise a negative error value
649 * @retval #CONNECTION_ERROR_NONE Successful
650 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
651 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
652 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
654 int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e* type);
657 * @brief Gets the security mode of Wi-Fi.
659 * @param[in] profile The profile handle
660 * @param[out] type The type of Wi-Fi security
661 * @return @c 0 on success, otherwise a negative error value
662 * @retval #CONNECTION_ERROR_NONE Successful
663 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
664 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
665 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
667 int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e* type);
670 * @brief Checks whether passphrase is required.
672 * @remarks This function is not valid if security type is #CONNECTION_WIFI_SECURITY_TYPE_EAP.
673 * @param[in] profile The profile handle
674 * @param[out] required @c true if a passphrase is required, otherwise @c false if a passphrase is not required.
675 * @return @c 0 on success, otherwise a negative error value
676 * @retval #CONNECTION_ERROR_NONE Successful
677 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
678 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
680 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile, bool* required);
683 * @brief Sets the passphrase of the Wi-Fi WPA.
685 * @param[in] profile The profile handle
686 * @param[in] passphrase The passphrase of Wi-Fi security
687 * @return @c 0 on success, otherwise a negative error value
688 * @retval #CONNECTION_ERROR_NONE Successful
689 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
690 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
691 * @see connection_update_profile()
693 int connection_profile_set_wifi_passphrase(connection_profile_h profile, const char* passphrase);
696 * @brief Checks whether the WPS (Wi-Fi Protected Setup) is supported.
698 * @remarks If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
699 * @param[in] profile The profile handle
700 * @param[out] supported @c true if WPS is supported, otherwise @c false if WPS is not supported.
701 * @return @c 0 on success, otherwise negative error value
702 * @retval #CONNECTION_ERROR_NONE Successful
703 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
704 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
706 int connection_profile_is_wifi_wps_supported(connection_profile_h profile, bool* supported);
714 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
719 * @brief Gets the cellular network type.
720 * @param[in] profile The handle of profile
721 * @param[out] type The type of cellular
722 * @return 0 on success, otherwise negative error value.
723 * @retval #CONNECTION_ERROR_NONE Successful
724 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
725 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
727 int connection_profile_get_cellular_network_type(connection_profile_h profile, connection_cellular_network_type_e* type);
730 * @brief Gets the service type.
732 * @param[in] profile The profile handle
733 * @param[out] type The type of the cellular service
734 * @return @c 0 on success, otherwise a negative error value
735 * @retval #CONNECTION_ERROR_NONE Successful
736 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
737 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
738 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
740 int connection_profile_get_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e* type);
743 * @brief Gets the APN (access point name).
745 * @remarks You must release @a apn using free().
746 * @param[in] profile The profile handle
747 * @param[out] apn The name of the APN
748 * @return @c 0 on success, otherwise a negative error value
749 * @retval #CONNECTION_ERROR_NONE Successful
750 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
751 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
752 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
754 int connection_profile_get_cellular_apn(connection_profile_h profile, char** apn);
757 * @brief Gets the authentication information.
759 * @remarks You must release @a user_name and @a password using free().
760 * @param[in] profile The profile handle
761 * @param[out] type The type of the authentication
762 * @param[out] user_name The user name
763 * @param[out] password The password
764 * @return @c 0 on success, otherwise a negative error value
765 * @retval #CONNECTION_ERROR_NONE Successful
766 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
767 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
768 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
769 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
771 int connection_profile_get_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e* type, char** user_name, char** password);
774 * @brief Gets the home URL.
776 * @remarks You must release @a home_url using free().
777 * @param[in] profile The profile handle
778 * @param[out] home_url The home URL
779 * @return @c 0 on success, otherwise a negative error value
780 * @retval #CONNECTION_ERROR_NONE Successful
781 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
782 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
783 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
785 int connection_profile_get_cellular_home_url(connection_profile_h profile, char** home_url);
788 * @brief Checks wheter the connection is in roaming state.
790 * @param[in] profile The profile handle
791 * @param[out] is_roaming @c true if the cellular is roaming, otherwise @c false if it is not roaming.
792 * @return @c 0 on success, otherwise a negative error value
793 * @retval #CONNECTION_ERROR_NONE Successful
794 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
795 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
797 int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming);
800 * @brief Checks whether the profile is hidden.
802 * @param[in] profile The profile handle
803 * @param[out] is_hidden @c ture if the profile is in hidden, otherwise @c false if the profile is not hidden.
804 * @return @c 0 on success, otherwise a negative error value
805 * @retval #CONNECTION_ERROR_NONE Successful
806 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
807 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
809 int connection_profile_is_cellular_hidden(connection_profile_h profile, bool* is_hidden);
812 * @brief Checks whether the profile is editable.
814 * @param[in] profile The profile handle
815 * @param[out] is_editable @c true if the profile is editable, otherwise @c false if the profile is not editable.
816 * @return @c 0 on success, otherwise a negative error value
817 * @retval #CONNECTION_ERROR_NONE Successful
818 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
819 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
821 int connection_profile_is_cellular_editable(connection_profile_h profile, bool* is_editable);
824 * @brief Checks whether the profile is default.
826 * @param[in] profile The profile handle
827 * @param[out] is_default @c true if the profile is default, otherwise @c false if the profile is not default.
828 * @return @c 0 on success, otherwise a negative error value
829 * @retval #CONNECTION_ERROR_NONE Successful
830 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
831 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
833 int connection_profile_is_cellular_default(connection_profile_h profile, bool* is_default);
836 * @brief Sets the service type.
838 * @param[in] profile The profile handle
839 * @param[in] service_type The type of cellular service
840 * @return @c 0 on success, otherwise a negative error value
841 * @retval #CONNECTION_ERROR_NONE Successful
842 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
843 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
844 * @see connection_update_profile()
846 int connection_profile_set_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e service_type);
849 * @brief Sets the APN (Access Point Name).
851 * @param[in] profile The profile handle
852 * @param[in] apn The name of APN
853 * @return @c 0 on success, otherwise a negative error value
854 * @retval #CONNECTION_ERROR_NONE Successful
855 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
856 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
857 * @see connection_update_profile()
859 int connection_profile_set_cellular_apn(connection_profile_h profile, const char* apn);
862 * @brief Sets the Authentication information.
864 * @param[in] profile The profile handle
865 * @param[in] type The type of the authentication
866 * @param[in] user_name The user name
867 * @param[in] password The password
868 * @return @c 0 on success, otherwise a negative error value
869 * @retval #CONNECTION_ERROR_NONE Successful
870 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
871 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
872 * @see connection_update_profile()
874 int connection_profile_set_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e type, const char* user_name, const char* password);
877 * @brief Sets the home URL.
879 * @param[in] profile The profile handle
880 * @param[in] home_url The home URL
881 * @return @c 0 on success, otherwise a negative error value
882 * @retval #CONNECTION_ERROR_NONE Successful
883 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
884 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
885 * @see connection_update_profile()
887 int connection_profile_set_cellular_home_url(connection_profile_h profile, const char* home_url);
899 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */