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.profile \n
187 * %http://tizen.org/privilege/network.get
188 * @remarks You must release @a profile using connection_profile_destroy(). \n
189 * This API needs both privileges.
190 * @param[in] type The type of profile\n
191 * #CONNECTION_PROFILE_TYPE_CELLULAR and #CONNECTION_PROFILE_TYPE_WIFI are supported.
192 * @param[in] keyword The keyword included in profile name
193 * @param[out] profile The handle of the profile
194 * @return @c 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 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
199 * @see connection_profile_destroy()
200 * @see connection_profile_get_name()
202 int connection_profile_create(connection_profile_type_e type, const char* keyword, connection_profile_h* profile);
205 * @brief Destroys a profile handle.
207 * @param[out] profile The handle to the profile
208 * @return @c 0 on success, otherwise a negative error value
209 * @retval #CONNECTION_ERROR_NONE Successful
210 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
211 * @see connection_profile_create()
213 int connection_profile_destroy(connection_profile_h profile);
216 * @brief Clones a profile handle.
218 * @remarks You must release @a cloned_profile using connection_profile_destroy().
219 * @param[out] cloned_profile The handle of the cloned profile
220 * @param[in] origin_profile The handle of the origin profile
221 * @return @c 0 on success, otherwise a negative error value
222 * @retval #CONNECTION_ERROR_NONE Successful
223 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
224 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
225 * @see connection_profile_destroy()
227 int connection_profile_clone(connection_profile_h* cloned_profile, connection_profile_h origin_profile);
230 * @brief Gets the profile ID.
231 * @details The separate profiles can have the same name.
232 * So, you must use this API instead of connection_profile_get_name() if you want to get the unique identification.
233 * In case you create a profile, this value will be determined when you add the profile.
236 * @remarks You must release @a profile_id using free().
237 * @param[in] profile The profile handle
238 * @param[out] profile_id The ID of the profile
239 * @return @c 0 on success, otherwise a negative error value
240 * @retval #CONNECTION_ERROR_NONE Successful
241 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
242 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
243 * @see connection_profile_get_name()
244 * @see connection_add_profile()
246 int connection_profile_get_id(connection_profile_h profile, char** profile_id);
249 * @brief Gets the profile name.
251 * @remarks You must release @a profile_name using free().
252 * @param[in] profile The profile handle
253 * @param[out] profile_name The name of the profile
254 * @return @c 0 on success, otherwise a negative error value
255 * @retval #CONNECTION_ERROR_NONE Successful
256 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
257 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
258 * @see connection_profile_get_id()
260 int connection_profile_get_name(connection_profile_h profile, char** profile_name);
263 * @brief Gets the network type.
265 * @param[in] profile The profile handle
266 * @param[out] type The type of the profile
267 * @return @c 0 on success, otherwise a negative error value
268 * @retval #CONNECTION_ERROR_NONE Successful
269 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
270 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
272 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e* type);
275 * @brief Gets the name of the network interface, e.g. eth0 and pdp0.
277 * @remarks You must release @a interface_name using free().
278 * @param[in] profile The profile handle
279 * @param[out] interface_name The name of the network interface
280 * @return @c 0 on success, otherwise a negative error value
281 * @retval #CONNECTION_ERROR_NONE Successful
282 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
283 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
285 int connection_profile_get_network_interface_name(connection_profile_h profile, char** interface_name);
288 * @brief Refreshes the profile information.
291 * @privilege %http://tizen.org/privilege/network.get
292 * @remarks You should call this function in order to get the current information because the profile information can be changed.
293 * @param[in] profile The profile handle
294 * @return @c 0 on success, otherwise a negative error value
295 * @retval #CONNECTION_ERROR_NONE Successful
296 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
297 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
298 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
299 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
301 int connection_profile_refresh(connection_profile_h profile);
304 * @brief Gets the network type.
306 * @param[in] profile The profile handle
307 * @param[out] state The state of the profile
308 * @return @c 0 on success, otherwise a negative error value
309 * @retval #CONNECTION_ERROR_NONE Successful
310 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
311 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
313 int connection_profile_get_state(connection_profile_h profile, connection_profile_state_e* state);
316 * @brief Gets the IP config type.
318 * @param[in] profile The profile handle
319 * @param[in] address_family The address family
320 * @param[out] type The type of the IP config
321 * @return @c 0 on success, otherwise a negative error value
322 * @retval #CONNECTION_ERROR_NONE Successful
323 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
324 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
326 int connection_profile_get_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e* type);
329 * @brief Gets the IP address.
331 * @remarks You must release @a ip_address using free().
332 * @param[in] profile The profile handle
333 * @param[in] address_family The address family
334 * @param[out] ip_address The IP address
335 * @return @c 0 on success, otherwise a negative error value
336 * @retval #CONNECTION_ERROR_NONE Successful
337 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
338 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
339 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
340 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
342 int connection_profile_get_ip_address(connection_profile_h profile, connection_address_family_e address_family, char** ip_address);
345 * @brief Gets the Subnet Mask.
347 * @remarks You must release @a subnet_mask using free().
348 * @param[in] profile The profile handle
349 * @param[in] address_family The address family
350 * @param[out] subnet_mask The subnet mask
351 * @return @c 0 on success, otherwise a negative error value
352 * @retval #CONNECTION_ERROR_NONE Successful
353 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
354 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
355 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
356 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
358 int connection_profile_get_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, char** subnet_mask);
361 * @brief Gets the Gateway address.
363 * @remarks You must release @a gateway_address using free().
364 * @param[in] profile The profile handle
365 * @param[in] address_family The address family
366 * @param[out] gateway_address The gateway address
367 * @return @c 0 on success, otherwise a negative error value
368 * @retval #CONNECTION_ERROR_NONE Successful
369 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
370 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
371 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
372 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
374 int connection_profile_get_gateway_address(connection_profile_h profile, connection_address_family_e address_family, char** gateway_address);
377 * @brief Gets the DNS address.
379 * @remarks The allowance of the DNS address is @c 2. You must release @a dns_address using free().
380 * @param[in] profile The profile handle
381 * @param[in] order The order of DNS address \n
382 * it starts from 1, which means first DNS address.
383 * @param[in] address_family The address family
384 * @param[out] dns_address The DNS address
385 * @return @c 0 on success, otherwise a negative error value
386 * @retval #CONNECTION_ERROR_NONE Successful
387 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
388 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
389 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
390 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
392 int connection_profile_get_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, char** dns_address);
395 * @brief Gets the Proxy type.
397 * @param[in] profile The profile handle
398 * @param[out] type The type of the proxy
399 * @return @c 0 on success, otherwise a negative error value
400 * @retval #CONNECTION_ERROR_NONE Successful
401 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
402 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
404 int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e* type);
407 * @brief Gets the Proxy address.
409 * @remarks You must release @a proxy_address using free().
410 * @param[in] profile The profile handle
411 * @param[in] address_family The address family
412 * @param[out] proxy_address The proxy address
413 * @return @c 0 on success, otherwise a negative error value
414 * @retval #CONNECTION_ERROR_NONE Successful
415 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
416 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
417 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
418 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
420 int connection_profile_get_proxy_address(connection_profile_h profile, connection_address_family_e address_family, char** proxy_address);
423 * @brief Sets the IP config type.
424 * @details If you set IP config type to #CONNECTION_IP_CONFIG_TYPE_STATIC,
425 * then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
427 * @param[in] profile The profile handle
428 * @param[in] address_family The address family
429 * @param[in] type The type of the IP config
430 * @return @c 0 on success, otherwise a negative error value
431 * @retval #CONNECTION_ERROR_NONE Successful
432 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
433 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
435 int connection_profile_set_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e type);
438 * @brief Sets the IP address.
440 * @param[in] profile The profile handle
441 * @param[in] address_family The address family
442 * @param[in] ip_address The IP address.\n
443 * If you set this value to @c NULL, then the existing value will be deleted.
444 * @return @c 0 on success, otherwise a negative error value
445 * @retval #CONNECTION_ERROR_NONE Successful
446 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
447 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
448 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
449 * @see connection_update_profile()
451 int connection_profile_set_ip_address(connection_profile_h profile, connection_address_family_e address_family, const char* ip_address);
454 * @brief Sets the Subnet Mask.
456 * @param[in] profile The profile handle
457 * @param[in] address_family The address family
458 * @param[in] subnet_mask The subnet mask. \n
459 * If you set this value to @c NULL, then the existing value will be deleted.
460 * @return @c 0 on success, otherwise a negative error value
461 * @retval #CONNECTION_ERROR_NONE Successful
462 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
463 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
464 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
465 * @see connection_update_profile()
467 int connection_profile_set_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, const char* subnet_mask);
470 * @brief Sets the Gateway address.
472 * @param[in] profile The profile handle
473 * @param[in] address_family The address family
474 * @param[in] gateway_address The gateway address. \n
475 * If you set this value to @c NULL, then the existing value will be deleted.
476 * @return @c 0 on success, otherwise a negative error value
477 * @retval #CONNECTION_ERROR_NONE Successful
478 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
479 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
480 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
481 * @see connection_update_profile()
483 int connection_profile_set_gateway_address(connection_profile_h profile, connection_address_family_e address_family, const char* gateway_address);
486 * @brief Sets the DNS address.
488 * @remarks The allowance of the DNS address is @c 2.
489 * @param[in] profile The profile handle
490 * @param[in] order The order of the DNS address. \n
491 * It starts from @c 1, which means first DNS address.
492 * @param[in] address_family The address family
493 * @param[in] dns_address The DNS address; if you set this value to NULL, then the existing value will be deleted
494 * @return @c 0 on success, otherwise a negative error value
495 * @retval #CONNECTION_ERROR_NONE Successful
496 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
497 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
498 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
499 * @see connection_update_profile()
501 int connection_profile_set_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, const char* dns_address);
504 * @brief Sets the Proxy type.
505 * @details If you set the Proxy type to #CONNECTION_PROXY_TYPE_AUTO or #CONNECTION_PROXY_TYPE_MANUAL, then Proxy will be restored.
507 * @param[in] profile The profile handle
508 * @param[in] type The type of the proxy
509 * @return @c 0 on success, otherwise a negative error value
510 * @retval #CONNECTION_ERROR_NONE Successful
511 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
512 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
513 * @see connection_update_profile()
515 int connection_profile_set_proxy_type(connection_profile_h profile, connection_proxy_type_e type);
518 * @brief Sets the Proxy address.
520 * @param[in] profile The profile handle
521 * @param[in] address_family The address family
522 * @param[in] proxy_address The proxy address. \n
523 * if you set this value to @c NULL, then the existing value will be deleted.
524 * @return @c 0 on success, otherwise a negative error value
525 * @retval #CONNECTION_ERROR_NONE Successful
526 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
527 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
528 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
529 * @see connection_update_profile()
531 int connection_profile_set_proxy_address(connection_profile_h profile, connection_address_family_e address_family, const char* proxy_address);
534 * @brief Called when the state of the profile is changed.
536 * @param[in] state The state
537 * @param[in] user_data The user data passed from the callback registration function
538 * @see connection_profile_set_state_changed_cb()
539 * @see connection_profile_unset_state_changed_cb()
541 typedef void(*connection_profile_state_changed_cb)(connection_profile_state_e state, void* user_data);
544 * @brief Registers the callback that is called when the state of profile is changed.
546 * @param[in] profile The profile handle
547 * @param[in] callback The callback function to be called
548 * @param[in] user_data The user data passed to the callback function
549 * @return @c 0 on success, otherwise a negative error value
550 * @retval #CONNECTION_ERROR_NONE Successful
551 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
552 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
553 * @post connection_opened_cb() is invoked when the state of profile is changed.
554 * @see connection_profile_state_changed_cb()
555 * @see connection_profile_unset_state_changed_cb()
557 int connection_profile_set_state_changed_cb(connection_profile_h profile, connection_profile_state_changed_cb callback, void* user_data);
560 * @brief Unregisters the callback that is called when the state of profile is changed.
562 * @param[in] profile The profile handle
563 * @return @c 0 on success, otherwise a negative error value
564 * @retval #CONNECTION_ERROR_NONE Successful
565 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
566 * @see connection_profile_state_changed_cb()
567 * @see connection_profile_set_state_changed_cb()
569 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
577 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
582 * @brief Gets the ESSID (Extended Service Set Identifier).
584 * @remarks You must release @a essid using free().
585 * @param[in] profile The profile handle
586 * @param[out] essid The ESSID
587 * @return @c 0 on success, otherwise a negative error value
588 * @retval #CONNECTION_ERROR_NONE Successful
589 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
590 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
591 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
593 int connection_profile_get_wifi_essid(connection_profile_h profile, char** essid);
596 * @brief Gets the BSSID (Basic Service Set Identifier).
598 * @remarks You must release @a bssid using free().
599 * @param[in] profile The profile handle
600 * @param[out] bssid The BSSID
601 * @return @c 0 on success, otherwise a negative error value
602 * @retval #CONNECTION_ERROR_NONE Successful
603 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
604 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
605 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
607 int connection_profile_get_wifi_bssid(connection_profile_h profile, char** bssid);
610 * @brief Gets the RSSI.
612 * @param[in] profile The profile handle
613 * @param[out] rssi The RSSI
614 * @return @c 0 on success, otherwise a negative error value
615 * @retval #CONNECTION_ERROR_NONE Successful
616 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
617 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
619 int connection_profile_get_wifi_rssi(connection_profile_h profile, int* rssi);
622 * @brief Gets the frequency (MHz).
624 * @param[in] profile The profile handle
625 * @param[out] frequency The frequency
626 * @return @c 0 on success, otherwise a negative error value
627 * @retval #CONNECTION_ERROR_NONE Successful
628 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
629 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
631 int connection_profile_get_wifi_frequency(connection_profile_h profile, int* frequency);
634 * @brief Gets the max speed (Mbps).
636 * @param[in] profile The profile handle
637 * @param[out] max_speed The max speed
638 * @return @c 0 on success, otherwise a negative error value
639 * @retval #CONNECTION_ERROR_NONE Successful
640 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
641 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
643 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int* max_speed);
646 * @brief Gets the security mode of Wi-Fi.
648 * @param[in] profile The profile handle
649 * @param[out] type The type of Wi-Fi security
650 * @return @c 0 on success, otherwise a negative error value
651 * @retval #CONNECTION_ERROR_NONE Successful
652 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
653 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
654 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
656 int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e* type);
659 * @brief Gets the security mode of Wi-Fi.
661 * @param[in] profile The profile handle
662 * @param[out] type The type of Wi-Fi security
663 * @return @c 0 on success, otherwise a negative error value
664 * @retval #CONNECTION_ERROR_NONE Successful
665 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
666 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
667 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
669 int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e* type);
672 * @brief Checks whether passphrase is required.
674 * @remarks This function is not valid if security type is #CONNECTION_WIFI_SECURITY_TYPE_EAP.
675 * @param[in] profile The profile handle
676 * @param[out] required @c true if a passphrase is required, otherwise @c false if a passphrase is not required.
677 * @return @c 0 on success, otherwise a negative error value
678 * @retval #CONNECTION_ERROR_NONE Successful
679 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
680 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
682 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile, bool* required);
685 * @brief Sets the passphrase of the Wi-Fi WPA.
687 * @param[in] profile The profile handle
688 * @param[in] passphrase The passphrase of Wi-Fi security
689 * @return @c 0 on success, otherwise a negative error value
690 * @retval #CONNECTION_ERROR_NONE Successful
691 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
692 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
693 * @see connection_update_profile()
695 int connection_profile_set_wifi_passphrase(connection_profile_h profile, const char* passphrase);
698 * @brief Checks whether the WPS (Wi-Fi Protected Setup) is supported.
700 * @remarks If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
701 * @param[in] profile The profile handle
702 * @param[out] supported @c true if WPS is supported, otherwise @c false if WPS is not supported.
703 * @return @c 0 on success, otherwise negative error value
704 * @retval #CONNECTION_ERROR_NONE Successful
705 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
706 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
708 int connection_profile_is_wifi_wps_supported(connection_profile_h profile, bool* supported);
716 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
721 * @brief Gets the cellular network type.
722 * @param[in] profile The handle of profile
723 * @param[out] type The type of cellular
724 * @return 0 on success, otherwise negative error value.
725 * @retval #CONNECTION_ERROR_NONE Successful
726 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
727 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
729 int connection_profile_get_cellular_network_type(connection_profile_h profile, connection_cellular_network_type_e* type);
732 * @brief Gets the service type.
734 * @param[in] profile The profile handle
735 * @param[out] type The type of the cellular service
736 * @return @c 0 on success, otherwise a negative error value
737 * @retval #CONNECTION_ERROR_NONE Successful
738 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
739 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
740 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
742 int connection_profile_get_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e* type);
745 * @brief Gets the APN (access point name).
747 * @remarks You must release @a apn using free().
748 * @param[in] profile The profile handle
749 * @param[out] apn The name of the APN
750 * @return @c 0 on success, otherwise a negative error value
751 * @retval #CONNECTION_ERROR_NONE Successful
752 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
753 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
754 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
756 int connection_profile_get_cellular_apn(connection_profile_h profile, char** apn);
759 * @brief Gets the authentication information.
761 * @remarks You must release @a user_name and @a password using free().
762 * @param[in] profile The profile handle
763 * @param[out] type The type of the authentication
764 * @param[out] user_name The user name
765 * @param[out] password The password
766 * @return @c 0 on success, otherwise a negative error value
767 * @retval #CONNECTION_ERROR_NONE Successful
768 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
769 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
770 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
771 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
773 int connection_profile_get_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e* type, char** user_name, char** password);
776 * @brief Gets the home URL.
778 * @remarks You must release @a home_url using free().
779 * @param[in] profile The profile handle
780 * @param[out] home_url The home URL
781 * @return @c 0 on success, otherwise a negative error value
782 * @retval #CONNECTION_ERROR_NONE Successful
783 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
784 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
785 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
787 int connection_profile_get_cellular_home_url(connection_profile_h profile, char** home_url);
790 * @brief Checks wheter the connection is in roaming state.
792 * @param[in] profile The profile handle
793 * @param[out] is_roaming @c true if the cellular is roaming, otherwise @c false if it is not roaming.
794 * @return @c 0 on success, otherwise a negative error value
795 * @retval #CONNECTION_ERROR_NONE Successful
796 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
797 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
799 int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming);
802 * @brief Checks whether the profile is hidden.
804 * @param[in] profile The profile handle
805 * @param[out] is_hidden @c ture if the profile is in hidden, otherwise @c false if the profile is not hidden.
806 * @return @c 0 on success, otherwise a negative error value
807 * @retval #CONNECTION_ERROR_NONE Successful
808 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
809 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
811 int connection_profile_is_cellular_hidden(connection_profile_h profile, bool* is_hidden);
814 * @brief Checks whether the profile is editable.
816 * @param[in] profile The profile handle
817 * @param[out] is_editable @c true if the profile is editable, otherwise @c false if the profile is not editable.
818 * @return @c 0 on success, otherwise a negative error value
819 * @retval #CONNECTION_ERROR_NONE Successful
820 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
821 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
823 int connection_profile_is_cellular_editable(connection_profile_h profile, bool* is_editable);
826 * @brief Checks whether the profile is default.
828 * @param[in] profile The profile handle
829 * @param[out] is_default @c true if the profile is default, otherwise @c false if the profile is not default.
830 * @return @c 0 on success, otherwise a negative error value
831 * @retval #CONNECTION_ERROR_NONE Successful
832 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
833 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
835 int connection_profile_is_cellular_default(connection_profile_h profile, bool* is_default);
838 * @brief Sets the service type.
840 * @param[in] profile The profile handle
841 * @param[in] service_type The type of cellular service
842 * @return @c 0 on success, otherwise a negative error value
843 * @retval #CONNECTION_ERROR_NONE Successful
844 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
845 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
846 * @see connection_update_profile()
848 int connection_profile_set_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e service_type);
851 * @brief Sets the APN (Access Point Name).
853 * @param[in] profile The profile handle
854 * @param[in] apn The name of APN
855 * @return @c 0 on success, otherwise a negative error value
856 * @retval #CONNECTION_ERROR_NONE Successful
857 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
858 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
859 * @see connection_update_profile()
861 int connection_profile_set_cellular_apn(connection_profile_h profile, const char* apn);
864 * @brief Sets the Authentication information.
866 * @param[in] profile The profile handle
867 * @param[in] type The type of the authentication
868 * @param[in] user_name The user name
869 * @param[in] password The password
870 * @return @c 0 on success, otherwise a negative error value
871 * @retval #CONNECTION_ERROR_NONE Successful
872 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
873 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
874 * @see connection_update_profile()
876 int connection_profile_set_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e type, const char* user_name, const char* password);
879 * @brief Sets the home URL.
881 * @param[in] profile The profile handle
882 * @param[in] home_url The home URL
883 * @return @c 0 on success, otherwise a negative error value
884 * @retval #CONNECTION_ERROR_NONE Successful
885 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
886 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
887 * @see connection_update_profile()
889 int connection_profile_set_cellular_home_url(connection_profile_h profile, const char* home_url);
901 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */