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.
18 #ifndef __TIZEN_NETWORK_CONNECTION_PROFILE_H__
19 #define __TIZEN_NETWORK_CONNECTION_PROFILE_H__
31 * @file connection_profile.h
36 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
42 * @brief Enumeration for security type of Wi-Fi.
43 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
46 CONNECTION_WIFI_SECURITY_TYPE_NONE = 0, /**< Security disabled */
47 CONNECTION_WIFI_SECURITY_TYPE_WEP = 1, /**< WEP */
48 CONNECTION_WIFI_SECURITY_TYPE_WPA_PSK = 2, /**< WPA-PSK */
49 CONNECTION_WIFI_SECURITY_TYPE_WPA2_PSK = 3, /**< WPA2-PSK */
50 CONNECTION_WIFI_SECURITY_TYPE_EAP = 4, /**< EAP */
51 } connection_wifi_security_type_e;
55 * @brief Enumeration for encryption modes.
56 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
59 CONNECTION_WIFI_ENCRYPTION_TYPE_NONE = 0, /**< Encryption disabled */
60 CONNECTION_WIFI_ENCRYPTION_TYPE_WEP = 1, /**< WEP */
61 CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP = 2, /**< TKIP */
62 CONNECTION_WIFI_ENCRYPTION_TYPE_AES = 3, /**< AES */
63 CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED = 4, /**< TKIP and AES are both supported */
64 } connection_wifi_encryption_type_e;
73 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
79 * @brief Enumeration for cellular service type.
80 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
83 CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN = 0, /**< Unknown */
84 CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET = 1, /**< Internet */
85 CONNECTION_CELLULAR_SERVICE_TYPE_MMS = 2, /**< MMS */
86 CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET = 3, /**< Prepaid internet */
87 CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS = 4, /**< Prepaid MMS */
88 CONNECTION_CELLULAR_SERVICE_TYPE_TETHERING = 5, /**< Tethering */
89 CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION = 6, /**< Specific application */
90 } connection_cellular_service_type_e;
94 * @brief Enumeration for cellular pdn type.
98 CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN = 0,
99 CONNECTION_CELLULAR_PDN_TYPE_IPV4 = 1,
100 CONNECTION_CELLULAR_PDN_TYPE_IPV6 = 2,
101 CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 = 3,
102 } connection_cellular_pdn_type_e;
106 * @brief Enumeration for cellular authentication type.
107 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
110 CONNECTION_CELLULAR_AUTH_TYPE_NONE = 0, /**< No authentication */
111 CONNECTION_CELLULAR_AUTH_TYPE_PAP = 1, /**< PAP authentication */
112 CONNECTION_CELLULAR_AUTH_TYPE_CHAP = 2, /**< CHAP authentication */
113 } connection_cellular_auth_type_e;
122 * @addtogroup CAPI_NETWORK_CONNECTION_PROFILE_MODULE
128 * @brief The profile handle.
129 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
131 typedef void* connection_profile_h;
135 * @brief Enumeration for profile state type.
136 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
139 CONNECTION_PROFILE_STATE_DISCONNECTED = 0, /**< Disconnected state */
140 CONNECTION_PROFILE_STATE_ASSOCIATION = 1, /**< Association state */
141 CONNECTION_PROFILE_STATE_CONFIGURATION = 2, /**< Configuration state */
142 CONNECTION_PROFILE_STATE_CONNECTED = 3, /**< Connected state */
143 } connection_profile_state_e;
147 * @brief Enumeration for address family.
148 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
151 CONNECTION_ADDRESS_FAMILY_IPV4 = 0, /**< IPV4 Address type */
152 CONNECTION_ADDRESS_FAMILY_IPV6 = 1, /**< IPV6 Address type */
153 } connection_address_family_e;
157 * @brief Enumeration for IP configuration type.
158 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
161 CONNECTION_IP_CONFIG_TYPE_NONE = 0, /**< Not defined */
162 CONNECTION_IP_CONFIG_TYPE_STATIC = 1, /**< Manual IP configuration */
163 CONNECTION_IP_CONFIG_TYPE_DYNAMIC = 2, /**< Config IP using DHCP client*/
164 CONNECTION_IP_CONFIG_TYPE_AUTO = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
165 CONNECTION_IP_CONFIG_TYPE_FIXED = 4, /**< Indicates an IP address that can not be modified */
166 } connection_ip_config_type_e;
170 * @brief Enumeration for proxy method type.
171 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
174 CONNECTION_PROXY_TYPE_DIRECT = 0, /**< Direct connection */
175 CONNECTION_PROXY_TYPE_AUTO = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
176 CONNECTION_PROXY_TYPE_MANUAL = 2, /**< Manual configuration */
177 } connection_proxy_type_e;
181 * @brief Enumeration for network connection type.
182 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
185 CONNECTION_PROFILE_TYPE_CELLULAR = 0, /**< Cellular type */
186 CONNECTION_PROFILE_TYPE_WIFI = 1, /**< Wi-Fi type */
187 CONNECTION_PROFILE_TYPE_ETHERNET = 2, /**< Ethernet type */
188 CONNECTION_PROFILE_TYPE_BT = 3, /**< Bluetooth type */
189 } connection_profile_type_e;
193 * @brief Creates a profile handle.
194 * @details The profile name, which you get from connection_profile_get_name(), will include the keyword you set.
195 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
197 * @privilege %http://tizen.org/privilege/network.get
198 * @remarks You must release @a profile using connection_profile_destroy().
199 * @param[in] type The type of profile \n
200 * #CONNECTION_PROFILE_TYPE_CELLULAR and #CONNECTION_PROFILE_TYPE_WIFI are supported
201 * @param[in] keyword The keyword included in profile name
202 * @param[out] profile The handle of the profile
203 * @return @c 0 on success,
204 * otherwise negative error value
205 * @retval #CONNECTION_ERROR_NONE Successful
206 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
207 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
208 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
209 * @see connection_profile_destroy()
210 * @see connection_profile_get_name()
212 int connection_profile_create(connection_profile_type_e type, const char* keyword, connection_profile_h* profile);
216 * @brief Destroys a profile handle.
217 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
218 * @param[out] profile The handle to the profile
219 * @return @c 0 on success,
220 * otherwise a negative error value
221 * @retval #CONNECTION_ERROR_NONE Successful
222 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
223 * @see connection_profile_create()
225 int connection_profile_destroy(connection_profile_h profile);
229 * @brief Clones a profile handle.
231 * @remarks You must release @a cloned_profile using connection_profile_destroy().
232 * @param[out] cloned_profile The handle of the cloned profile
233 * @param[in] origin_profile The handle of the origin profile
234 * @return @c 0 on success,
235 * otherwise a negative error value
236 * @retval #CONNECTION_ERROR_NONE Successful
237 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
238 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
239 * @see connection_profile_destroy()
241 int connection_profile_clone(connection_profile_h* cloned_profile, connection_profile_h origin_profile);
245 * @brief Gets the profile ID.
246 * @details The separate profiles can have the same name.
247 * So, you must use this API instead of connection_profile_get_name() if you want to get the unique identification.
248 * In case you create a profile, this value will be determined when you add the profile.
249 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
250 * @remarks You must release @a profile_id using free().
251 * @param[in] profile The profile handle
252 * @param[out] profile_id The ID of the profile
253 * @return @c 0 on success,
254 * 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_name()
259 * @see connection_add_profile()
261 int connection_profile_get_id(connection_profile_h profile, char** profile_id);
265 * @brief Gets the profile name.
266 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
267 * @remarks You must release @a profile_name using free().
268 * @param[in] profile The profile handle
269 * @param[out] profile_name The name of the profile
270 * @return @c 0 on success,
271 * otherwise a negative error value
272 * @retval #CONNECTION_ERROR_NONE Successful
273 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
274 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
275 * @see connection_profile_get_id()
277 int connection_profile_get_name(connection_profile_h profile, char** profile_name);
281 * @brief Gets the network type.
282 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
283 * @param[in] profile The profile handle
284 * @param[out] type The type of the profile
285 * @return @c 0 on success,
286 * otherwise a negative error value
287 * @retval #CONNECTION_ERROR_NONE Successful
288 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
289 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
291 int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e* type);
295 * @brief Gets the name of the network interface, e.g. eth0 and pdp0.
296 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
297 * @remarks You must release @a interface_name using free().
298 * @param[in] profile The profile handle
299 * @param[out] interface_name The name of the network interface
300 * @return @c 0 on success,
301 * otherwise a negative error value
302 * @retval #CONNECTION_ERROR_NONE Successful
303 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
304 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
306 int connection_profile_get_network_interface_name(connection_profile_h profile, char** interface_name);
310 * @brief Refreshes the profile information.
311 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
313 * @privilege %http://tizen.org/privilege/network.get
314 * @remarks You should call this function in order to get the current information because the profile information can be changed.
315 * @param[in] profile The profile handle
316 * @return @c 0 on success,
317 * otherwise a negative error value
318 * @retval #CONNECTION_ERROR_NONE Successful
319 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
320 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
321 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
322 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
324 int connection_profile_refresh(connection_profile_h profile);
328 * @brief Gets the network type.
329 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
330 * @param[in] profile The profile handle
331 * @param[out] state The state of the profile
332 * @return @c 0 on success,
333 * otherwise a negative error value
334 * @retval #CONNECTION_ERROR_NONE Successful
335 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
336 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
338 int connection_profile_get_state(connection_profile_h profile, connection_profile_state_e* state);
342 * @brief Gets the IP config type.
343 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
344 * @param[in] profile The profile handle
345 * @param[in] address_family The address family
346 * @param[out] type The type of the IP config
347 * @return @c 0 on success,
348 * otherwise a negative error value
349 * @retval #CONNECTION_ERROR_NONE Successful
350 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
351 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
353 int connection_profile_get_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e* type);
357 * @brief Gets the IP address.
358 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
359 * @remarks You must release @a ip_address using free().
360 * @param[in] profile The profile handle
361 * @param[in] address_family The address family
362 * @param[out] ip_address The IP address
363 * @return @c 0 on success,
364 * otherwise a negative error value
365 * @retval #CONNECTION_ERROR_NONE Successful
366 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
367 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
368 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
369 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
371 int connection_profile_get_ip_address(connection_profile_h profile, connection_address_family_e address_family, char** ip_address);
375 * @brief Gets the Subnet Mask.
376 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
377 * @remarks You must release @a subnet_mask using free().
378 * @param[in] profile The profile handle
379 * @param[in] address_family The address family
380 * @param[out] subnet_mask The subnet mask
381 * @return @c 0 on success,
382 * otherwise a negative error value
383 * @retval #CONNECTION_ERROR_NONE Successful
384 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
385 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
386 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
387 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
389 int connection_profile_get_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, char** subnet_mask);
393 * @brief Gets the Gateway address.
394 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
395 * @remarks You must release @a gateway_address using free().
396 * @param[in] profile The profile handle
397 * @param[in] address_family The address family
398 * @param[out] gateway_address The gateway address
399 * @return @c 0 on success,
400 * otherwise a negative error value
401 * @retval #CONNECTION_ERROR_NONE Successful
402 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
403 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
404 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
405 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
407 int connection_profile_get_gateway_address(connection_profile_h profile, connection_address_family_e address_family, char** gateway_address);
411 * @brief Gets the DNS address.
412 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
413 * @remarks The allowance of the DNS address is @c 2. You must release @a dns_address using free().
414 * @param[in] profile The profile handle
415 * @param[in] order The order of DNS address \n
416 * it starts from 1, which means first DNS address
417 * @param[in] address_family The address family
418 * @param[out] dns_address The DNS address
419 * @return @c 0 on success,
420 * otherwise a negative error value
421 * @retval #CONNECTION_ERROR_NONE Successful
422 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
423 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
424 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
425 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
427 int connection_profile_get_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, char** dns_address);
431 * @brief Gets the Proxy type.
432 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
433 * @param[in] profile The profile handle
434 * @param[out] type The type of the proxy
435 * @return @c 0 on success,
436 * otherwise a negative error value
437 * @retval #CONNECTION_ERROR_NONE Successful
438 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
439 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
441 int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e* type);
445 * @brief Gets the Proxy address.
446 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
447 * @remarks You must release @a proxy_address using free().
448 * @param[in] profile The profile handle
449 * @param[in] address_family The address family
450 * @param[out] proxy_address The proxy address
451 * @return @c 0 on success,
452 * otherwise a negative error value
453 * @retval #CONNECTION_ERROR_NONE Successful
454 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
455 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
456 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
457 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
459 int connection_profile_get_proxy_address(connection_profile_h profile, connection_address_family_e address_family, char** proxy_address);
463 * @brief Sets the IP config type.
464 * @details If you set IP config type to #CONNECTION_IP_CONFIG_TYPE_STATIC,
465 * then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
466 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
467 * @param[in] profile The profile handle
468 * @param[in] address_family The address family
469 * @param[in] type The type of the IP config
470 * @return @c 0 on success,
471 * otherwise a negative error value
472 * @retval #CONNECTION_ERROR_NONE Successful
473 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
474 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
476 int connection_profile_set_ip_config_type(connection_profile_h profile, connection_address_family_e address_family, connection_ip_config_type_e type);
480 * @brief Sets the IP address.
481 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
482 * @param[in] profile The profile handle
483 * @param[in] address_family The address family
484 * @param[in] ip_address The IP address. \n
485 * If you set this value to @c NULL, then the existing value will be deleted
486 * @return @c 0 on success,
487 * otherwise a negative error value
488 * @retval #CONNECTION_ERROR_NONE Successful
489 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
490 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
491 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
492 * @see connection_update_profile()
494 int connection_profile_set_ip_address(connection_profile_h profile, connection_address_family_e address_family, const char* ip_address);
498 * @brief Sets the Subnet Mask.
499 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
500 * @param[in] profile The profile handle
501 * @param[in] address_family The address family
502 * @param[in] subnet_mask The subnet mask. \n
503 * If you set this value to @c NULL, then the existing value will be deleted
504 * @return @c 0 on success,
505 * otherwise a negative error value
506 * @retval #CONNECTION_ERROR_NONE Successful
507 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
508 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
509 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
510 * @see connection_update_profile()
512 int connection_profile_set_subnet_mask(connection_profile_h profile, connection_address_family_e address_family, const char* subnet_mask);
516 * @brief Sets the Gateway address.
517 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
518 * @param[in] profile The profile handle
519 * @param[in] address_family The address family
520 * @param[in] gateway_address The gateway address. \n
521 * If you set this value to @c NULL, then the existing value will be deleted
522 * @return @c 0 on success,
523 * otherwise a negative error value
524 * @retval #CONNECTION_ERROR_NONE Successful
525 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
526 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
527 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
528 * @see connection_update_profile()
530 int connection_profile_set_gateway_address(connection_profile_h profile, connection_address_family_e address_family, const char* gateway_address);
534 * @brief Sets the DNS address.
535 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
536 * @remarks The allowance of the DNS address is @c 2.
537 * @param[in] profile The profile handle
538 * @param[in] order The order of the DNS address. \n
539 * It starts from @c 1, which means first DNS address
540 * @param[in] address_family The address family
541 * @param[in] dns_address The DNS address; if you set this value to NULL, then the existing value will be deleted
542 * @return @c 0 on success,
543 * otherwise a negative error value
544 * @retval #CONNECTION_ERROR_NONE Successful
545 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
546 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
547 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
548 * @see connection_update_profile()
550 int connection_profile_set_dns_address(connection_profile_h profile, int order, connection_address_family_e address_family, const char* dns_address);
554 * @brief Sets the Proxy type.
555 * @details If you set the Proxy type to #CONNECTION_PROXY_TYPE_AUTO or #CONNECTION_PROXY_TYPE_MANUAL, then Proxy will be restored.
556 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
557 * @param[in] profile The profile handle
558 * @param[in] type The type of the proxy
559 * @return @c 0 on success,
560 * otherwise a negative error value
561 * @retval #CONNECTION_ERROR_NONE Successful
562 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
563 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
564 * @see connection_update_profile()
566 int connection_profile_set_proxy_type(connection_profile_h profile, connection_proxy_type_e type);
570 * @brief Sets the Proxy address.
571 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
572 * @param[in] profile The profile handle
573 * @param[in] address_family The address family
574 * @param[in] proxy_address The proxy address. \n
575 * If you set this value to @c NULL, then the existing value will be deleted
576 * @return @c 0 on success,
577 * otherwise a negative error value
578 * @retval #CONNECTION_ERROR_NONE Successful
579 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
580 * @retval #CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
581 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
582 * @see connection_update_profile()
584 int connection_profile_set_proxy_address(connection_profile_h profile, connection_address_family_e address_family, const char* proxy_address);
588 * @brief Called when the state of the profile is changed.
589 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
590 * @param[in] state The state
591 * @param[in] user_data The user data passed from the callback registration function
592 * @see connection_profile_set_state_changed_cb()
593 * @see connection_profile_unset_state_changed_cb()
595 typedef void(*connection_profile_state_changed_cb)(connection_profile_state_e state, void* user_data);
599 * @brief Registers the callback that is called when the state of profile is changed.
600 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
601 * @param[in] profile The profile handle
602 * @param[in] callback The callback function to be called
603 * @param[in] user_data The user data passed to the callback function
604 * @return @c 0 on success,
605 * otherwise a negative error value
606 * @retval #CONNECTION_ERROR_NONE Successful
607 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
608 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
609 * @post connection_opened_cb() is invoked when the state of profile is changed.
610 * @see connection_profile_state_changed_cb()
611 * @see connection_profile_unset_state_changed_cb()
613 int connection_profile_set_state_changed_cb(connection_profile_h profile, connection_profile_state_changed_cb callback, void* user_data);
617 * @brief Unregisters the callback that is called when the state of profile is changed.
618 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
619 * @param[in] profile The profile handle
620 * @return @c 0 on success,
621 * otherwise a negative error value
622 * @retval #CONNECTION_ERROR_NONE Successful
623 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
624 * @see connection_profile_state_changed_cb()
625 * @see connection_profile_set_state_changed_cb()
627 int connection_profile_unset_state_changed_cb(connection_profile_h profile);
636 * @addtogroup CAPI_NETWORK_CONNECTION_WIFI_PROFILE_MODULE
642 * @brief Gets the ESSID (Extended Service Set Identifier).
643 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
644 * @remarks You must release @a essid using free().
645 * @param[in] profile The profile handle
646 * @param[out] essid The ESSID
647 * @return @c 0 on success,
648 * otherwise a negative error value
649 * @retval #CONNECTION_ERROR_NONE Successful
650 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
651 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
652 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
654 int connection_profile_get_wifi_essid(connection_profile_h profile, char** essid);
658 * @brief Gets the BSSID (Basic Service Set Identifier).
659 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
660 * @remarks You must release @a bssid using free().
661 * @param[in] profile The profile handle
662 * @param[out] bssid The BSSID
663 * @return @c 0 on success,
664 * otherwise a negative error value
665 * @retval #CONNECTION_ERROR_NONE Successful
666 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
667 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
668 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
670 int connection_profile_get_wifi_bssid(connection_profile_h profile, char** bssid);
674 * @brief Gets the RSSI.
675 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
676 * @param[in] profile The profile handle
677 * @param[out] rssi The RSSI
678 * @return @c 0 on success,
679 * otherwise a negative error value
680 * @retval #CONNECTION_ERROR_NONE Successful
681 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
682 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
684 int connection_profile_get_wifi_rssi(connection_profile_h profile, int* rssi);
688 * @brief Gets the frequency (MHz).
689 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
690 * @param[in] profile The profile handle
691 * @param[out] frequency The frequency
692 * @return @c 0 on success,
693 * otherwise a negative error value
694 * @retval #CONNECTION_ERROR_NONE Successful
695 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
696 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
698 int connection_profile_get_wifi_frequency(connection_profile_h profile, int* frequency);
702 * @brief Gets the max speed (Mbps).
703 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
704 * @param[in] profile The profile handle
705 * @param[out] max_speed The max speed
706 * @return @c 0 on success,
707 * otherwise a negative error value
708 * @retval #CONNECTION_ERROR_NONE Successful
709 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
710 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
712 int connection_profile_get_wifi_max_speed(connection_profile_h profile, int* max_speed);
716 * @brief Gets the security mode of Wi-Fi.
717 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
718 * @param[in] profile The profile handle
719 * @param[out] type The type of Wi-Fi security
720 * @return @c 0 on success,
721 * otherwise a negative error value
722 * @retval #CONNECTION_ERROR_NONE Successful
723 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
724 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
725 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
727 int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e* type);
731 * @brief Gets the security mode of Wi-Fi.
732 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
733 * @param[in] profile The profile handle
734 * @param[out] type The type of Wi-Fi security
735 * @return @c 0 on success,
736 * 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_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e* type);
746 * @brief Checks whether passphrase is required.
747 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
748 * @remarks This function is not valid if security type is #CONNECTION_WIFI_SECURITY_TYPE_EAP.
749 * @param[in] profile The profile handle
750 * @param[out] required @c true if a passphrase is required,
751 * otherwise @c false if a passphrase is not required
752 * @return @c 0 on success,
753 * otherwise a negative error value
754 * @retval #CONNECTION_ERROR_NONE Successful
755 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
756 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
758 int connection_profile_is_wifi_passphrase_required(connection_profile_h profile, bool* required);
762 * @brief Sets the passphrase of the Wi-Fi WPA.
763 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
764 * @param[in] profile The profile handle
765 * @param[in] passphrase The passphrase of Wi-Fi security
766 * @return @c 0 on success,
767 * otherwise a negative error value
768 * @retval #CONNECTION_ERROR_NONE Successful
769 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
770 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
771 * @see connection_update_profile()
773 int connection_profile_set_wifi_passphrase(connection_profile_h profile, const char* passphrase);
777 * @brief Checks whether the WPS (Wi-Fi Protected Setup) is supported.
778 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
779 * @remarks If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
780 * @param[in] profile The profile handle
781 * @param[out] supported @c true if WPS is supported,
782 * otherwise @c false if WPS is not supported
783 * @return @c 0 on success,
784 * otherwise negative error value
785 * @retval #CONNECTION_ERROR_NONE Successful
786 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
787 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
789 int connection_profile_is_wifi_wps_supported(connection_profile_h profile, bool* supported);
798 * @addtogroup CAPI_NETWORK_CONNECTION_CELLULAR_PROFILE_MODULE
804 * @brief Gets the service type.
805 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
806 * @param[in] profile The profile handle
807 * @param[out] type The type of the cellular service
808 * @return @c 0 on success,
809 * otherwise a negative error value
810 * @retval #CONNECTION_ERROR_NONE Successful
811 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
812 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
813 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
815 int connection_profile_get_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e* type);
819 * @brief Gets the APN (access point name).
820 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
821 * @remarks You must release @a apn using free().
822 * @param[in] profile The profile handle
823 * @param[out] apn The name of the APN
824 * @return @c 0 on success,
825 * otherwise a negative error value
826 * @retval #CONNECTION_ERROR_NONE Successful
827 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
828 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
829 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
831 int connection_profile_get_cellular_apn(connection_profile_h profile, char** apn);
835 * @brief Gets the authentication information.
836 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
837 * @remarks You must release @a user_name and @a password using free().
838 * @param[in] profile The profile handle
839 * @param[out] type The type of the authentication
840 * @param[out] user_name The user name
841 * @param[out] password The password
842 * @return @c 0 on success,
843 * otherwise a negative error value
844 * @retval #CONNECTION_ERROR_NONE Successful
845 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
846 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
847 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
848 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
850 int connection_profile_get_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e* type, char** user_name, char** password);
854 * @brief Gets the home URL.
855 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
856 * @remarks You must release @a home_url using free().
857 * @param[in] profile The profile handle
858 * @param[out] home_url The home URL
859 * @return @c 0 on success,
860 * otherwise a negative error value
861 * @retval #CONNECTION_ERROR_NONE Successful
862 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
863 * @retval #CONNECTION_ERROR_OUT_OF_MEMORY Out of memory
864 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
866 int connection_profile_get_cellular_home_url(connection_profile_h profile, char** home_url);
870 * @brief Gets the cellular pdn type.
872 * @param[in] profile The profile handle
873 * @param[out] type The cellular pdn type
874 * @return @c 0 on success,
875 * otherwise negative error value
876 * @retval #CONNECTION_ERROR_NONE Successful
877 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
878 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
879 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
881 int connection_profile_get_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type);
885 * @brief Gets the cellular roam pdn type.
887 * @param[in] profile The profile handle
888 * @param[out] type The cellular pdn type
889 * @return @c 0 on success,
890 * otherwise negative error value
891 * @retval #CONNECTION_ERROR_NONE Successful
892 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
893 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
894 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
896 int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type);
900 * @brief Checks wheter the connection is in roaming state.
901 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
902 * @param[in] profile The profile handle
903 * @param[out] is_roaming @c true if the cellular is roaming,
904 * otherwise @c false if it is not roaming
905 * @return @c 0 on success,
906 * otherwise a negative error value
907 * @retval #CONNECTION_ERROR_NONE Successful
908 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
909 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
911 int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming);
915 * @brief Checks whether the profile is hidden.
916 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
917 * @param[in] profile The profile handle
918 * @param[out] is_hidden @c true if the profile is in hidden,
919 * otherwise @c false if the profile is not hidden
920 * @return @c 0 on success,
921 * otherwise a negative error value
922 * @retval #CONNECTION_ERROR_NONE Successful
923 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
924 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
926 int connection_profile_is_cellular_hidden(connection_profile_h profile, bool* is_hidden);
930 * @brief Checks whether the profile is editable.
931 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
932 * @param[in] profile The profile handle
933 * @param[out] is_editable @c true if the profile is editable,
934 * otherwise @c false if the profile is not editable
935 * @return @c 0 on success,
936 * otherwise a negative error value
937 * @retval #CONNECTION_ERROR_NONE Successful
938 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
939 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
941 int connection_profile_is_cellular_editable(connection_profile_h profile, bool* is_editable);
945 * @brief Checks whether the profile is default.
946 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
947 * @param[in] profile The profile handle
948 * @param[out] is_default @c true if the profile is default,
949 * otherwise @c false if the profile is not default
950 * @return @c 0 on success,
951 * otherwise a negative error value
952 * @retval #CONNECTION_ERROR_NONE Successful
953 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
954 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
956 int connection_profile_is_cellular_default(connection_profile_h profile, bool* is_default);
960 * @brief Sets the service type.
961 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
962 * @param[in] profile The profile handle
963 * @param[in] service_type The type of cellular service
964 * @return @c 0 on success,
965 * otherwise a negative error value
966 * @retval #CONNECTION_ERROR_NONE Successful
967 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
968 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
969 * @see connection_update_profile()
971 int connection_profile_set_cellular_service_type(connection_profile_h profile, connection_cellular_service_type_e service_type);
975 * @brief Sets the APN (Access Point Name).
976 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
977 * @param[in] profile The profile handle
978 * @param[in] apn The name of APN
979 * @return @c 0 on success,
980 * otherwise a negative error value
981 * @retval #CONNECTION_ERROR_NONE Successful
982 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
983 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
984 * @see connection_update_profile()
986 int connection_profile_set_cellular_apn(connection_profile_h profile, const char* apn);
990 * @brief Sets the Authentication information.
991 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
992 * @param[in] profile The profile handle
993 * @param[in] type The type of the authentication
994 * @param[in] user_name The user name
995 * @param[in] password The password
996 * @return @c 0 on success,
997 * otherwise a negative error value
998 * @retval #CONNECTION_ERROR_NONE Successful
999 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1000 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1001 * @see connection_update_profile()
1003 int connection_profile_set_cellular_auth_info(connection_profile_h profile, connection_cellular_auth_type_e type, const char* user_name, const char* password);
1007 * @brief Sets the home URL.
1008 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1009 * @param[in] profile The profile handle
1010 * @param[in] home_url The home URL
1011 * @return @c 0 on success,
1012 * otherwise a negative error value
1013 * @retval #CONNECTION_ERROR_NONE Successful
1014 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1015 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
1016 * @see connection_update_profile()
1018 int connection_profile_set_cellular_home_url(connection_profile_h profile, const char* home_url);
1022 * @brief Sets the cellular pdn type.
1024 * @param[in] profile The profile handle
1025 * @param[in] type The cellular pdn type
1026 * @return @c 0 on success,
1027 * otherwise negative error value
1028 * @retval #CONNECTION_ERROR_NONE Successful
1029 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1030 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1031 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
1033 int connection_profile_set_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type);
1037 * @brief Sets the cellular roam pdn type.
1039 * @param[in] profile The profile handle
1040 * @param[in] type The cellular pdn type
1041 * @return @c 0 on success,
1042 * otherwise negative error value
1043 * @retval #CONNECTION_ERROR_NONE Successful
1044 * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
1045 * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
1046 * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
1047 * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
1049 int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type);
1064 #endif /* __TIZEN_NETWORK_CONNECTION_PROFILE_H__ */