Add API to get access list
[platform/core/connectivity/libwifi-direct.git] / include / wifi-direct.h
1 /*
2  * libwifi-direct
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __WIFI_DIRECT_INTERFACE_H_
23 #define __WIFI_DIRECT_INTERFACE_H_
24
25 #include <errno.h>
26 #include <stdbool.h>
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32
33
34 /**
35  * @addtogroup CAPI_NET_WIFI_DIRECT_MODULE
36  * @{
37  */
38
39 /**
40  * @brief Enumeration for Wi-Fi Direct error code
41  */
42 typedef enum
43 {
44         WIFI_DIRECT_ERROR_NONE = 0,  /**< Successful */
45         WIFI_DIRECT_ERROR_NOT_PERMITTED = -EPERM,  /** Operation not permitted(1) */
46         WIFI_DIRECT_ERROR_OUT_OF_MEMORY = -ENOMEM,  /** Out of memory(12) */
47         WIFI_DIRECT_ERROR_RESOURCE_BUSY = -EBUSY,  /** Device or resource busy(16) */
48         WIFI_DIRECT_ERROR_INVALID_PARAMETER = -EINVAL,  /** Invalid function parameter(22) */
49         WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT = -ETIMEDOUT,  /**< Connection timed out(110) */
50         WIFI_DIRECT_ERROR_NOT_INITIALIZED = -0x00008000|0x0201,  /**< Not initialized */
51         WIFI_DIRECT_ERROR_COMMUNICATION_FAILED = -0x00008000|0x0202,  /**< I/O error */
52         WIFI_DIRECT_ERROR_WIFI_USED = -0x00008000|0x0203,  /**< WiFi is being used */
53         WIFI_DIRECT_ERROR_MOBILE_AP_USED = -0x00008000|0x0204,  /**< Mobile AP is being used */
54         WIFI_DIRECT_ERROR_CONNECTION_FAILED = -0x00008000|0x0205,  /**< Connection failed */
55         WIFI_DIRECT_ERROR_AUTH_FAILED = -0x00008000|0x0206,  /**< Authentication failed */
56         WIFI_DIRECT_ERROR_OPERATION_FAILED = -0x00008000|0x0207,  /**< Operation failed */
57         WIFI_DIRECT_ERROR_TOO_MANY_CLIENT = -0x00008000|0x0208,  /**< Too many client */
58         WIFI_DIRECT_ERROR_ALREADY_INITIALIZED = -0x00008000|0x0209,  /**< Already initialized client */
59         WIFI_DIRECT_ERROR_CONNECTION_CANCELED,  /**< Connection canceled by local device */
60 } wifi_direct_error_e;
61
62 /**
63  * @brief Enumeration for Wi-Fi Direct link status
64  */
65 typedef enum
66 {
67         WIFI_DIRECT_STATE_DEACTIVATED = 0,
68                                                                         /**< */
69         WIFI_DIRECT_STATE_DEACTIVATING, /**< */
70         WIFI_DIRECT_STATE_ACTIVATING,           /**< */
71         WIFI_DIRECT_STATE_ACTIVATED,            /**< */
72         WIFI_DIRECT_STATE_DISCOVERING,  /**< */
73         WIFI_DIRECT_STATE_CONNECTING,   /**< */
74         WIFI_DIRECT_STATE_DISCONNECTING,        /**< */
75         WIFI_DIRECT_STATE_CONNECTED,            /**< */
76         WIFI_DIRECT_STATE_GROUP_OWNER   /**< */
77 } wifi_direct_state_e;
78
79 /**
80  * @brief Enumeration for Wi-Fi Direct device state
81  */
82 typedef enum
83 {
84         WIFI_DIRECT_DEVICE_STATE_ACTIVATED,
85         WIFI_DIRECT_DEVICE_STATE_DEACTIVATED,
86 } wifi_direct_device_state_e;
87
88 /**
89  * @brief Enumeration for Wi-Fi Direct discovery state
90  */
91 typedef enum
92 {
93         WIFI_DIRECT_ONLY_LISTEN_STARTED,
94         WIFI_DIRECT_DISCOVERY_STARTED,
95         WIFI_DIRECT_DISCOVERY_FOUND,
96         WIFI_DIRECT_DISCOVERY_FINISHED,
97 } wifi_direct_discovery_state_e;
98
99 /**
100  * @brief Enumeration for Wi-Fi Direct connection state
101  */
102 typedef enum
103 {
104         WIFI_DIRECT_CONNECTION_REQ,                     /**< */
105         WIFI_DIRECT_CONNECTION_WPS_REQ,         /**< */
106         WIFI_DIRECT_CONNECTION_IN_PROGRESS,                     /**< */
107         WIFI_DIRECT_CONNECTION_RSP,                     /**< */
108         WIFI_DIRECT_DISASSOCIATION_IND,                 /**< */
109         WIFI_DIRECT_DISCONNECTION_RSP,                  /**< */
110         WIFI_DIRECT_DISCONNECTION_IND,                  /**< */
111         WIFI_DIRECT_GROUP_CREATED,                      /**< */
112         WIFI_DIRECT_GROUP_DESTROYED,                    /**< */
113         WIFI_DIRECT_INVITATION_REQ,
114 } wifi_direct_connection_state_e;
115
116 /**
117  * @brief Enumeration for Wi-Fi Direct secondary device type
118  */
119 typedef enum
120 {
121         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_PC = 1,                      /**< */
122         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_SERVER = 2,          /**< */
123         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_MEDIA_CTR = 3,       /**< */
124         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_UMPC = 4,            /**< */
125         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_NOTEBOOK = 5,        /**< */
126         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_DESKTOP = 6,         /**< */
127         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_MID = 7,                     /**< */
128         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_NETBOOK = 8,         /**< */
129         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_KEYBOARD = 1,                           /**< */
130         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_MOUSE = 2,                      /**< */
131         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_JOYSTICK = 3,           /**< */
132         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_TRACKBALL = 4,          /**< */
133         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_CONTROLLER = 5,         /**< */
134         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_REMOTE = 6,                     /**< */
135         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_TOUCHSCREEN = 7,/**< */
136         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_BIO_READER = 8,         /**< */
137         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_BAR_READER = 9,         /**< */
138         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_PRINTER = 1,          /**< */
139         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_SCANNER = 2,          /**< */
140         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_FAX = 3,                              /**< */
141         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_COPIER = 4,           /**< */
142         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_ALLINONE = 5,         /**< */
143         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_DIGITAL_STILL = 1,             /**< */
144         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_VIDEO = 2,                     /**< */
145         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_WEBCAM = 3,            /**< */
146         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_SECONDARYURITY = 4,    /**< */
147         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_STORAGE_NAS = 1,                      /**< */
148         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_AP = 1,                                 /**< */
149         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_ROUTER = 2,                     /**< */
150         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_SWITCH = 3,                     /**< */
151         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_GATEWAY = 4,            /**< */
152         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_TV = 1,                               /**< */
153         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_PIC_FRAME = 2,        /**< */
154         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_PROJECTOR = 3,        /**< */
155         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_MONITOR = 4,          /**< */
156         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_DAR = 1,                           /**< */
157         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVR = 2,                           /**< */
158         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MCX = 3,                           /**< */
159         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB = 4,                           /**< */
160         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MSMAME = 5,                /**< */
161         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP = 6,                           /**< */
162         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_XBOX = 1,                /**< */
163         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_XBOX_360 = 2,    /**< */
164         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_PS = 3,                          /**< */
165         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_CONSOLE = 4,             /**< */
166         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_PORTABLE = 5,    /**< */
167         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_WM = 1,                 /**< */
168         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SINGLE = 2,             /**< */
169         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_DUAL = 3,               /**< */
170         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SM_SINGLE = 4,
171                                                                                                                 /**< */
172         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SM_DUAL = 5,    /**< */
173         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER = 1,              /**< */
174         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_SPEAKER = 2,    /**< */
175         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_PMP = 3,                /**< */
176         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_HEADSET = 4,    /**< */
177         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_HEADPHONE = 5,
178                                                                                                                 /**< */
179         WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_MIC = 6,                /**< */
180 } wifi_direct_secondary_device_type_e;
181
182 /**
183  * @brief Enumeration for Wi-Fi Direct primary device type
184  */
185 typedef enum
186 {
187         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_COMPUTER = 1,           /**< */
188         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_INPUT_DEVICE = 2,       /**< */
189         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_PRINTER = 3,            /**< */
190         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_CAMERA = 4,             /**< */
191         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_STORAGE = 5,            /**< */
192         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_NETWORK_INFRA = 6,              /**< */
193         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_DISPLAY = 7,            /**< */
194         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_MULTIMEDIA_DEVICE = 8,          /**< */
195         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_GAME_DEVICE = 9,        /**< */
196         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_TELEPHONE = 10, /**< */
197         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_AUDIO = 11,             /**< */
198         WIFI_DIRECT_PRIMARY_DEVICE_TYPE_OTHER = 255                     /**< */
199 } wifi_direct_primary_device_type_e;
200
201 /**
202 * @brief Enumeration for Wi-Fi WPS type
203 */
204 typedef enum {
205         WIFI_DIRECT_WPS_TYPE_NONE = 0x00,  /**< No WPS type */
206         WIFI_DIRECT_WPS_TYPE_PBC = 0x01,  /**< Push Button Configuration */
207         WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY = 0x02,  /**< Display PIN code */
208         WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD = 0x04,  /**< Provide the keypad to input the PIN */
209 } wifi_direct_wps_type_e;
210
211
212 /**
213 * @brief Service Discovery type enumerations
214 */
215 typedef enum
216 {
217         WIFI_DIRECT_SERVICE_ALL,
218         WIFI_DIRECT_SERVICE_BONJOUR,
219         WIFI_DIRECT_SERVICE_UPNP,
220         WIFI_DIRECT_SERVICE_WSDISCOVERY,
221         WIFI_DIRECT_SERVICE_WIFIDISPLAY,
222         WIFI_DIRECT_SERVICE_VENDORSPEC = 0xff,
223 } wifi_direct_service_type_e;
224
225 typedef enum
226 {
227         WIFI_DIRECT_DISPLAY_SOURCE,
228         WIFI_DIRECT_DISPLAY_PRIMARY_SINK,
229         WIFI_DIRECT_DISPLAY_SECONDARY_SINK,
230         WIFI_DIRECT_DISPLAY_DUAL_ROLE,
231 }wifi_direct_display_type_e;
232
233 /**
234  * @struct wifi_direct_discovered_peer_info_s
235  * Wi-Fi Direct buffer structure to store result of peer discovery
236  */
237 typedef struct
238 {
239         int allowed;            /** Is device allowed**/
240         char *device_name;      /** Null-terminated device friendly name. */
241         char *mac_address;      /** Device's P2P Device Address */
242 } wifi_direct_access_list_info_s;
243
244
245 /**
246  * @struct wifi_direct_discovered_peer_info_s
247  * Wi-Fi Direct buffer structure to store result of peer discovery
248  */
249 typedef struct
250 {
251         char *device_name;  /** Null-terminated device friendly name. */
252         char *mac_address;  /** Device's P2P Device Address */
253         char *interface_address;  /** Device's P2P Interface Address. Valid only if device is a P2P GO. */
254         int channel;  /** Channel the device is listening on. */
255         bool is_connected;  /** Is peer connected*/
256         bool is_group_owner;  /** Is an active P2P Group Owner */
257         bool is_persistent_group_owner;  /** Is a stored Persistent GO */
258         wifi_direct_primary_device_type_e primary_device_type;  /** Primary category of device */
259         wifi_direct_secondary_device_type_e secondary_device_type;  /** Sub category of device */
260         int supported_wps_types;  /** The list of supported WPS type. \n
261         The OR operation on #wifi_direct_wps_type_e can be used like #WIFI_DIRECT_WPS_TYPE_PBC | #WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY */
262         char *ssid;  /**< Service set identifier - DEPRECATED */
263         unsigned int service_count;
264         char **service_list;
265         bool is_wfd_device;
266 } wifi_direct_discovered_peer_info_s;
267
268
269 /**
270  * @struct wifi_direct_connected_peer_info_s
271  * Wi-Fi Direct buffer structure to store information of connected peer
272  */
273 typedef struct
274 {
275         char* device_name;  /** Device friendly name. */
276         char* ip_address;  /**< The IP address */
277         char* mac_address;  /** Device's P2P Device Address */
278         char* interface_address;  /** Device's P2P Interface Address */
279         bool p2p_supported;  /* whether peer is a P2P device */
280         wifi_direct_primary_device_type_e       primary_device_type;  /* primary category of device */
281         int channel;  /* Operating channel */
282         char* ssid;  /**< Service set identifier - DEPRECATED */
283         unsigned int service_count;
284         char **service_list;
285         bool is_wfd_device;
286 } wifi_direct_connected_peer_info_s;
287
288 /**
289  * Notification callback function type. \n
290  *
291  * Discover notifications can occur at the peers or P2P groups are found.
292  *
293  * @param event             Specifies the types of notifications.
294  *                          - WIFI_DIRECT_DISCOVERY_STARTED
295  *                          - WIFI_DIRECT_ONLY_LISTEN_STARTED
296  *                          - WIFI_DIRECT_DISCOVERY_FOUND
297  *                          - WIFI_DIRECT_DISCOVERY_FINISHED
298  * @param error_code        In failure case.
299  * @param user_data         User can transfer the user specific data in callback.
300  *
301  */
302 typedef void (*wifi_direct_discovery_state_chagned_cb) (int error_code,
303                                                                                                                 wifi_direct_discovery_state_e discovery_state,
304                                                                                                                 void *user_data);
305
306 /**
307  * Notification callback function type. \n
308  *
309  * Activation notifications callback function type.
310  *
311  * @param event             Specifies the types of notifications.
312  *                          - WIFI_DIRECT_DEVICE_STATE_ACTIVATED
313  *                          - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED
314  * @param error_code        In failure case.
315  * @param user_data         User can transfer the user specific data in callback.
316  *
317  */
318 typedef void (*wifi_direct_device_state_changed_cb) (int error_code,
319                                                                                                          wifi_direct_device_state_e device_state,
320                                                                                                          void *user_data);
321
322 /**
323  * connection notification callback function type. \n
324  *
325  * @param event             Specifies the types of notifications.
326  *                          - WIFI_DIRECT_CONNECTION_REQ
327  *                          - WIFI_DIRECT_CONNECTION_WPS_REQ
328  *                          - WIFI_DIRECT_CONNECTION_IN_PROGRESS
329  *                          - WIFI_DIRECT_CONNECTION_RSP
330  *                          - WIFI_DIRECT_DISASSOCIATION_IND
331  *                          - WIFI_DIRECT_DISCONNECTION_RSP
332  *                          - WIFI_DIRECT_DISCONNECTION_IND
333  *                          - WIFI_DIRECT_GROUP_CREATED
334  *                          - WIFI_DIRECT_GROUP_DESTROYED
335  *
336  * @param error_code        In failure case.
337  *
338  * @param param1        additional data for connection. ex) MAC
339  * @param param2        additional data for connection. ex) SSID
340  *
341  * @param user_data         User can transfer the user specific data in callback.
342  *
343  */
344 typedef void (*wifi_direct_connection_state_changed_cb) (int error_code,
345                                                                                                                  wifi_direct_connection_state_e connection_state,
346                                                                                                                  const char *mac_address,
347                                                                                                                  void *user_data);
348
349 /**
350 * @brief Called when IP address of client is assigned when your device is group owner.
351 * @param[in] mac_address  The MAC address of connection peer
352 * @param[in] ip_address  The IP address of connection peer
353 * @param[in] interface_address  The interface address of connection peer
354 * @param[in] user_data  The user data passed from the callback registration function
355 * @see wifi_direct_set_client_ip_address_assigned_cb()
356 * @see wifi_direct_unset_client_ip_address_assigned_cb()
357 */
358 typedef void (*wifi_direct_client_ip_address_assigned_cb) (const char *mac_address,
359                                                                                                                  const char *ip_address,
360                                                                                                                  const char *interface_address,
361                                                                                                                  void *user_data);
362
363 /*=============================================================================
364                                          Wifi Direct Client APIs
365 =============================================================================*/
366
367 /*****************************************************************************/
368 /* wifi_direct_initialize API function prototype
369  * int wifi_direct_initialize (void);
370  */
371 /**
372  * \brief       This API shall register the client application with the Wi-Fi Direct server and  initialize the various variables. \n
373  *
374  * \pre None.
375  *
376  * \post Application is registered.
377  *
378  * \see wifi_direct_device_state_changed_cb
379  * \see wifi_direct_discovery_state_chagned_cb
380  * \see wifi_direct_connection_state_changed_cb
381  *
382  * \par Sync (or) Async:
383  * This is a Synchronous API.
384  *
385  * \warning
386  *  None
387  *
388  * \return Return Type (int) \n
389  *
390  * - WIFI_DIRECT_ERROR_NONE on success \n
391  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
392  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
393  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
394  * - WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for "Too many users" \n
395  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
396  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
397  *
398  * \par Prospective Clients:
399  * External Apps.
400  *
401  * \remarks None.
402  * \code
403  *
404  * #include <wifi-direct.h>
405  *
406  * void foo(void)
407  * {
408  *
409  * int result;
410  *
411  * result = wifi_direct_initialize();
412  *
413  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully connected to the wifi direct server
414  *
415  * \endcode
416  ******************************************************************************/
417 int wifi_direct_initialize(void);
418
419
420 /*****************************************************************************************/
421 /* wifi_direct_deinitialize API function prototype
422  * int wifi_direct_deinitialize(void);
423  */
424
425 /**
426  * \brief This API shall deregister the client application with the Wi-Fi Direct server and releases all resources.
427  *
428  * \pre Application must be already registered to the Wi-Fi Direct server.
429  *
430  * \post Application is de-registered.
431  *
432  * \see wifi_direct_initialize
433  *
434  * \par Sync (or) Async:
435  * This is a Synchronous API.
436  *
437  * \warning
438  *  None
439  *
440  *
441  * \par Async Response Message:
442  *        None
443  *
444  *
445  * \return Return Type (int) \n
446  * - WIFI_DIRECT_ERROR_NONE on success \n
447  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
448  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
449  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
450  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
451  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
452  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
453  *
454  * \par Prospective Clients:
455  * External Apps.
456  *
457  * \code
458  *
459  * #include <wifi-direct.h>
460  *
461  * void foo(void)
462  * {
463
464  * int result;
465  *
466  * result = wifi_direct_deinitialize();
467  *
468  * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deregister is successful
469  *
470  *\endcode
471  *
472  *\remarks None.
473  *
474  ******************************************************************************/
475 int wifi_direct_deinitialize(void);
476
477
478 /*****************************************************************************/
479 /* wifi_direct_set_connection_state_changed_cb API function prototype
480  * int wifi_direct_set_connection_state_changed_cb(wifi_direct_device_state_changed_cb cb, void* user_data)
481  */
482 /**
483  * \brief       This API shall register the activation callback function and user data from client. \n
484  *
485  * \pre The Client should be initialized.
486  *
487  * \see wifi_direct_initialize
488  * \see wifi_direct_device_state_changed_cb
489  *
490  * \par Sync (or) Async:
491  * This is a Synchronous API.
492  *
493  * \warning
494  *  None
495  *
496  * \param[in] cb    Application Callback function pointer to receive Wi-Fi Direct events
497  * \param[in] user_data    user data
498  *
499  * \return Return Type (int) \n
500  *
501  * - WIFI_DIRECT_ERROR_NONE on success \n
502  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
503  *
504  * \par Prospective Clients:
505  * External Apps.
506  *
507  * \remarks None.
508  * \code
509  *
510  * #include <wifi-direct.h>
511  *
512  * void foo(void)
513  * {
514  *
515  * int result;
516  *
517  * result = wifi_direct_set_connection_state_changed_cb(_cb_activation, void* user_data);
518  *
519  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
520  *
521  * \endcode
522  ******************************************************************************/
523 int wifi_direct_set_device_state_changed_cb(wifi_direct_device_state_changed_cb cb, void *user_data);
524
525
526 /*****************************************************************************/
527 /* wifi_direct_unset_connection_state_changed_cb API function prototype
528  * int wifi_direct_unset_connection_state_changed_cb(void)
529  */
530 /**
531  * \brief       This API shall deregister the activation callback function and user data from client. \n
532  *
533  * \pre The Client should be initialized.
534  *
535  * \see wifi_direct_initialize
536  * \see wifi_direct_set_connection_state_changed_cb
537  *
538  * \par Sync (or) Async:
539  * This is a Synchronous API.
540  *
541  * \warning
542  *  None
543  *
544  * \return Return Type (int) \n
545  *
546  * - WIFI_DIRECT_ERROR_NONE on success \n
547  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
548  *
549  * \par Prospective Clients:
550  * External Apps.
551  *
552  * \remarks None.
553  * \code
554  *
555  * #include <wifi-direct.h>
556  *
557  * void foo(void)
558  * {
559  *
560  * int result;
561  *
562  * result = wifi_direct_unset_connection_state_changed_cb();
563  *
564  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
565  *
566  * \endcode
567  ******************************************************************************/
568 int wifi_direct_unset_device_state_changed_cb(void);
569
570
571
572 /*****************************************************************************/
573 /* wifi_direct_set_discovery_state_changed_cb API function prototype
574  * int wifi_direct_set_discover_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void* user_data)
575  */
576 /**
577  * \brief       This API shall register the discover callback function and user data from client. \n
578  *
579  * \pre The Client should be initialized.
580  *
581  * \see wifi_direct_initialize
582  * \see wifi_direct_discovery_state_chagned_cb
583  *
584  * \par Sync (or) Async:
585  * This is a Synchronous API.
586  *
587  * \warning
588  *  None
589  *
590  * \param[in] cb    Application Callback function pointer to receive Wi-Fi Direct events
591  * \param[in] user_data    user data
592  *
593  * \return Return Type (int) \n
594  *
595  * - WIFI_DIRECT_ERROR_NONE on success \n
596  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
597  *
598  * \par Prospective Clients:
599  * External Apps.
600  *
601  * \remarks None.
602  * \code
603  *
604  * #include <wifi-direct.h>
605  *
606  * void foo(void)
607  * {
608  *
609  * int result;
610  *
611  * result = wifi_direct_set_discovery_state_changed_cb(_cb_discover, void* user_data);
612  *
613  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
614  *
615  * \endcode
616  ******************************************************************************/
617 int wifi_direct_set_discovery_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void *user_data);
618
619
620 /*****************************************************************************/
621 /* wifi_direct_unset_discovery_state_changed_cb API function prototype
622  * int wifi_direct_unset_discovery_state_changed_cb(void)
623  */
624 /**
625  * \brief       This API shall deregister the discover callback function and user data from client. \n
626  *
627  * \pre The Client should be initialized.
628  *
629  * \see wifi_direct_initialize
630  * \see wifi_direct_set_discovery_state_changed_cb
631  *
632  * \par Sync (or) Async:
633  * This is a Synchronous API.
634  *
635  * \warning
636  *  None
637  *
638  * \return Return Type (int) \n
639  *
640  * - WIFI_DIRECT_ERROR_NONE on success \n
641  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
642  *
643  * \par Prospective Clients:
644  * External Apps.
645  *
646  * \remarks None.
647  * \code
648  *
649  * #include <wifi-direct.h>
650  *
651  * void foo(void)
652  * {
653  *
654  * int result;
655  *
656  * result = wifi_direct_unset_discovery_state_changed_cb();
657  *
658  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
659  *
660  * \endcode
661  ******************************************************************************/
662 int wifi_direct_unset_discovery_state_changed_cb(void);
663
664
665
666 /*****************************************************************************/
667 /* wifi_direct_set_connection_state_changed_cb API function prototype
668  * int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void* user_data)
669  */
670 /**
671  * \brief       This API shall register the connection callback function and user data from client. \n
672  *
673  * \pre The Client should be initialized.
674  *
675  * \see wifi_direct_initialize
676  * \see wifi_direct_connection_state_changed_cb
677  *
678  * \par Sync (or) Async:
679  * This is a Synchronous API.
680  *
681  * \warning
682  *  None
683  *
684  * \param[in] cb    Application Callback function pointer to receive Wi-Fi Direct events
685  * \param[in] user_data    user data
686  *
687  * \return Return Type (int) \n
688  *
689  * - WIFI_DIRECT_ERROR_NONE on success \n
690  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
691  *
692  * \par Prospective Clients:
693  * External Apps.
694  *
695  * \remarks None.
696  * \code
697  *
698  * #include <wifi-direct.h>
699  *
700  * void foo(void)
701  * {
702  *
703  * int result;
704  *
705  * result = wifi_direct_set_connection_state_changed_cb(_cb_connection, void* user_data);
706  *
707  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
708  *
709  * \endcode
710  ******************************************************************************/
711 int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void *user_data);
712
713
714 /*****************************************************************************/
715 /* wifi_direct_unset_connection_state_changed_cb API function prototype
716  * int wifi_direct_unset_connection_state_changed_cb(void)
717  */
718 /**
719  * \brief       This API shall deregister the connection callback function and user data from client. \n
720  *
721  * \pre The Client should be initialized.
722  *
723  * \see wifi_direct_initialize
724  * \see wifi_direct_set_connection_state_changed_cb
725  *
726  * \par Sync (or) Async:
727  * This is a Synchronous API.
728  *
729  * \warning
730  *  None
731  *
732  * \return Return Type (int) \n
733  *
734  * - WIFI_DIRECT_ERROR_NONE on success \n
735  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
736  *
737  * \par Prospective Clients:
738  * External Apps.
739  *
740  * \remarks None.
741  * \code
742  *
743  * #include <wifi-direct.h>
744  *
745  * void foo(void)
746  * {
747  *
748  * int result;
749  *
750  * result = wifi_direct_unset_connection_state_changed_cb();
751  *
752  * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
753  *
754  * \endcode
755  ******************************************************************************/
756 int wifi_direct_unset_connection_state_changed_cb(void);
757
758
759 /**
760 * @brief Registers the callback called when IP address of client is assigned when your device is group owner.
761 * @param[in] cb  The callback function to invoke
762 * @param[in] user_data  The user data to be passed to the callback function
763 * @return 0 on success, otherwise a negative error value.
764 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
765 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
766 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
767 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
768 * @see wifi_direct_initialize()
769 * @see wifi_direct_unset_client_ip_address_assigned_cb()
770 * @see wifi_direct_client_ip_address_assigned_cb()
771 */
772 int wifi_direct_set_client_ip_address_assigned_cb(wifi_direct_client_ip_address_assigned_cb cb, void *user_data);
773
774
775 /**
776 * @brief Unregisters the callback called when IP address of client is assigned when your device is group owner.
777 * @return 0 on success, otherwise a negative error value.
778 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
779 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
780 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
781 * @see wifi_direct_initialize()
782 * @see wifi_direct_set_connection_state_changed_cb()
783 */
784 int wifi_direct_unset_client_ip_address_assigned_cb(void);
785
786
787 /*****************************************************************************************/
788 /* wifi_direct_activate API function prototype
789  * int wifi_direct_activate(void);
790  */
791
792 /**
793  * \brief This API shall open a wireless adapter device for P2P use.
794
795  * \pre Application must be already registered to the Wi-Fi Direct server.
796  *
797  * \post wireless adapter device will be ready to use.
798  *
799  * \see wifi_direct_initialize
800  *
801  * \par Sync (or) Async:
802  * This is a Asynchronous API.
803  *
804  * \warning
805  *  None
806  *
807  *
808  * \par Async Response Message:
809  *  - WIFI_DIRECT_DEVICE_STATE_ACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when activation  process is completed. \n
810  *
811  *
812  * \return Return Type (int*) \n
813  * - WIFI_DIRECT_ERROR_NONE on success \n
814  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
815  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
816  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
817  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
818  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
819  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
820  * - WIFI_DIRECT_ERROR_WIFI_USED for "WiFi is being used" \n
821  * - WIFI_DIRECT_ERROR_MOBILE_AP_USED for "Mobile AP is being used" \n
822  *
823  *
824  * \par Prospective Clients:
825  * External Apps.
826  *
827  * \code
828  *
829  * #include <wifi-direct.h>
830  *
831  * void foo(void)
832  * {
833
834  * int result;
835  *
836  * result = wifi_direct_activate();
837  *
838  * if(result == WIFI_DIRECT_ERROR_NONE)......... // activation is successful
839  *
840  *\endcode
841  *
842  *\remarks None.
843  *
844  ******************************************************************************/
845 int wifi_direct_activate(void);
846
847
848 /*****************************************************************************************/
849 /* wifi_direct_deactivate API function prototype
850  * int wifi_direct_deactivate(void);
851  */
852
853 /**
854  * \brief This API shall close a wireless adapter device for P2P use
855
856  * \pre Wireless adapter device must be already opened.
857  *
858  * \post wireless adapter device will be closed.
859  *
860  * \see wifi_direct_activate
861  *
862  * \par Sync (or) Async:
863  * This is a Asynchronous API.
864  *
865  * \warning
866  *  None
867  *
868  *
869  * \par Async Response Message:
870  *  - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when deactivation  process is completed. \n
871
872  * \return Return Type (int) \n
873  * - WIFI_DIRECT_ERROR_NONE on success \n
874  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
875  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
876  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
877  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
878  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
879  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
880  *
881  *
882  * \par Prospective Clients:
883  * External Apps.
884  *
885  * \code
886  *
887  * #include <wifi-direct.h>
888  *
889  * void foo(void)
890  * {
891  * int result;
892  *
893  * result = wifi_direct_deactivate();
894  *
895  * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deactivation is successful
896  *
897  *\endcode
898  *
899  *\remarks None.
900  *
901  ******************************************************************************/
902 int wifi_direct_deactivate(void);
903
904
905 /*****************************************************************************************/
906 /* wifi_direct_start_discovery API function prototype
907  * int wifi_direct_start_discovery(bool listen_only, int timeout);
908  */
909 /**
910  * \brief This API shall Start a discovery to find all P2P capable devices. \n
911  *        Applications will be notified event via wifi_direct_discovery_state_chagned_cb(). \n
912  *
913  * @param listen_only    if true, skip the initial 802.11 scan and then enter
914  *                       Listen state instead of cycling between Search and Listen.
915  * @param timeout        Specifies the duration of discovery period, in seconds.
916  *                       APs. If 0, a default value will be used, which depends on UX guideline.
917  *
918  * \pre Wireless adapter device must be already opened.
919  *
920  *
921  * \see wifi_direct_get_discovery_result
922  *
923  * \par Sync (or) Async:
924  * This is a Asynchronous API.
925  *
926  * \warning
927  *  None
928  *
929  *
930  * \par Async Response Message:
931  *  - WIFI_DIRECT_DISCOVERY_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (80211 Scan) started. \n
932  *  - WIFI_DIRECT_ONLY_LISTEN_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (listen only mode) started. \n
933  *  - WIFI_DIRECT_DISCOVERY_FOUND : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when peer or group is found. \n
934  *  - WIFI_DIRECT_DISCOVERY_FINISHED : Once the whole discovery process is completed, applications will receive it via wifi_direct_discovery_state_chagned_cb (). \n
935  *                                 Applications may then call wifi_direct_foreach_discovered_peers() to get the final result.  \n
936  *                                 With the intermediate or final list of P2P capable devices, applications can update their UI if needed. \n
937  *                                 It is up to the applications to control how often to update their UI display. \n
938  *
939  *
940  * \return Return Type (int) \n
941  * - WIFI_DIRECT_ERROR_NONE on success \n
942  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
943  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
944  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
945  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
946  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
947  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
948  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
949  *
950  *
951  * \par Prospective Clients:
952  * External Apps.
953  *
954  * \code
955  *
956  * #include <wifi-direct.h>
957  *
958  * void foo(void)
959  * {
960
961  * int result;
962  *
963  * result = wifi_direct_start_discovery(TRUE, 0);
964  *
965  * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery request is successful
966  *
967  *\endcode
968  *
969  *\remarks If discover is over, peer can not find the device and the device can not find peer, too.
970  *
971  ******************************************************************************/
972 int wifi_direct_start_discovery(bool listen_only, int timeout);
973
974
975 /*****************************************************************************************/
976 /* wifi_direct_cancel_discovery API function prototype
977  * int wifi_direct_cancel_discovery(void);
978  */
979 /**
980  * \brief This API shall cancel the discovery process started from wifi_direct_start_discovery. \n
981  *
982  * \pre discovery process must be started.
983  *
984  * \post discovery process stopped.
985  *
986  * \see wifi_direct_client_start_discovery
987  *
988  * \par Sync (or) Async:
989  * This is a Asynchronous API.
990  *
991  * \warning
992  *  None
993  *
994  *
995  * \par Async Response Message:
996  *    - WIFI_DIRECT_DISCOVERY_FINISHED :  Applications will receive a this event
997  *                                   via callback when the discovery process is cancelled or completed.
998  *
999  *
1000  * \return Return Type (int) \n
1001  * - WIFI_DIRECT_ERROR_NONE on success \n
1002  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1003  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1004  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1005  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1006  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1007  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1008  *
1009  * \par Prospective Clients:
1010  * External Apps.
1011  *
1012  * \code
1013  *
1014  * #include <wifi-direct.h>
1015  *
1016  * void foo(void)
1017  * {
1018
1019  * int result;
1020  *
1021  * result = wifi_direct_cancel_discovery();
1022  *
1023  * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery cancel request is successful
1024  *
1025  *\endcode
1026  *
1027  *\remarks None.
1028  *
1029  ******************************************************************************/
1030 int wifi_direct_cancel_discovery(void);
1031
1032
1033 /**
1034  * access list notification callback function type. \n
1035  *
1036  * @param device The device that is in access list.
1037  * @param user_data The user data passed from the foreach function.
1038  * @return @c true to continue with the next iteration of the loop,
1039  * \n @c false to break out of the loop.
1040  *
1041  * @pre wifi_direct_get_access_list() will invoke this function.
1042  *
1043  * @see wifi_direct_get_access_list()
1044  *
1045  */
1046 typedef bool(*wifi_direct_access_list_cb)       (wifi_direct_access_list_info_s *device, void *user_data);
1047
1048 /*****************************************************************************************/
1049 /* wifi_direct_get_access_list API function prototype
1050  * int wifi_direct_get_access_list(wifi_direct_discovered_peer_cb, void* user_data)
1051  */
1052 /**
1053  * \brief This API shall get the information of all devices in access list. \n
1054  *
1055  * @param callback The callback function to invoke.
1056  * @param user_data The user data passed from the foreach function.
1057  *
1058  * \see wifi_direct_discovered_peer_cb
1059  *
1060  * \par Sync (or) Async:
1061  * This is a Synchronous API.
1062  *
1063  * \warning
1064  *  None
1065  *
1066  * \return Return Type (int) \n
1067  * - WIFI_DIRECT_ERROR_NONE on success \n
1068  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1069  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1070  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1071  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1072  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1073  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1074  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1075  *
1076  *
1077  * \par Prospective Clients:
1078  * External Apps.
1079  *
1080  * \code
1081  *
1082  * #include <wifi-direct.h>
1083  *
1084  * bool _cb_access_list_impl(wifi_direct_access_list_info_s* device, void* user_data)
1085  * {
1086  *      struct appdata* ad = (struct appdata*) user_data;
1087  *
1088  *      if(NULL != device)
1089  *      {
1090  *              memcpy(&ad->access_list[ad->access_list_count], device, sizeof(wifi_direct_access_list_info_s));
1091                 ad->access_list_count++;
1092  *      }
1093  *
1094  *      return true;    // continue with the next iteration of the loop
1095  * }
1096  *
1097  *
1098  * void foo()
1099  * {
1100  *      int result;
1101  *
1102  *      ad->access_list = NULL;
1103  *      ad->access_list_count = 0;
1104  *      result = wifi_direct_get_access_list(_cb_access_list_impl, (void*)ad);
1105  *
1106  *      if(result == WIFI_DIRECT_ERROR_NONE)......... // get access list is successful
1107  *
1108  *\endcode
1109  *
1110  *\remarks None.
1111  *
1112  ******************************************************************************/
1113 int wifi_direct_get_access_list(wifi_direct_access_list_cb callback,
1114                                                                                                 void *user_data);
1115
1116
1117 /**
1118  * discorverd peers notification callback function type. \n
1119  *
1120  * @param peer The discovered peer information.
1121  * @param user_data The user data passed from the foreach function.
1122  * @return @c true to continue with the next iteration of the loop,
1123  * \n @c false to break out of the loop.
1124  *
1125  * @pre wifi_direct_foreach_discovered_peers() will invoke this function.
1126  *
1127  * @see wifi_direct_foreach_discovered_peers()
1128  *
1129  */
1130 typedef bool(*wifi_direct_discovered_peer_cb)   (wifi_direct_discovered_peer_info_s *peer, void *user_data);
1131
1132
1133 /*****************************************************************************************/
1134 /* wifi_direct_foreach_discovered_peers API function prototype
1135  * int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb, void* user_data)
1136  */
1137 /**
1138  * \brief This API shall get the information of all discovered peers. \n
1139  *
1140  * @param callback The callback function to invoke.
1141  * @param user_data The user data passed from the foreach function.
1142  *
1143  * \see wifi_direct_discovered_peer_cb
1144  *
1145  * \par Sync (or) Async:
1146  * This is a Synchronous API.
1147  *
1148  * \warning
1149  *  None
1150  *
1151  * \return Return Type (int) \n
1152  * - WIFI_DIRECT_ERROR_NONE on success \n
1153  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1154  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1155  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1156  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1157  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1158  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1159  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1160  *
1161  *
1162  * \par Prospective Clients:
1163  * External Apps.
1164  *
1165  * \code
1166  *
1167  * #include <wifi-direct.h>
1168  *
1169  * bool _cb_discovered_peers_impl(wifi_direct_discovered_peer_info_s* peer, void* user_data)
1170  * {
1171  *      struct appdata* ad = (struct appdata*) user_data;
1172  *
1173  *      if(NULL != peer)
1174  *      {
1175  *              if ( ad->peer_count >= MAX_PEER_NUM )
1176  *                      return false;   // break out of the loop
1177  *
1178  *              memcpy(&ad->peer_list[ad->peer_count], peer, sizeof(wifi_direct_discovered_peer_info_s));
1179  *              ad->peer_count++;
1180  *      }
1181  *
1182  *      return true;    // continue with the next iteration of the loop
1183  * }
1184  *
1185  *
1186  * void foo()
1187  * {
1188  *      int result;
1189  *
1190  *      ad->peer_list = NULL;
1191  *      ad->peer_count = 0;
1192  *      ad ->selected_peer_index = 0;
1193  *      result = wifi_direct_foreach_discovered_peers(_cb_discovered_peers_impl, (void*)ad);
1194  *
1195  *      if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1196  *
1197  *\endcode
1198  *
1199  *\remarks None.
1200  *
1201  ******************************************************************************/
1202 int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb callback,
1203                                                                                                 void *user_data);
1204
1205
1206 /*****************************************************************************************/
1207 /* wifi_direct_connect API function prototype
1208  * int wifi_direct_connect(const char* mac_address);
1209  */
1210 /**
1211  * \brief This API shall connect to specified peer by automatically determining whether to perform group \n
1212  * formation, join an existing group, invite, re-invoke a group. The decision is \n
1213  * based on the current state of the peers (i.e. GO, STA, not connected) and the \n
1214  * availability of persistent data. \n
1215  *
1216  * @param mac_addr Device address of target peer.
1217  *
1218  * \par Sync (or) Async:
1219  * This is a Asynchronous API.
1220  *
1221  * \warning
1222  *  None
1223  *
1224  *
1225  * \par Async Response Message:
1226  *    - WIFI_DIRECT_CONNECTION_IN_PROGRESS :  Applications will receive this event
1227  *                                   via callback when the connection process is started.
1228  *    - WIFI_DIRECT_CONNECTION_RSP :  Applications will receive this event
1229  *                                   via callback when the connection process is completed or failed.
1230  *
1231  * \return Return Type (int) \n
1232  * - WIFI_DIRECT_ERROR_NONE on success \n
1233  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1234  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1235  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1236  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1237  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1238  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1239  * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
1240  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1241  * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1242  * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1243  *
1244  *
1245  * \par Prospective Clients:
1246  * External Apps.
1247  *
1248  * \code
1249  *
1250  * #include <wifi-direct.h>
1251  *
1252  * void foo(unsigned char* mac_addr)
1253  * {
1254
1255  * int result;
1256  *
1257  * result = wifi_direct_connect(mac_addr);
1258  *
1259  * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
1260  *
1261  *\endcode
1262  *
1263  *\remarks This API will try to send provisioning request befre connecting.
1264  *
1265  ******************************************************************************/
1266 int wifi_direct_connect(const char *mac_address);
1267
1268 /**
1269  * @brief Cancel the connection now in progress .
1270  * @param[in] mac_address  The MAC address of rejected device.
1271  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1272  * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1273  * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1274  * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
1275  * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1276  * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1277  */
1278 int wifi_direct_cancel_connection(const char *mac_address);
1279
1280 /**
1281  * @brief Reject the connection request from other device now in progress.
1282  * @param[in] mac_address  The MAC address of rejected device.
1283  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1284  * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1285  * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1286  * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
1287  * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1288  * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1289  */
1290 int wifi_direct_reject_connection(const char *mac_address);
1291
1292 /*****************************************************************************************/
1293 /* wifi_direct_disconnect_all API function prototype
1294  * int wifi_direct_disconnect_all(void);
1295  */
1296 /**
1297  * \brief This API shall tear down all connected links to peers (stop soft AP, and close interface).  \n
1298  *
1299  * \see wifi_direct_connect
1300  *
1301  * \par Sync (or) Async:
1302  * This is a Asynchronous API.
1303  *
1304  * \warning
1305  *  None
1306  *
1307  *
1308  * \par Async Response Message:
1309  *    - WIFI_DIRECT_DISCONNECTION_RSP :  Applications will receive this event
1310  *                                   via callback when the disconnection process is completed.
1311  *
1312  *
1313  * \return Return Type (int) \n
1314  * - WIFI_DIRECT_ERROR_NONE on success \n
1315  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1316  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1317  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1318  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1319  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1320  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1321  *
1322  *
1323  * \par Prospective Clients:
1324  * External Apps.
1325  *
1326  * \code
1327  *
1328  * #include <wifi-direct.h>
1329  *
1330  * void foo(void)
1331  * {
1332
1333  * int result;
1334  *
1335  * result = wifi_direct_disconnect_all();
1336  *
1337  * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1338  *
1339  *\endcode
1340  *
1341  *\remarks None.
1342  *
1343  ******************************************************************************/
1344 int wifi_direct_disconnect_all(void);
1345
1346
1347
1348 /*****************************************************************************************/
1349 /* wifi_direct_disconnect API function prototype
1350  * int wifi_direct_disconnect(const char* mac_address);
1351  */
1352 /**
1353  * \brief This API shall disconnect the specified peer by mac address.
1354  *
1355  * @param mac_addr Device address of target peer.
1356  *
1357  * \see
1358  *
1359  * \par Sync (or) Async:
1360  * This is a Asynchronous API.
1361  *
1362  * \warning
1363  *  None
1364  *
1365  *
1366  * \par Async Response Message:
1367  *    - WIFI_DIRECT_DISCONNECTION_RSP :  Applications will receive a this event
1368  *                                   via callback when a peer is disconnected.
1369  *
1370  * \return Return Type (int) \n
1371  * - WIFI_DIRECT_ERROR_NONE on success \n
1372  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1373  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1374  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1375  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1376  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1377  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1378  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1379  *
1380  *
1381  * \par Prospective Clients:
1382  * External Apps.
1383  *
1384  * \code
1385  *
1386  * #include <wifi-direct.h>
1387  *
1388  * void foo(unsigned char* mac_addr)
1389  * {
1390
1391  * int result;
1392  *
1393  * result = wifi_direct_disconnect(mac_addr);
1394  *
1395  * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1396  *
1397  *\endcode
1398  *
1399  *\remarks None.
1400  *
1401  ******************************************************************************/
1402 int wifi_direct_disconnect(const char *mac_address);
1403
1404
1405
1406 /**
1407  * connected peers notification callback function type. \n
1408  *
1409  * @param peer The connected peer information.
1410  * @param user_data The user data passed from the foreach function.
1411  * @return @c true to continue with the next iteration of the loop,
1412  * \n @c false to break out of the loop.
1413  *
1414  * @pre wifi_direct_foreach_connected_peers() will invoke this function.
1415  *
1416  * @see wifi_direct_foreach_connected_peers()
1417  *
1418  */
1419 typedef bool(*wifi_direct_connected_peer_cb) (wifi_direct_connected_peer_info_s *peer,
1420                                                                                                                 void *user_data);
1421
1422
1423 /*****************************************************************************************/
1424 /* wifi_direct_foreach_connected_peers API function prototype
1425  * int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb, void* user_data)
1426  */
1427 /**
1428  * \brief This API shall get the information of all connected peers. \n
1429  *
1430  * @param callback The callback function to invoke.
1431  * @param user_data The user data passed from the foreach function.
1432  *
1433  * \see wifi_direct_connected_peer_cb
1434  *
1435  * \par Sync (or) Async:
1436  * This is a Synchronous API.
1437  *
1438  * \warning
1439  *  None
1440  *
1441  * \return Return Type (int) \n
1442  * - WIFI_DIRECT_ERROR_NONE on success \n
1443  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1444  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1445  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1446  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1447  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1448  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1449  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1450  *
1451  * \par Prospective Clients:
1452  * External Apps.
1453  *
1454  * \code
1455  *
1456  * #include <wifi-direct.h>
1457  *
1458  * bool _cb_connected_peers_impl(wifi_direct_connected_peer_info_s* peer, void* user_data)
1459  *{
1460  *
1461  *      struct appdata* ad = (struct appdata*) user_data;
1462  *
1463  *      if(NULL != peer)
1464  *      {
1465  *              if ( ad->connected_peer_count >= MAX_PEER_NUM )
1466  *                      return false;   // break out of the loop
1467  *
1468  *              memcpy(&ad->connected_peer_list[ad->connected_peer_count], peer, sizeof(wifi_direct_connected_peer_info_s));
1469  *              ad->connected_peer_count++;
1470  *
1471  *      }
1472  *
1473  *      return true;    // continue with the next iteration of the loop
1474  *}
1475  *
1476  * void foo()
1477  * {
1478  *      int result;
1479  *
1480  *      ad->connected_peer_list = NULL;
1481  *      ad->connected_peer_count = 0;
1482  *
1483  *      result = wifi_direct_foreach_connected_peers(_cb_connected_peers_impl, (void*)ad);
1484  *
1485  * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1486  *
1487  *\endcode
1488  *
1489  *\remarks None.
1490  *
1491  ******************************************************************************/
1492 int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb
1493                                                                                 callback, void *user_data);
1494
1495
1496
1497 /*****************************************************************************************/
1498 /* wifi_direct_create_group API function prototype
1499  * int wifi_direct_create_group();
1500  */
1501 /**
1502  * \brief This API shall set up device as a Group Owner and wait for clients to connect. \n
1503  * Create a soft AP, start the WPS registrar, start the DHCP server. \n
1504  *
1505  * \see wifi_direct_destroy_group
1506  *
1507  * \par Sync (or) Async:
1508  * This is a Asynchronous API.
1509  *
1510  * \warning
1511  *  None
1512  *
1513  *
1514  * \par Async Response Message:
1515  *    - WIFI_DIRECT_GROUP_CREATED :  Applications will receive this event
1516  *                                   via callback when the group creating request is successful. \n
1517  *                                Errorcode will be set to the WFD_ERROR_CREATE_LINK_FAIL value. \n
1518  *
1519  * \return Return Type (int) \n
1520  * - WIFI_DIRECT_ERROR_NONE on success \n
1521  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1522  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1523  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1524  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1525  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1526  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1527  * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1528  * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1529  *
1530  *
1531  * \par Prospective Clients:
1532  * External Apps.
1533  *
1534  * \code
1535  *
1536  * #include <wifi-direct.h>
1537  *
1538  * void foo()
1539  * {
1540
1541  * int result;
1542  *
1543  * result = wifi_direct_create_group();
1544  *
1545  * if(result == WIFI_DIRECT_ERROR_NONE)......... // create group request is successful
1546  *
1547  *\endcode
1548  *
1549  *\remarks None.
1550  *
1551  ******************************************************************************/
1552 int wifi_direct_create_group(void);
1553
1554
1555
1556 /*****************************************************************************************/
1557 /* wifi_direct_destroy_group API function prototype
1558  * int wifi_direct_destroy_group();
1559  */
1560 /**
1561  * \brief This API shall cancel P2P Group create or tear down a P2P Group that we own. \n
1562  *
1563  * \see wifi_direct_create_group
1564  *
1565  * \par Sync (or) Async:
1566  * This is a Asynchronous API.
1567  *
1568  * \warning
1569  *  None
1570  *
1571  *
1572  * \par Async Response Message:
1573  *    - WIFI_DIRECT_GROUP_DESTROYED :  Applications will receive this event via callback when the group is cancelled. \n
1574  *
1575  * \return Return Type (int) \n
1576  * - WIFI_DIRECT_ERROR_NONE on success \n
1577  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1578  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1579  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1580  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1581  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1582  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1583  * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1584  * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1585  *
1586  *
1587  * \par Prospective Clients:
1588  * External Apps.
1589  *
1590  * \code
1591  *
1592  * #include <wifi-direct.h>
1593  *
1594  * void foo()
1595  * {
1596
1597  * int result;
1598  *
1599  * result = wifi_direct_destroy_group();
1600  *
1601  * if(result == WIFI_DIRECT_ERROR_NONE)......... // cancel group request is successful
1602  *
1603  *\endcode
1604  *
1605  *\remarks None.
1606  *
1607  ******************************************************************************/
1608 int wifi_direct_destroy_group(void);
1609
1610
1611 /*****************************************************************************************/
1612 /* wifi_direct_is_group_owner API function prototype
1613  * int wifi_direct_is_group_owner(bool *owner);
1614  */
1615 /**
1616  * \brief This API shall check whether the currunt client is group owner or not.
1617  * @param owner              Memory to store the value of TURE or FALSE. Application must allocate memory.
1618  *
1619  * \see wifi_direct_create_group
1620  *
1621  * \par Sync (or) Async:
1622  * This is a Synchronous API.
1623  *
1624  * \warning
1625  *  None
1626  *
1627  * \return Return Type (int) \n
1628  * - WIFI_DIRECT_ERROR_NONE on success \n
1629  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1630  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1631  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1632  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1633  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1634  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1635  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1636  *
1637  * \par Prospective Clients:
1638  * External Apps.
1639  *
1640  * \code
1641  *
1642  * #include <wifi-direct.h>
1643  *
1644  * void foo(void)
1645  * {
1646
1647  * int result;
1648  * bool owner;
1649  *
1650  * result = wifi_direct_is_group_owner(&owner);
1651  *
1652  *
1653  * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1654  *
1655  *\endcode
1656  *
1657  *\remarks None.
1658  *
1659  ******************************************************************************/
1660 int wifi_direct_is_group_owner(bool *is_group_owner);
1661
1662
1663
1664 /*****************************************************************************************/
1665 /* wifi_direct_is_autonomous_group API function prototype
1666  * int wifi_direct_is_autonomous_group(bool *autonomous_group);
1667  */
1668 /**
1669  * \brief This API shall check whether the currunt group is autonomous group or not.
1670  * @param autonomous_group              Memory to store the value of TURE or FALSE. Application must allocate memory.
1671  *
1672  * \see wifi_direct_create_group
1673  *
1674  * \par Sync (or) Async:
1675  * This is a Synchronous API.
1676  *
1677  * \warning
1678  *  None
1679  *
1680  * \return Return Type (int) \n
1681  * - WIFI_DIRECT_ERROR_NONE on success \n
1682  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1683  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1684  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1685  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1686  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1687  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1688  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1689  *
1690  * \par Prospective Clients:
1691  * External Apps.
1692  *
1693  * \code
1694  *
1695  * #include <wifi-direct.h>
1696  *
1697  * void foo(void)
1698  * {
1699
1700  * int result;
1701  * bool autonomous_group;
1702  *
1703  * result = wifi_direct_is_autonomous_group(&autonomous_group);
1704  *
1705  *
1706  * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1707  *
1708  *\endcode
1709  *
1710  *\remarks None.
1711  *
1712  ******************************************************************************/
1713 int wifi_direct_is_autonomous_group(bool *is_autonomous_group);
1714
1715
1716
1717
1718 /*****************************************************************************************/
1719 /* wifi_direct_set_ssid API function prototype
1720  * int wifi_direct_set_ssid(const char* ssid);
1721  */
1722 /**
1723  * \brief This API shall set or update ssid of local device. \n
1724  * @param ssid              new ssid to set. Application must set the new ssid before.
1725  *
1726  * \see wifi_direct_get_ssid
1727  *
1728  * \par Sync (or) Async:
1729  * This is a Synchronous API.
1730  *
1731  * \warning
1732  *  None
1733  *
1734  *
1735  * \return Return Type (int) \n
1736  * - WIFI_DIRECT_ERROR_NONE on success \n
1737  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1738  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1739  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1740  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1741  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1742  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1743  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1744  *
1745  *
1746  * \par Prospective Clients:
1747  * External Apps.
1748  *
1749  * \code
1750  *
1751  * #include <wifi-direct.h>
1752  *
1753  * void foo()
1754  * {
1755  * int  result;
1756  * char ssid[11] = {0,};
1757  *
1758  * memset(pin, 0x00, sizeof(pin));
1759  * printf("Input 8 digit PIN number :\n");
1760  * scanf("%s", pin);
1761  *
1762  *if( strlen(ssid) > 0 )
1763  *      result = wifi_direct_set_ssid(ssid);
1764  *
1765  * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting ssid is successful
1766  *
1767  *\endcode
1768  *
1769  *\remarks When the wifi direct is re-activated, ssid will be reset to the device name. \n
1770  *
1771  *
1772  ******************************************************************************/
1773 int wifi_direct_set_ssid(const char *ssid);
1774
1775
1776 /**
1777  * @brief Sets the friendly name of local device.
1778  * @details This device name is shown to other devices during device discovery.
1779  * @remarks The name set by you is only valid during activated state.
1780  * After Wi-Fi Direct is deactivated, this name will be as the phone name.
1781  * @param[in] device_name  The name to local device
1782  * @return 0 on success, otherwise a negative error value.
1783  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1784  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
1785  * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1786  * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1787  * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitteds
1788  * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1789  * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1790  * @pre Wi-Fi Direct must be activated by wifi_direct_activate().
1791  * @see wifi_direct_activate()
1792  * @see wifi_direct_get_device_name()
1793  */
1794 int wifi_direct_set_device_name(const char *device_name);
1795
1796 /**
1797  * @brief Gets the name of local device.
1798  * @remarks @a device_name must be released with free() by you.
1799  * @param[out] device_name  The name to local device
1800  * @return 0 on success, otherwise a negative error value.
1801  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1802  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
1803  * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1804  * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1805  * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1806  * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1807  * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1808  * @see wifi_direct_initialize()
1809  * @see wifi_direct_set_device_name()
1810  */
1811 int wifi_direct_get_device_name(char **device_name);
1812
1813 /*****************************************************************************************/
1814 /* wifi_direct_get_ssid API function prototype
1815  * int wifi_direct_get_ssid(char** ssid)
1816  */
1817 /**
1818  * \brief This API shall get ssid of local device. \n
1819  * @param ssid              Pointer to store ssid. Application must free this memory.
1820  *
1821  * \par Sync (or) Async:
1822  * This is a Synchronous API.
1823  *
1824  * \warning
1825  *  None
1826  *
1827  *
1828  * \return Return Type (int) \n
1829  * - WIFI_DIRECT_ERROR_NONE on success \n
1830  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1831  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1832  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1833  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1834  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1835  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1836  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1837  *
1838  *
1839  * \par Prospective Clients:
1840  * External Apps.
1841  *
1842  * \code
1843  *
1844  * #include <wifi-direct.h>
1845  *
1846  * void foo()
1847  * {
1848  * int  result;
1849  * char* ssid = NULL;
1850  *
1851  * result = wifi_direct_get_ssid(&ssid);
1852  *
1853  * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting ssid is successful
1854  *
1855  * free(ssid); // Application should free the memory.
1856  *
1857  *
1858  *\endcode
1859  *
1860  *\remarks None.
1861  *
1862  ******************************************************************************/
1863 int wifi_direct_get_ssid(char **ssid);
1864
1865
1866 /**
1867 * @brief Gets the name of network interface. For example, eth0 and pdp0.
1868 * @remarks @a name must be released with free() by you.
1869 * @param[out] name  The name of network interface
1870 * @return 0 on success, otherwise negative error value.
1871 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1872 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
1873 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1874 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY  Out of memory
1875 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1876 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
1877 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1878 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1879 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1880 * @see wifi_direct_activate()
1881 */
1882 int wifi_direct_get_network_interface_name(char **name);
1883
1884
1885 /*****************************************************************************************/
1886 /* wifi_direct_get_ip_address API function prototype
1887  * int wifi_direct_get_ip_address(char** ip_address)
1888  */
1889 /**
1890  * \brief This API shall get IP address of local device interface. \n
1891  * @param ip_addr              Pointer to store ip address. Application must free this memory.
1892  *
1893  * \par Sync (or) Async:
1894  * This is a Synchronous API.
1895  *
1896  * \warning
1897  *  None
1898  *
1899  *
1900  * \return Return Type (int) \n
1901  * - WIFI_DIRECT_ERROR_NONE on success \n
1902  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1903  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1904  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1905  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1906  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1907  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1908  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1909  *
1910  *
1911  * \par Prospective Clients:
1912  * External Apps.
1913  *
1914  * \code
1915  *
1916  * #include <wifi-direct.h>
1917  *
1918  * void foo()
1919  * {
1920  * int  result;
1921  * char* ip = NULL;
1922  *
1923  * result = wifi_direct_get_ip_address(&ip);
1924  *
1925  * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting IP is successful
1926  *
1927  * free(ip); // Application should free the memory.
1928  *
1929  *\endcode
1930  *
1931  *\remarks None.
1932  *
1933  ******************************************************************************/
1934 int wifi_direct_get_ip_address(char **ip_address);
1935
1936 /**
1937 * @brief Gets the Subnet Mask.
1938 * @remarks @a subnet_mask must be released with free() by you.
1939 * @param[out] subnet_mask  The subnet mask
1940 * @return 0 on success, otherwise negative error value.
1941 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1942 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
1943 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1944 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY  Out of memory
1945 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1946 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
1947 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1948 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1949 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1950 * @see wifi_direct_activate()
1951 */
1952 int wifi_direct_get_subnet_mask(char **subnet_mask);
1953
1954
1955 /**
1956 * @brief Gets the Gateway address.
1957 * @remarks @a gateway_address must be released with free() by you.
1958 * @param[out] gateway_address  The gateway address
1959 * @return 0 on success, otherwise negative error value.
1960 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
1961 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
1962 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
1963 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY  Out of memory
1964 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
1965 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
1966 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
1967 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
1968 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1969 * @see wifi_direct_activate()
1970 */
1971 int wifi_direct_get_gateway_address(char **gateway_address);
1972
1973
1974
1975 /*****************************************************************************************/
1976 /* wifi_direct_get_mac_addr API function prototype
1977  * int wifi_direct_get_mac_address(char **mac_address)
1978  */
1979 /**
1980  * \brief This API shall get device MAC address of local device.\n
1981  * @param mac_addr              Pointer to store MAC address. Application must free this memory.
1982  *
1983  * \par Sync (or) Async:
1984  * This is a Synchronous API.
1985  *
1986  * \warning
1987  *  None
1988  *
1989  *
1990  * \return Return Type (int) \n
1991  * - WIFI_DIRECT_ERROR_NONE on success \n
1992  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1993  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1994  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1995  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1996  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1997  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1998  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1999  *
2000  *
2001  * \par Prospective Clients:
2002  * External Apps.
2003  *
2004  * \code
2005  *
2006  * #include <wifi-direct.h>
2007  *
2008  * void foo()
2009  * {
2010  * int  result;
2011  * char* mac_addr =NULL;
2012  *
2013  * result = wifi_direct_get_mac_addr(&mac_addr);
2014  *
2015  * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting device MAC is successful
2016  *
2017  *\endcode
2018  *
2019  *\remarks None.
2020  *
2021  ******************************************************************************/
2022 int wifi_direct_get_mac_address(char **mac_address);
2023
2024
2025 /*****************************************************************************************/
2026 /* wifi_direct_get_state API function prototype
2027  * int wifi_direct_get_state(wifi_direct_state_e * status);
2028  */
2029 /**
2030  * \brief This API shall get current Wi-Fi direct link status. \n
2031  * @param status Memory to store link status information. Application must allocate memory.
2032  *
2033  * \see wifi_direct_state_e
2034  *
2035  * \par Sync (or) Async:
2036  * This is a Synchronous API.
2037  *
2038  * \warning
2039  *  None
2040  *
2041  *
2042  * \return Return Type (int) \n
2043  * - WIFI_DIRECT_ERROR_NONE on success \n
2044  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2045  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2046  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2047  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2048  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2049  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2050  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2051  *
2052  *
2053  * \par Prospective Clients:
2054  * External Apps.
2055  *
2056  * \code
2057  *
2058  * #include <wifi-direct.h>
2059  *
2060  * void foo()
2061  * {
2062  * int result;
2063  * wifi_direct_state_e status;
2064  *
2065  * result = wifi_direct_get_state(&status);
2066  *
2067  * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting link status is successful
2068  *
2069  *\endcode
2070  *
2071  *\remarks None.
2072  *
2073  ******************************************************************************/
2074 int wifi_direct_get_state(wifi_direct_state_e *state);
2075
2076
2077
2078 /**
2079 * @brief Checks whether this device is discoverable or not by P2P discovery.
2080 * @details If you call wifi_direct_start_discovery(), then your device can be discoverable.
2081 * @param[out] discoverable  The status of discoverable: (@c true = discoverable, @c false = non-discoverable)
2082 * @return 0 on success, otherwise a negative error value.
2083 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2084 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2085 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2086 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2087 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2088 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2089 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2090 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2091 * @see wifi_direct_initialize()
2092 * @see wifi_direct_start_discovery()
2093 * @see wifi_direct_cancel_discovery()
2094 */
2095 int wifi_direct_is_discoverable(bool *discoverable);
2096
2097 /**
2098 * @brief Checks whether the local device is listening only.
2099 * @details If you call wifi_direct_start_discovery() with @a listen_only as @c true,
2100 * then skip the initial 802.11 Scan and then enter Listen state instead of cycling between Scan andListen.
2101 * @param[out] listen_only  The status of listen only: (@c true = listen only, @c false = cycling between Scan and Listen or not in discovery state)
2102 * @return 0 on success, otherwise a negative error value.
2103 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2104 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2105 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2106 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2107 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2108 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2109 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2110 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
2111 * @see wifi_direct_start_discovery()
2112 * @see wifi_direct_cancel_discovery()
2113 * @see wifi_direct_is_discoverable()
2114 */
2115 int wifi_direct_is_listening_only(bool *listen_only);
2116
2117 /**
2118 * @brief Gets the primary device type of local device.
2119 * @param[out] type  The primary device type
2120 * @return 0 on success, otherwise a negative error value.
2121 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2122 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2123 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2124 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2125 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2126 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2127 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2128 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2129 * @see wifi_direct_initialize()
2130 */
2131 int wifi_direct_get_primary_device_type(wifi_direct_primary_device_type_e *type);
2132
2133  /**
2134 * @brief Gets the secondary device type of local device.
2135 * @param[out] type  The secondary device type
2136 * @return 0 on success, otherwise a negative error value.
2137 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2138 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2139 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2140 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2141 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2142 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2143 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2144 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2145 * @see wifi_direct_initialize()
2146 */
2147 int wifi_direct_get_secondary_device_type(wifi_direct_secondary_device_type_e *type);
2148
2149
2150 /*****************************************************************************************/
2151 /* wifi_direct_accept_connection API function prototype
2152  * int wifi_direct_accept_connection(char* mac_address);
2153  */
2154 /**
2155  * \brief This API shall accept connection request from specified peer. \n
2156  * This API shall be used to respond the connection request event, WIFI_DIRECT_CONNECTION_REQ.
2157  *
2158  * @param mac_addr Device address of target peer.
2159  *
2160  * \see wifi_direct_connect
2161  *
2162  * \par Sync (or) Async:
2163  * This is a Asynchronous API.
2164  *
2165  * \warning
2166  *  None
2167  *
2168  * \par Async Response Message:
2169  *    - WIFI_DIRECT_CONNECTION_IN_PROGRESS :  Applications will receive this event
2170  *                                   via callback when the connection process is started.
2171  *    - WIFI_DIRECT_CONNECTION_RSP :  Applications will receive this event
2172  *                                   via callback when the connection process is completed or failed.
2173  *
2174  * \return Return Type (int) \n
2175  * - WIFI_DIRECT_ERROR_NONE on success \n
2176  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2177  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2178  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2179  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2180  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2181  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2182  * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
2183  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2184  * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
2185  * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
2186  *
2187  *
2188  * \par Prospective Clients:
2189  * External Apps.
2190  *
2191  * \code
2192  *
2193  * #include <wifi-direct.h>
2194  *
2195  * void foo(unsigned char* mac_addr)
2196  * {
2197  * int result;
2198  *
2199  * result = wifi_direct_accept_connection(mac_addr);
2200  *
2201  * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
2202  *
2203  *\endcode
2204  *
2205  *\remarks This API will not try to send provisioning request.
2206  *
2207  ******************************************************************************/
2208 int wifi_direct_accept_connection(char *mac_address);
2209
2210
2211 /*****************************************************************************************/
2212 /* wifi_direct_get_passphrase API function prototype
2213  * int wifi_direct_get_passphrase(char** passphrase)
2214  */
2215 /**
2216  * \brief If a client create Group (Soft AP), this API shall get wpa password. \n
2217  * @param passphrase              Pointer to store wpa password. Application must free this memory.
2218  *
2219  *
2220  * \par Sync (or) Async:
2221  * This is a Synchronous API.
2222  *
2223  * \warning
2224  *  None
2225  *
2226  *
2227  * \return Return Type (int) \n
2228  * - WIFI_DIRECT_ERROR_NONE on success \n
2229  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2230  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2231  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2232  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2233  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2234  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2235  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2236  *
2237  * \par Prospective Clients:
2238  * External Apps.
2239  *
2240  * \code
2241  *
2242  * #include <wifi-direct.h>
2243  *
2244  * void foo()
2245  * {
2246  * int  result;
2247  * char* wpa = NULL;
2248  *
2249  * result=wifi_direct_get_passphrase(&wpa);
2250  *
2251  * if(result == WIFI_DIRECT_ERROR_NONE)........//getting wpa passphrase is successful
2252  *
2253  * free(wpa); // Application should free the memory
2254  *
2255  *\endcode
2256  *
2257  *\remarks None.
2258  *
2259  ******************************************************************************/
2260 int wifi_direct_get_passphrase(char **passphrase);
2261
2262
2263 /*****************************************************************************************/
2264 /* wifi_direct_set_wpa_passphrase API function prototype
2265  * int wifi_direct_set_wpa_passphrase(char* passphrase)
2266  */
2267 /**
2268  * \brief This API shall set or update wpa password. If a client create Group (Soft AP), this password will be used. \n
2269  * @param passphrase              new wpa password to set. Application must set the new password before.
2270  *
2271  *
2272  * \par Sync (or) Async:
2273  * This is a Synchronous API.
2274  *
2275  * \warning
2276  *  None
2277  *
2278  *
2279  * \return Return Type (int) \n
2280  * - WIFI_DIRECT_ERROR_NONE on success \n
2281  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2282  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2283  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2284  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2285  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2286  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2287  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2288  *
2289  * \par Prospective Clients:
2290  * External Apps.
2291  *
2292  * \code
2293  *
2294  * #include <wifi-direct.h>
2295  *
2296  * void foo()
2297  * {
2298  * int  result;
2299  * char new_wpa[64+1] = {0,};
2300  *
2301  * printf("Input new WPA:\n");
2302  * scanf("%s",new_wpa);
2303  *
2304  *if( strlen(new_wpa) > 0 )
2305  *      result = wifi_direct_set_wpa_passphrase(new_wpa);
2306  *
2307  * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting password is successful
2308  *
2309  *\endcode
2310  *
2311  *\remarks None.
2312  *
2313  ******************************************************************************/
2314 int wifi_direct_set_wpa_passphrase(char *passphrase);
2315
2316
2317 /*****************************************************************************************/
2318 /* wifi_direct_activate_pushbutton API function prototype
2319  * int wifi_direct_activate_pushbutton(void);
2320  */
2321 /**
2322  * \brief This API shall start wps PBC.
2323
2324  * \pre Device must support the pbc button mode.
2325  *
2326  * \see wifi_direct_foreach_supported_wps_types
2327  *
2328  * \par Sync (or) Async:
2329  * This is a Synchronous API.
2330  *
2331  * \warning
2332  *  None
2333  *
2334  * \return Return Type (int) \n
2335  * - WIFI_DIRECT_ERROR_NONE on success \n
2336  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2337  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2338  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2339  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2340  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2341  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2342  *
2343  * \par Prospective Clients:
2344  * External Apps.
2345  *
2346  * \code
2347  *
2348  * #include <wifi-direct.h>
2349  *
2350  * void foo(void)
2351  * {
2352
2353  * int result;
2354  *
2355  * result = wifi_direct_activate_pushbutton();
2356  *
2357  * if(result == WIFI_DIRECT_ERROR_NONE)......... // activating push button is successful
2358  *
2359  *\endcode
2360  *
2361  *\remarks None.
2362  *
2363  ******************************************************************************/
2364 int wifi_direct_activate_pushbutton(void);
2365
2366
2367 /*****************************************************************************************/
2368 /* wifi_direct_set_wps_pin API function prototype
2369  * int wifi_direct_set_wps_pin(char* pin)
2370  */
2371 /**
2372  * \brief This API shall set or update the WPS PIN number user expects. \n
2373  * @param pin              new pin to set. Application must set the new pin number before.
2374  *
2375  * \see wifi_direct_generate_wps_pin.
2376  * \see wifi_direct_get_wps_pin
2377  *
2378  * \par Sync (or) Async:
2379  * This is a Synchronous API.
2380  *
2381  * \warning
2382  *  None
2383  *
2384  *
2385  * \return Return Type (int) \n
2386  * - WIFI_DIRECT_ERROR_NONE on success \n
2387  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2388  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2389  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2390  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2391  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2392  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2393  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2394  *
2395  *
2396  * \par Prospective Clients:
2397  * External Apps.
2398  *
2399  * \code
2400  *
2401  * #include <wifi-direct.h>
2402  *
2403  * void foo()
2404  * {
2405  * int  result;
2406  * char pin[WIFI_DIRECT_WPS_PIN_LEN+1]= { 0, };
2407  *
2408  * memset(pin, 0x00, sizeof(pin));
2409  * printf("Input 8 digit PIN number :\n");
2410  * scanf("%s", pin);
2411  *
2412  *if( strlen(pin) > 0 )
2413  *      result = wifi_direct_set_wps_pin(pin);
2414  *
2415  * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting wps pin number is successful
2416  *
2417  *\endcode
2418  *
2419  *\remarks None.
2420  *
2421  ******************************************************************************/
2422 int wifi_direct_set_wps_pin(char *pin);
2423
2424
2425 /*****************************************************************************************/
2426 /* wifi_direct_get_wps_pin API function prototype
2427  * int wifi_direct_get_wps_pin(char** pin)
2428  */
2429 /**
2430  * \brief This API shall get the WPS PIN number. \n
2431  * @param pin              Pointer to store pin number. Application must free this memory.
2432  *
2433  * \see wifi_direct_set_wps_pin
2434  *
2435  * \par Sync (or) Async:
2436  * This is a Synchronous API.
2437  *
2438  * \warning
2439  *  None
2440  *
2441  *
2442  * \return Return Type (int) \n
2443  * - WIFI_DIRECT_ERROR_NONE on success \n
2444  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2445  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2446  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2447  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2448  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2449  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2450  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2451  *
2452  *
2453  * \par Prospective Clients:
2454  * External Apps.
2455  *
2456  * \code
2457  *
2458  * #include <wifi-direct.h>
2459  *
2460  * void foo()
2461  * {
2462  * int  result;
2463  * char* pin = NULL;
2464  *
2465  * result = wifi_direct_get_wps_pin(&pin);
2466  *
2467  * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting wps pin number is successful
2468  *
2469  * free(pin); // Application should free the memory.
2470  *
2471  *\endcode
2472  *
2473  *\remarks None.
2474  *
2475  ******************************************************************************/
2476 int wifi_direct_get_wps_pin(char **pin);
2477
2478
2479 /*****************************************************************************************/
2480 /* wifi_direct_generate_wps_pin API function prototype
2481  * wifi_direct_generate_wps_pin(void);
2482  */
2483 /**
2484  * \brief This API shall generate the random WPS PIN number.\n
2485  *              To get the generated PIN number, use wifi_direct_get_wps_pin() API.
2486  *
2487  * \see wifi_direct_set_wps_pin
2488  * \see wifi_direct_get_wps_pin
2489  *
2490  * \par Sync (or) Async:
2491  * This is a Synchronous API.
2492  *
2493  * \warning
2494  *  None
2495  *
2496  *
2497  * \return Return Type (int) \n
2498  * - WIFI_DIRECT_ERROR_NONE on success \n
2499  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2500  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2501  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2502  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2503  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2504  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2505  *
2506  *
2507  * \par Prospective Clients:
2508  * External Apps.
2509  *
2510  * \code
2511  *
2512  * #include <wifi-direct.h>
2513  *
2514  * void foo()
2515  * {
2516  * int  result;
2517  *
2518  * result = wifi_direct_generate_wps_pin();
2519  *
2520  * if(result == WIFI_DIRECT_ERROR_NONE)......... // generating wps pin number is successful
2521  *
2522  *\endcode
2523  *
2524  *\remarks None.
2525  *
2526  ******************************************************************************/
2527 int wifi_direct_generate_wps_pin(void);
2528
2529
2530 /*****************************************************************************************/
2531 /* wifi_direct_get_supported_wps_mode API function prototype
2532  * int wifi_direct_get_supported_wps_mode(int *wps_mode);
2533  */
2534 /**
2535  * \brief This API shall get the supported wps mode. \n
2536  *              The result is bit flag.
2537  *
2538  * @param wps_mode              Memory to store supported wps mode. Application must allocate memory.
2539  *
2540  * \see wifi_direct_wps_type_e
2541  *
2542  * \par Sync (or) Async:
2543  * This is a Synchronous API.
2544  *
2545  * \warning
2546  *  None
2547  *
2548  *
2549  * \return Return Type (int) \n
2550  * - WIFI_DIRECT_ERROR_NONE on success \n
2551  * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2552  * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2553  * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2554  * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2555  * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2556  * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2557  * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2558  *
2559  *
2560  * \par Prospective Clients:
2561  * External Apps.
2562  *
2563  * \code
2564  *
2565  * #include <wifi-direct.h>
2566  *
2567  * void foo()
2568  * {
2569  * int  result;
2570  * int supported_wps_mode = 0;
2571  *
2572  * result = wifi_direct_get_supported_wps_mode(&supported_wps_mode);
2573  *
2574  * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting supported wps mode is successful
2575  *
2576  *\endcode
2577  *
2578  *\remarks None.
2579  *
2580  ******************************************************************************/
2581 int wifi_direct_get_supported_wps_mode(int *wps_mode);
2582
2583
2584 /**
2585 * @brief Called when you get the supported WPS(Wi-Fi Protected Setup) type repeatedly.
2586 * @param[in] type  The type of WPS
2587 * @param[in] user_data  The user data passed from the request function
2588 * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
2589 * @pre  wifi_direct_foreach_supported_wps_types() will invoke this callback.
2590 * @see  wifi_direct_foreach_supported_wps_types()
2591 */
2592 typedef bool(*wifi_direct_supported_wps_type_cb)(wifi_direct_wps_type_e type, void *user_data);
2593
2594 /**
2595 * @brief Gets the supported WPS(Wi-Fi Protected Setup) types.
2596 * @param[in] callback  The callback function to invoke
2597 * @param[in] user_data  The user data to be passed to the callback function
2598 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2599 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2600 * @see wifi_direct_supported_wps_type_cb()
2601 */
2602 int wifi_direct_foreach_supported_wps_types(wifi_direct_supported_wps_type_cb callback, void *user_data);
2603
2604 /**
2605  * @brief Gets the WPS(Wi-Fi Protected Setup) type.
2606  * @param[out] type  The type of WPS
2607  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2608  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2609  * @see wifi_direct_foreach_supported_wps_types()
2610  */
2611 int wifi_direct_get_local_wps_type(wifi_direct_wps_type_e *type);
2612
2613 /**
2614  * @brief Sets the requested WPS(Wi-Fi Protected Setup) type.
2615  * @param[in] type  The type of WPS
2616  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2617  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2618  * @see wifi_direct_foreach_supported_wps_types()
2619  */
2620 int wifi_direct_set_req_wps_type(wifi_direct_wps_type_e type);
2621
2622 /**
2623  * @brief Gets the requested WPS(Wi-Fi Protected Setup) type.
2624  * @param[out] type  The type of WPS
2625  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2626  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2627  * @see wifi_direct_foreach_supported_wps_types()
2628  */
2629 int wifi_direct_get_req_wps_type(wifi_direct_wps_type_e *type);
2630
2631 /**
2632 * @brief Sets the intent of a group owner.
2633 * @remakrs The range of intent is 0 ~ 15.
2634 * @param[in] intent  The intent of a group owner
2635 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2636 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2637 * @see wifi_direct_get_group_owner_intent()
2638 */
2639 int wifi_direct_set_group_owner_intent(int intent);
2640
2641 /**
2642 * @brief Gets the intent of a group owner.
2643 * @param[out] intent  The intent of a group owner
2644 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2645 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2646 * @see wifi_direct_set_group_owner_intent()
2647 */
2648 int wifi_direct_get_group_owner_intent(int *intent);
2649
2650 /**
2651 * @brief Sets the max number of clients.
2652 * @param[in] max  The max number of clients
2653 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2654 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2655 * @see wifi_direct_get_max_clients()
2656 */
2657 int wifi_direct_set_max_clients(int max);
2658
2659 /**
2660 * @brief Gets the max number of clients.
2661 * @param[in] max  The max number of clients
2662 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2663 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2664 * @see wifi_direct_set_max_clients()
2665 */
2666 int wifi_direct_get_max_clients(int *max);
2667
2668
2669 /**
2670 * @brief Gets the channel of own group. - DEPRECATED
2671 * @param[out] channel  The channel of own group
2672 * @return 0 on success, otherwise a negative error value.
2673 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2674 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2675 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2676 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2677 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2678 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2679 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2680 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2681 * @see wifi_direct_initialize()
2682 */
2683 int wifi_direct_get_own_group_channel(int *channel);
2684
2685
2686 /**
2687 * @brief Gets the operating channel.
2688 * @param[out] channel  The operating channel
2689 * @return 0 on success, otherwise a negative error value.
2690 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2691 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2692 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2693 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2694 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2695 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2696 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2697 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2698 * @see wifi_direct_initialize()
2699 */
2700 int wifi_direct_get_operating_channel(int *channel);
2701
2702 /**
2703  * @brief Sets the Autoconnection mode.
2704  * @param[in]
2705  * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2706  * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2707  * @see wifi_direct_foreach_supported_wps_types()
2708  */
2709 int wifi_direct_set_autoconnection_mode(bool mode);
2710
2711 int wifi_direct_is_autoconnection_mode(bool *mode);
2712
2713 /**
2714 * @brief Enables the persistent group.
2715 * @details If @a enabled is true, then P2P persisten group will be used when creating a group and establishing a connection.
2716 * @param[in] enabled  The status of persistent group: (@c true = enabled, @c false = disabled)
2717 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2718 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2719 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2720 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2721 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2722 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2723 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2724 * @see wifi_direct_initialize()
2725 * @see wifi_direct_is_persistent_group_enabled()
2726 */
2727 int wifi_direct_set_persistent_group_enabled(bool enabled);
2728
2729 /**
2730 * @brief Checks whether the persistent group is enabled or disabled.
2731 * @param[out] enabled  The status of persistent group: (@c true = enabled, @c false = disabled)
2732 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2733 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2734 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2735 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2736 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2737 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2738 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2739 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2740 * @see wifi_direct_initialize()
2741 * @see wifi_direct_set_persistent_group_enabled()
2742 */
2743 int wifi_direct_is_persistent_group_enabled(bool *enabled);
2744
2745
2746 /**
2747 * @brief Called when you get the persistent groups repeatedly.
2748 * @param[in] mac_address  The MAC address of persistent group owner
2749 * @param[in] ssid  The SSID(Service Set Identifier) of persistent group owner
2750 * @param[in] user_data  The user data passed from the request function
2751 * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of theloop
2752 * @pre  wifi_direct_foreach_persistent_groups() will invoke this callback.
2753 * @see  wifi_direct_foreach_persistent_groups()
2754 */
2755 typedef bool(*wifi_direct_persistent_group_cb)(const char *mac_address, const char *ssid, void *user_data);
2756
2757 /**
2758 * @brief Gets the persistent groups.
2759 * @param[in] callback  The callback function to invoke
2760 * @param[in] user_data  The user data to be passed to the callback function
2761 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2762 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2763 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2764 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2765 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2766 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2767 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2768 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2769 * @post wifi_direct_persistent_group_cb() will be called.
2770 * @see wifi_direct_initialize()
2771 * @see wifi_direct_persistent_group_cb()
2772 */
2773 int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb callback, void *user_data);
2774
2775 /**
2776 * @brief Remove a persistent group.
2777 * @param[in] mac_address  The MAC address of persistent group owner
2778 * @param[in] ssid  The SSID(Service Set Identifier) of persistent group owner
2779 * @retval #WIFI_DIRECT_ERROR_NONE  Successful
2780 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameter
2781 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
2782 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
2783 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED  Operation not permitted
2784 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
2785 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
2786 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2787 * @see wifi_direct_initialize()
2788 * @see wifi_direct_foreach_persistent_groups()
2789 */
2790 int wifi_direct_remove_persistent_group(const char *mac_address, const char *ssid);
2791
2792 /*****************************************************************************************/
2793 /* wifi_direct_service_add API function prototype
2794  * int wifi_direct_service_add(wifi_direct_service_type_e type, char *data1, char *data2)
2795  */
2796 /**
2797  * \brief This API shall add the service user expects. \n
2798  * @param type              new service type to add. Application must run the new service before.
2799  * @param data1             new service query to add. Application must run the new service before.
2800  *                                                              upnp: <service>
2801  *                                                              bonjour: <RDATA hexdump>
2802  *                                                              vendor specific: <service string>
2803  * @param data2             new service data to add. Application must run the new service before.
2804  *                                                              upnp: <version hex>
2805  *                                                              bonjour: <query hexdump>
2806  *                                                              vendor specific: NULL
2807  *
2808  * \see wifi_direct_service_del.
2809  * \see wifi_direct_serv_disc_req.
2810  * \see wifi_direct_serv_disc_cancel.
2811  *
2812  * \par Sync (or) Async:
2813  * This is a Synchronous API.
2814  *
2815  * \warning
2816  *  None
2817  *
2818  *
2819  * \return Return Type (int) \n
2820  *      WIFI_DIRECT_ERROR_NONE on Success \n
2821  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
2822  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
2823  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
2824  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2825  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2826  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2827  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2828  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2829  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2830  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2831  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2832  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2833  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2834  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2835  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2836  *
2837  *
2838  *\endcode
2839  *
2840  *\remarks None.
2841  *
2842  ******************************************************************************/
2843 int wifi_direct_service_add(wifi_direct_service_type_e type, char *data1, char *data2);
2844
2845 /*****************************************************************************************/
2846 /* wifi_direct_service_del API function prototype
2847  * int wifi_direct_service_del(wifi_direct_service_type_e type, char *data1, char *data2)
2848  */
2849 /**
2850  * \brief This API shall delete the service user expects. \n
2851  * @param type              service type to delete. Application must run and add the service to wpasupplicant before.
2852  * @param data1             new service query to delete. Application must run and add the service to wpasupplicant before.
2853  *                                                              upnp: <service>
2854  *                                                              bonjour: <query hexdump>
2855  *                                                              vendor specific: <service string>
2856  * @param data2             new service data to delete. Application must run and add the service to wpasupplicant before.
2857  *                                                              upnp: <version hex>
2858  *                                                              bonjour: NULL
2859  *                                                              vendor specific: NULL
2860  *
2861  * \see wifi_direct_service_add.
2862  * \see wifi_direct_serv_disc_req.
2863  * \see wifi_direct_serv_disc_cancel.
2864  *
2865  * \par Sync (or) Async:
2866  * This is a Synchronous API.
2867  *
2868  * \warning
2869  *  None
2870  *
2871  *
2872  * \return Return Type (int) \n
2873  *      WIFI_DIRECT_ERROR_NONE on Success \n
2874  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
2875  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
2876  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
2877  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2878  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2879  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2880  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2881  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2882  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2883  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2884  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2885  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2886  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2887  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2888  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2889  *
2890  *
2891  *\endcode
2892  *
2893  *\remarks None.
2894  *
2895  ******************************************************************************/
2896 int wifi_direct_service_del(wifi_direct_service_type_e type, char *data1, char *data2);
2897
2898 /*****************************************************************************************/
2899 /* wifi_direct_service_del API function prototype
2900  * int wifi_direct_serv_disc_req(char* MAC, wifi_direct_service_type_e type, char *data1, char *data2)
2901  */
2902 /**
2903  * \brief This API shall delete the service user expects. \n
2904  * @param MAC               peer MAC address to discover service. this value can be specific MAC address or 00:00:00:00:00:00 as wildcard
2905  * @param type              service type to discover. this value can be NULL if this value is not needed.
2906  * @param data1             service query to discover. this value can be NULL if this value is not needed.
2907  *                                                              find all : NULL
2908  *                                                              upnp: <service> or NULL for finding all upnp services
2909  *                                                              bonjour: <query hexdump> or NULL for finding all bonjour services
2910  *                                                              vendor specific: <service string> or NULL for finding all vendor specific services
2911  * @param data2             service data to discover. this value is mandatory and can be Service Query TLV,
2912  *                                                              find all : NULL
2913  *                                                              upnp: <version hex> or NULL for finding all upnp services
2914  *                                                              bonjour: NULL
2915  *                                                              vendor specific: NULL
2916  *
2917  * \see wifi_direct_service_add.
2918  * \see wifi_direct_service_del.
2919  * \see wifi_direct_serv_disc_cancel.
2920  *
2921  * \par Sync (or) Async:
2922  * This is a Synchronous API.
2923  *
2924  * \warning
2925  *  None
2926  *
2927  *
2928  * \return Return Type (int) \n
2929  *      Request Handle on Success \n
2930  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
2931  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
2932  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
2933  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2934  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2935  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2936  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2937  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2938  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2939  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2940  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2941  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2942  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2943  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2944  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2945  *
2946  *
2947  *\endcode
2948  *
2949  *\remarks None.
2950  *
2951  ******************************************************************************/
2952 int wifi_direct_serv_disc_req(char* MAC, wifi_direct_service_type_e type, char *data1, char *data2);
2953
2954 /*****************************************************************************************/
2955 /* wifi_direct_service_del API function prototype
2956  * int wifi_direct_serv_disc_cancel(int handle)
2957  */
2958 /**
2959  * \brief This API shall delete the service user expects. \n
2960  * @param handle              query handle to delete. Application had requested service discovery to manager and has gotten this handle.
2961  *
2962  * \see wifi_direct_service_add.
2963  * \see wifi_direct_service_del.
2964  * \see wifi_direct_serv_disc_req.
2965  *
2966  * \par Sync (or) Async:
2967  * This is a Synchronous API.
2968  *
2969  * \warning
2970  *  None
2971  *
2972  *
2973  * \return Return Type (int) \n
2974  *      WIFI_DIRECT_ERROR_NONE on Success \n
2975  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
2976  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
2977  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
2978  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2979  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2980  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2981  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2982  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2983  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2984  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2985  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2986  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2987  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2988  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2989  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2990  *
2991  *
2992  *
2993  *\endcode
2994  *
2995  *\remarks None.
2996  *
2997  ******************************************************************************/
2998 int wifi_direct_serv_disc_cancel(int handle);
2999
3000 /*****************************************************************************************/
3001 /* wifi_direct_init_wifi_display API function prototype
3002  * int wifi_direct_init_wifi_display(wifi_direct_display_type type, int port, int hdcp)
3003  */
3004 /**
3005  * \brief This API shall initialize the wifi display. \n
3006  * @param type              wifi direct display device type.
3007  * @param port              port number that is used by wifi direct display.
3008  * @param hdcp              indicate that hdcp is support capability.
3009  *
3010  * \see wifi_direct_deinit_wifi_display.
3011  * \see wifi_direct_get_display_port
3012  * \see wifi_direct_get_display_type.
3013  *
3014  * \par Sync (or) Async:
3015  * This is a Synchronous API.
3016  *
3017  * \warning
3018  *  None
3019  *
3020  *
3021  * \return Return Type (int) \n
3022  *      WIFI_DIRECT_ERROR_NONE on Success \n
3023  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
3024  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
3025  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
3026  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3027  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3028  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3029  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3030  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3031  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3032  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3033  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3034  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3035  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3036  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3037  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3038  *
3039  *
3040  *
3041  *\endcode
3042  *
3043  *\remarks None.
3044  *
3045  ******************************************************************************/
3046 int wifi_direct_init_wifi_display(wifi_direct_display_type_e type, int port, int hdcp);
3047
3048 /*****************************************************************************************/
3049 /* wifi_direct_deinit_wifi_display API function prototype
3050  * int wifi_direct_deinit_wifi_display(void)
3051  */
3052 /**
3053  * \brief This API shall deinitialize the wifi direct display. \n
3054  *
3055  * \see wifi_direct_init_wifi_display.
3056  * \see wifi_direct_get_display_port
3057  * \see wifi_direct_get_display_type.
3058  *
3059  * \par Sync (or) Async:
3060  * This is a Synchronous API.
3061  *
3062  * \warning
3063  *  None
3064  *
3065  *
3066  * \return Return Type (int) \n
3067  *      WIFI_DIRECT_ERROR_NONE on Success \n
3068  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
3069  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
3070  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
3071  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3072  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3073  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3074  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3075  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3076  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3077  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3078  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3079  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3080  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3081  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3082  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3083  *
3084  *
3085  *
3086  *\endcode
3087  *
3088  *\remarks None.
3089  *
3090  ******************************************************************************/
3091 int wifi_direct_deinit_wifi_display(void);
3092
3093 /*****************************************************************************************/
3094 /* wifi_direct_get_display_port API function prototype
3095  * int wifi_direct_get_display_port(int *port)
3096  */
3097 /**
3098  * \brief This API shall get wifi display port. \n
3099  * @param port              TCP control port of this wifi direct diplay device. Application had enabled the wifi direct display before use this function.
3100  *
3101  * \see wifi_direct_init_wifi_display.
3102  * \see wifi_direct_deinit_wifi_display.
3103  * \see wifi_direct_get_display_type.
3104  *
3105  * \par Sync (or) Async:
3106  * This is a Synchronous API.
3107  *
3108  * \warning
3109  *  None
3110  *
3111  *
3112  * \return Return Type (int) \n
3113  *      WIFI_DIRECT_ERROR_NONE on Success \n
3114  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
3115  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
3116  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
3117  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3118  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3119  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3120  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3121  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3122  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3123  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3124  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3125  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3126  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3127  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3128  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3129  *
3130  *
3131  *
3132  *\endcode
3133  *
3134  *\remarks None.
3135  *
3136  ******************************************************************************/
3137 int wifi_direct_get_display_port(int *port);
3138
3139 /*****************************************************************************************/
3140 /* wifi_direct_get_display_type API function prototype
3141  * int wifi_direct_get_display_type(wifi_direct_display_type *type)
3142  */
3143 /**
3144  * \brief This API shall get wifi display type. \n
3145  * @param type              wifi direct display type of this device. Application had enabled the wifi direct display before use this function.
3146  *
3147  * \see wifi_direct_init_wifi_display.
3148  * \see wifi_direct_deinit_wifi_display.
3149  * \see wifi_direct_get_display_port.
3150  *
3151  * \par Sync (or) Async:
3152  * This is a Synchronous API.
3153  *
3154  * \warning
3155  *  None
3156  *
3157  *
3158  * \return Return Type (int) \n
3159  *      WIFI_DIRECT_ERROR_NONE on Success \n
3160  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
3161  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
3162  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
3163  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3164  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3165  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3166  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3167  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3168  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3169  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3170  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3171  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3172  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3173  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3174  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3175  *
3176  *
3177  *
3178  *\endcode
3179  *
3180  *\remarks None.
3181  *
3182  ******************************************************************************/
3183 int wifi_direct_get_display_type(wifi_direct_display_type_e *type);
3184
3185 /*****************************************************************************************/
3186 /* wifi_direct_add_to_access_list API function prototype
3187  * int wifi_direct_add_to_access_list(const char *mac_address, bool allow)
3188  */
3189 /**
3190  * \brief This API shall add device to list to automatically allow or deny connection request. \n
3191  * @param mac_address              device mac address to add device list.
3192  * @param allow                                         allow or deny flag.
3193  *
3194  * \see wifi_direct_del_from_access_list.
3195  *
3196  * \par Sync (or) Async:
3197  * This is a Synchronous API.
3198  *
3199  * \warning
3200  *  None
3201  *
3202  *
3203  * \return Return Type (int) \n
3204  *      WIFI_DIRECT_ERROR_NONE on Success \n
3205  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
3206  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
3207  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
3208  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3209  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3210  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3211  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3212  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3213  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3214  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3215  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3216  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3217  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3218  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3219  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3220  *
3221  *
3222  *
3223  *\endcode
3224  *
3225  *\remarks None.
3226  *
3227  ******************************************************************************/
3228 int wifi_direct_add_to_access_list(const char *mac_address, bool allow);
3229
3230 /*****************************************************************************************/
3231 /* wifi_direct_del_from_access_list API function prototype
3232  * int wifi_direct_del_from_access_list(const char *mac_address, bool allow)
3233  */
3234 /**
3235  * \brief This API shall add device to list to automatically allow or deny connection request. \n
3236  * @param mac_address              device mac address to delete from list.
3237  *                                                                                if 00:00:00:00:00:00, reset list
3238  *
3239  * \see wifi_direct_add_to_access_list.
3240  *
3241  * \par Sync (or) Async:
3242  * This is a Synchronous API.
3243  *
3244  * \warning
3245  *  None
3246  *
3247  *
3248  * \return Return Type (int) \n
3249  *      WIFI_DIRECT_ERROR_NONE on Success \n
3250  *      WIFI_DIRECT_ERROR_NOT_PERMITTED  for Operation not permitted \n
3251  *      WIFI_DIRECT_ERROR_OUT_OF_MEMORY  for Out of memory \n
3252  *      WIFI_DIRECT_ERROR_RESOURCE_BUSY  for Device or resource busy \n
3253  *      WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3254  *      WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3255  *      WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3256  *      WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3257  *      WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3258  *      WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3259  *      WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3260  *      WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3261  *      WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3262  *      WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3263  *      WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3264  *      WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3265  *
3266  *
3267  *
3268  *\endcode
3269  *
3270  *\remarks None.
3271  *
3272  ******************************************************************************/
3273 int wifi_direct_del_from_access_list(const char *mac_address);
3274
3275 /**
3276  * @}
3277  */
3278
3279 #ifdef __cplusplus
3280 }
3281 #endif
3282
3283 #endif                                                  //__WIFI_DIRECT_INTERFACE_H_