2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 __NETWORK_PM_INTF_H__
19 #define __NETWORK_PM_INTF_H__
25 #endif /* __cplusplus */
28 * @file network-pm-intf.h
29 * @brief This file defines the interface of Profile Manager with the application/Connection Manager.
33 * \addtogroup profile_managing
38 #define DEPRECATED __attribute__((deprecated))
40 /*==================================================================================================
42 ==================================================================================================*/
44 #include "network-pm-wlan.h"
46 /*==================================================================================================
48 ==================================================================================================*/
50 /*==================================================================================================
52 ==================================================================================================*/
55 * @enum net_pdp_type_t
56 * This enumeration defines the pdp protocol type.
61 NET_PDP_TYPE_NONE = 0x00,
71 * @enum net_state_type_t
72 * This enumeration defines the service state type.
77 NET_STATE_TYPE_UNKNOWN = 0x00,
81 NET_STATE_TYPE_FAILURE,
82 /** Association state */
83 NET_STATE_TYPE_ASSOCIATION,
84 /** Configuration state */
85 NET_STATE_TYPE_CONFIGURATION,
89 NET_STATE_TYPE_ONLINE,
91 NET_STATE_TYPE_DISCONNECT,
95 /*==================================================================================================
96 STRUCTURES AND OTHER TYPEDEFS
97 ==================================================================================================*/
101 * Profile data structures: Used between Application and PM Plug-in Interface
105 /** Specifies a protocol type */
106 net_pdp_type_t ProtocolType;
107 /** Specifies a service type(Internet, MMS, WAP, etc...) */
108 net_service_type_t ServiceType;
109 /** Network Access Point Name */
110 char Apn[NET_PDP_APN_LEN_MAX+1];
111 /** Authentication info of the PDP profile */
112 net_auth_info_t AuthInfo;
113 /** Browser Home URL or MMS server URL */
114 char HomeURL[NET_HOME_URL_LEN_MAX+1];
116 char Mcc[NET_SIM_INFO_LEN+1];
118 char Mnc[NET_SIM_INFO_LEN+1];
119 /** Indicates whether the use of static IP or not */
122 /** Indicates Roaming mode */
124 /** This will be deprecated */
127 /** network information */
128 net_dev_info_t net_info;
129 } net_pdp_profile_info_t;
132 * Specific profile information related to each technology type
136 /** PDP Profile Information */
137 net_pdp_profile_info_t Pdp;
138 /** Wifi Profile Information */
139 net_wifi_profile_info_t Wlan;
140 } net_specific_profile_info_t;
143 * This is the profile structure exposed to applications.
147 /** Device Type of the profile */
148 net_device_t profile_type;
150 char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
151 /** Specific profile information */
152 net_specific_profile_info_t ProfileInfo;
154 net_state_type_t ProfileState;
155 /** Favourite flag */
157 } net_profile_info_t;
160 ==================================================================================================
162 ==================================================================================================
165 /*****************************************************************************************/
166 /* net_add_profile API function prototype
167 * int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info);
171 * \brief Add new Profile.
173 * \par Sync (or) Async:
174 * This is a Synchronous API.
176 * \par Important Notes:
181 * \param[in] network_type A type of network service.
182 * \param[in] prof_info A pointer of New created Profile Information to be added.
184 * \par Async Response Message:
187 * \return Return Type (int) \n
188 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
189 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
190 * - NET_ERR_UNKNOWN - Any other error\n
191 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
193 * \par Prospective Clients:
194 * Network Connection Setting Applet, WLAN Setting UI Applet.
196 * \par Example of how this function would be called:
198 * net_profile_info_t prof_info;\n
200 * result = net_add_profile( NET_SERVICE_MMS, &prof_info ); \n
201 * if(result == NET_ERR_NONE)
203 ******************************************************************************************/
204 int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info);
206 /*****************************************************************************************/
207 /* net_delete_profile API function prototype
208 * int net_delete_profile(const char* profile_name);
212 * \brief Delete a specific existing Profile.
213 * (cellular : Delete profile, wifi : forgot AP)
215 * \par Sync (or) Async:
216 * This is a Synchronous API.
218 * \par Important Notes:
223 * \param[in] profile_name Profile name to be deleted.
225 * \par Async Response Message:
228 * \return Return Type (int) \n
229 * - NET_ERR_NONE - indicating that the operation has completed successfully.
230 * - NET_ERR_INVALID_PARAM - Invalid parameter
231 * - NET_ERR_UNKNOWN - Any other error
232 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered
234 * \par Prospective Clients:
235 * Network Connection Setting Applet, WLAN Setting UI Applet.
237 * \par Example of how this function would be called:
241 * result = net_delete_profile(profile_name);
243 * if (result == NET_ERR_NONE)
245 ******************************************************************************************/
246 int net_delete_profile(const char *profile_name);
248 /*****************************************************************************************/
249 /* net_get_profile_info API function prototype
250 * int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info);
254 * \brief Return the profile information referred by Profile Name.
256 * \par Sync (or) Async:
257 * This is a Synchronous API.
259 * \par Important Notes:
260 * On success, profile information shall be copied to prof_info parameter in net_profile_info_t format.
261 * If profile doesn't exist, error shall be returned.
266 * \param[in] profile_name Profile Identifier.
267 * \param[out] prof_info Buffer containing the profile.
269 * \par Async Response Message:
272 * \return Return Type (int) \n
273 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
274 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
275 * - NET_ERR_UNKNOWN - Any other error\n
276 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
278 * \par Prospective Clients:
281 * \par Example of how this function would be called:
283 * net_profile_info_t prof_info;\n
286 * result = net_get_profile_info(profile_name, &prof_info);\n
288 * if (result == NET_ERR_NONE)\n
290 ******************************************************************************************/
291 int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info);
293 /*****************************************************************************************/
294 /* net_modify_profile API function prototype
295 * int net_modify_profile(const char* profile_name, net_profile_info_t* prof_info);
299 * \brief Edit a specific existing Profile.
301 * \par Sync (or) Async:
302 * This is a Synchronous API.
304 * \par Important Notes:
309 * \param[in] profile_name Profile Identifier.
310 * \param[in] prof_info Changed Profile Information to be updated.
313 * \par Async Response Message:
316 * \return Return Type (int) \n
317 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
318 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
319 * - NET_ERR_UNKNOWN - Any other error\n
320 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
322 * \par Prospective Clients:
323 * Network Connection Setting Applet.
325 * \par Example of how this function would be called:
327 * net_profile_info_t prof_info;\n
330 * result = net_get_profile_info(profile_name, &prof_info);\n
331 * ......(Modifying ProfInfo)\n
333 * result = net_modify_profile(profile_name, &prof_info);\n
335 * if (result == NET_ERR_NONE)\n
337 ******************************************************************************************/
338 int net_modify_profile(const char *profile_name, net_profile_info_t *prof_info);
340 /*****************************************************************************************/
342 * @fn int net_get_profile_list(net_device_t device_type, net_profile_info_t **profile_list, int *count)
344 * This function request service list to ConnMan through dbus.
346 * \par Sync (or) Async:
347 * This is a Synchronous API.
349 * \param[in] device_type Type of device
350 * \param[out] profile_list Profile list. After use this, it should be free()
351 * \param[out] count Number of profile
353 * \return Return Type (int) \n
354 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
355 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
356 * - NET_ERR_UNKNOWN - Any other error\n
357 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
359 * \par Prospective Clients:
362 ******************************************************************************************/
363 int net_get_profile_list(net_device_t device_type, net_profile_info_t **profile_list, int *count);
371 #endif /* __cplusplus */