4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef __WIFI_DIRECT_INTERFACE_H_
23 #define __WIFI_DIRECT_INTERFACE_H_
35 * @addtogroup CAPI_NET_WIFI_DIRECT_MODULE
40 * @brief Enumeration for Wi-Fi Direct error code
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;
63 * @brief Enumeration for Wi-Fi Direct link status
67 WIFI_DIRECT_STATE_DEACTIVATED = 0,
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;
80 * @brief Enumeration for Wi-Fi Direct device state
84 WIFI_DIRECT_DEVICE_STATE_ACTIVATED,
85 WIFI_DIRECT_DEVICE_STATE_DEACTIVATED,
86 } wifi_direct_device_state_e;
89 * @brief Enumeration for Wi-Fi Direct discovery state
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;
100 * @brief Enumeration for Wi-Fi Direct connection state
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;
117 * @brief Enumeration for Wi-Fi Direct secondary device type
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,
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,
179 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_MIC = 6, /**< */
180 } wifi_direct_secondary_device_type_e;
183 * @brief Enumeration for Wi-Fi Direct primary device type
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;
202 * @brief Enumeration for Wi-Fi WPS type
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;
213 * @brief Service Discovery type enumerations
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;
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;
234 * @struct wifi_direct_discovered_peer_info_s
235 * Wi-Fi Direct buffer structure to store result of peer discovery
239 char *device_name; /** Null-terminated device friendly name. */
240 char *mac_address; /** Device's P2P Device Address */
241 char *interface_address; /** Device's P2P Interface Address. Valid only if device is a P2P GO. */
242 int channel; /** Channel the device is listening on. */
243 bool is_connected; /** Is peer connected*/
244 bool is_group_owner; /** Is an active P2P Group Owner */
245 bool is_persistent_group_owner; /** Is a stored Persistent GO */
246 wifi_direct_primary_device_type_e primary_device_type; /** Primary category of device */
247 wifi_direct_secondary_device_type_e secondary_device_type; /** Sub category of device */
248 int supported_wps_types; /** The list of supported WPS type. \n
249 The OR operation on #wifi_direct_wps_type_e can be used like #WIFI_DIRECT_WPS_TYPE_PBC | #WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY */
250 char *ssid; /**< Service set identifier - DEPRECATED */
251 unsigned int service_count;
254 } wifi_direct_discovered_peer_info_s;
258 * @struct wifi_direct_connected_peer_info_s
259 * Wi-Fi Direct buffer structure to store information of connected peer
263 char* device_name; /** Device friendly name. */
264 char* ip_address; /**< The IP address */
265 char* mac_address; /** Device's P2P Device Address */
266 char* interface_address; /** Device's P2P Interface Address */
267 bool p2p_supported; /* whether peer is a P2P device */
268 wifi_direct_primary_device_type_e primary_device_type; /* primary category of device */
269 int channel; /* Operating channel */
270 char* ssid; /**< Service set identifier - DEPRECATED */
271 unsigned int service_count;
274 } wifi_direct_connected_peer_info_s;
277 * Notification callback function type. \n
279 * Discover notifications can occur at the peers or P2P groups are found.
281 * @param event Specifies the types of notifications.
282 * - WIFI_DIRECT_DISCOVERY_STARTED
283 * - WIFI_DIRECT_ONLY_LISTEN_STARTED
284 * - WIFI_DIRECT_DISCOVERY_FOUND
285 * - WIFI_DIRECT_DISCOVERY_FINISHED
286 * @param error_code In failure case.
287 * @param user_data User can transfer the user specific data in callback.
290 typedef void (*wifi_direct_discovery_state_chagned_cb) (int error_code,
291 wifi_direct_discovery_state_e discovery_state,
295 * Notification callback function type. \n
297 * Activation notifications callback function type.
299 * @param event Specifies the types of notifications.
300 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED
301 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED
302 * @param error_code In failure case.
303 * @param user_data User can transfer the user specific data in callback.
306 typedef void (*wifi_direct_device_state_changed_cb) (int error_code,
307 wifi_direct_device_state_e device_state,
311 * connection notification callback function type. \n
313 * @param event Specifies the types of notifications.
314 * - WIFI_DIRECT_CONNECTION_REQ
315 * - WIFI_DIRECT_CONNECTION_WPS_REQ
316 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS
317 * - WIFI_DIRECT_CONNECTION_RSP
318 * - WIFI_DIRECT_DISASSOCIATION_IND
319 * - WIFI_DIRECT_DISCONNECTION_RSP
320 * - WIFI_DIRECT_DISCONNECTION_IND
321 * - WIFI_DIRECT_GROUP_CREATED
322 * - WIFI_DIRECT_GROUP_DESTROYED
324 * @param error_code In failure case.
326 * @param param1 additional data for connection. ex) MAC
327 * @param param2 additional data for connection. ex) SSID
329 * @param user_data User can transfer the user specific data in callback.
332 typedef void (*wifi_direct_connection_state_changed_cb) (int error_code,
333 wifi_direct_connection_state_e connection_state,
334 const char *mac_address,
338 * @brief Called when IP address of client is assigned when your device is group owner.
339 * @param[in] mac_address The MAC address of connection peer
340 * @param[in] ip_address The IP address of connection peer
341 * @param[in] interface_address The interface address of connection peer
342 * @param[in] user_data The user data passed from the callback registration function
343 * @see wifi_direct_set_client_ip_address_assigned_cb()
344 * @see wifi_direct_unset_client_ip_address_assigned_cb()
346 typedef void (*wifi_direct_client_ip_address_assigned_cb) (const char *mac_address,
347 const char *ip_address,
348 const char *interface_address,
351 /*=============================================================================
352 Wifi Direct Client APIs
353 =============================================================================*/
355 /*****************************************************************************/
356 /* wifi_direct_initialize API function prototype
357 * int wifi_direct_initialize (void);
360 * \brief This API shall register the client application with the Wi-Fi Direct server and initialize the various variables. \n
364 * \post Application is registered.
366 * \see wifi_direct_device_state_changed_cb
367 * \see wifi_direct_discovery_state_chagned_cb
368 * \see wifi_direct_connection_state_changed_cb
370 * \par Sync (or) Async:
371 * This is a Synchronous API.
376 * \return Return Type (int) \n
378 * - WIFI_DIRECT_ERROR_NONE on success \n
379 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
380 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
381 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
382 * - WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for "Too many users" \n
383 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
384 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
386 * \par Prospective Clients:
392 * #include <wifi-direct.h>
399 * result = wifi_direct_initialize();
401 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully connected to the wifi direct server
404 ******************************************************************************/
405 int wifi_direct_initialize(void);
408 /*****************************************************************************************/
409 /* wifi_direct_deinitialize API function prototype
410 * int wifi_direct_deinitialize(void);
414 * \brief This API shall deregister the client application with the Wi-Fi Direct server and releases all resources.
416 * \pre Application must be already registered to the Wi-Fi Direct server.
418 * \post Application is de-registered.
420 * \see wifi_direct_initialize
422 * \par Sync (or) Async:
423 * This is a Synchronous API.
429 * \par Async Response Message:
433 * \return Return Type (int) \n
434 * - WIFI_DIRECT_ERROR_NONE on success \n
435 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
436 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
437 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
438 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
439 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
440 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
442 * \par Prospective Clients:
447 * #include <wifi-direct.h>
454 * result = wifi_direct_deinitialize();
456 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deregister is successful
462 ******************************************************************************/
463 int wifi_direct_deinitialize(void);
466 /*****************************************************************************/
467 /* wifi_direct_set_connection_state_changed_cb API function prototype
468 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_device_state_changed_cb cb, void* user_data)
471 * \brief This API shall register the activation callback function and user data from client. \n
473 * \pre The Client should be initialized.
475 * \see wifi_direct_initialize
476 * \see wifi_direct_device_state_changed_cb
478 * \par Sync (or) Async:
479 * This is a Synchronous API.
484 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
485 * \param[in] user_data user data
487 * \return Return Type (int) \n
489 * - WIFI_DIRECT_ERROR_NONE on success \n
490 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
492 * \par Prospective Clients:
498 * #include <wifi-direct.h>
505 * result = wifi_direct_set_connection_state_changed_cb(_cb_activation, void* user_data);
507 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
510 ******************************************************************************/
511 int wifi_direct_set_device_state_changed_cb(wifi_direct_device_state_changed_cb cb, void *user_data);
514 /*****************************************************************************/
515 /* wifi_direct_unset_connection_state_changed_cb API function prototype
516 * int wifi_direct_unset_connection_state_changed_cb(void)
519 * \brief This API shall deregister the activation callback function and user data from client. \n
521 * \pre The Client should be initialized.
523 * \see wifi_direct_initialize
524 * \see wifi_direct_set_connection_state_changed_cb
526 * \par Sync (or) Async:
527 * This is a Synchronous API.
532 * \return Return Type (int) \n
534 * - WIFI_DIRECT_ERROR_NONE on success \n
535 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
537 * \par Prospective Clients:
543 * #include <wifi-direct.h>
550 * result = wifi_direct_unset_connection_state_changed_cb();
552 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
555 ******************************************************************************/
556 int wifi_direct_unset_device_state_changed_cb(void);
560 /*****************************************************************************/
561 /* wifi_direct_set_discovery_state_changed_cb API function prototype
562 * int wifi_direct_set_discover_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void* user_data)
565 * \brief This API shall register the discover callback function and user data from client. \n
567 * \pre The Client should be initialized.
569 * \see wifi_direct_initialize
570 * \see wifi_direct_discovery_state_chagned_cb
572 * \par Sync (or) Async:
573 * This is a Synchronous API.
578 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
579 * \param[in] user_data user data
581 * \return Return Type (int) \n
583 * - WIFI_DIRECT_ERROR_NONE on success \n
584 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
586 * \par Prospective Clients:
592 * #include <wifi-direct.h>
599 * result = wifi_direct_set_discovery_state_changed_cb(_cb_discover, void* user_data);
601 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
604 ******************************************************************************/
605 int wifi_direct_set_discovery_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void *user_data);
608 /*****************************************************************************/
609 /* wifi_direct_unset_discovery_state_changed_cb API function prototype
610 * int wifi_direct_unset_discovery_state_changed_cb(void)
613 * \brief This API shall deregister the discover callback function and user data from client. \n
615 * \pre The Client should be initialized.
617 * \see wifi_direct_initialize
618 * \see wifi_direct_set_discovery_state_changed_cb
620 * \par Sync (or) Async:
621 * This is a Synchronous API.
626 * \return Return Type (int) \n
628 * - WIFI_DIRECT_ERROR_NONE on success \n
629 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
631 * \par Prospective Clients:
637 * #include <wifi-direct.h>
644 * result = wifi_direct_unset_discovery_state_changed_cb();
646 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
649 ******************************************************************************/
650 int wifi_direct_unset_discovery_state_changed_cb(void);
654 /*****************************************************************************/
655 /* wifi_direct_set_connection_state_changed_cb API function prototype
656 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void* user_data)
659 * \brief This API shall register the connection callback function and user data from client. \n
661 * \pre The Client should be initialized.
663 * \see wifi_direct_initialize
664 * \see wifi_direct_connection_state_changed_cb
666 * \par Sync (or) Async:
667 * This is a Synchronous API.
672 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
673 * \param[in] user_data user data
675 * \return Return Type (int) \n
677 * - WIFI_DIRECT_ERROR_NONE on success \n
678 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
680 * \par Prospective Clients:
686 * #include <wifi-direct.h>
693 * result = wifi_direct_set_connection_state_changed_cb(_cb_connection, void* user_data);
695 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
698 ******************************************************************************/
699 int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void *user_data);
702 /*****************************************************************************/
703 /* wifi_direct_unset_connection_state_changed_cb API function prototype
704 * int wifi_direct_unset_connection_state_changed_cb(void)
707 * \brief This API shall deregister the connection callback function and user data from client. \n
709 * \pre The Client should be initialized.
711 * \see wifi_direct_initialize
712 * \see wifi_direct_set_connection_state_changed_cb
714 * \par Sync (or) Async:
715 * This is a Synchronous API.
720 * \return Return Type (int) \n
722 * - WIFI_DIRECT_ERROR_NONE on success \n
723 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
725 * \par Prospective Clients:
731 * #include <wifi-direct.h>
738 * result = wifi_direct_unset_connection_state_changed_cb();
740 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
743 ******************************************************************************/
744 int wifi_direct_unset_connection_state_changed_cb(void);
748 * @brief Registers the callback called when IP address of client is assigned when your device is group owner.
749 * @param[in] cb The callback function to invoke
750 * @param[in] user_data The user data to be passed to the callback function
751 * @return 0 on success, otherwise a negative error value.
752 * @retval #WIFI_DIRECT_ERROR_NONE Successful
753 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
754 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
755 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
756 * @see wifi_direct_initialize()
757 * @see wifi_direct_unset_client_ip_address_assigned_cb()
758 * @see wifi_direct_client_ip_address_assigned_cb()
760 int wifi_direct_set_client_ip_address_assigned_cb(wifi_direct_client_ip_address_assigned_cb cb, void *user_data);
764 * @brief Unregisters the callback called when IP address of client is assigned when your device is group owner.
765 * @return 0 on success, otherwise a negative error value.
766 * @retval #WIFI_DIRECT_ERROR_NONE Successful
767 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
768 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
769 * @see wifi_direct_initialize()
770 * @see wifi_direct_set_connection_state_changed_cb()
772 int wifi_direct_unset_client_ip_address_assigned_cb(void);
775 /*****************************************************************************************/
776 /* wifi_direct_activate API function prototype
777 * int wifi_direct_activate(void);
781 * \brief This API shall open a wireless adapter device for P2P use.
783 * \pre Application must be already registered to the Wi-Fi Direct server.
785 * \post wireless adapter device will be ready to use.
787 * \see wifi_direct_initialize
789 * \par Sync (or) Async:
790 * This is a Asynchronous API.
796 * \par Async Response Message:
797 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when activation process is completed. \n
800 * \return Return Type (int*) \n
801 * - WIFI_DIRECT_ERROR_NONE on success \n
802 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
803 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
804 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
805 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
806 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
807 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
808 * - WIFI_DIRECT_ERROR_WIFI_USED for "WiFi is being used" \n
809 * - WIFI_DIRECT_ERROR_MOBILE_AP_USED for "Mobile AP is being used" \n
812 * \par Prospective Clients:
817 * #include <wifi-direct.h>
824 * result = wifi_direct_activate();
826 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activation is successful
832 ******************************************************************************/
833 int wifi_direct_activate(void);
836 /*****************************************************************************************/
837 /* wifi_direct_deactivate API function prototype
838 * int wifi_direct_deactivate(void);
842 * \brief This API shall close a wireless adapter device for P2P use
844 * \pre Wireless adapter device must be already opened.
846 * \post wireless adapter device will be closed.
848 * \see wifi_direct_activate
850 * \par Sync (or) Async:
851 * This is a Asynchronous API.
857 * \par Async Response Message:
858 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when deactivation process is completed. \n
860 * \return Return Type (int) \n
861 * - WIFI_DIRECT_ERROR_NONE on success \n
862 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
863 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
864 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
865 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
866 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
867 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
870 * \par Prospective Clients:
875 * #include <wifi-direct.h>
881 * result = wifi_direct_deactivate();
883 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deactivation is successful
889 ******************************************************************************/
890 int wifi_direct_deactivate(void);
893 /*****************************************************************************************/
894 /* wifi_direct_start_discovery API function prototype
895 * int wifi_direct_start_discovery(bool listen_only, int timeout);
898 * \brief This API shall Start a discovery to find all P2P capable devices. \n
899 * Applications will be notified event via wifi_direct_discovery_state_chagned_cb(). \n
901 * @param listen_only if true, skip the initial 802.11 scan and then enter
902 * Listen state instead of cycling between Search and Listen.
903 * @param timeout Specifies the duration of discovery period, in seconds.
904 * APs. If 0, a default value will be used, which depends on UX guideline.
906 * \pre Wireless adapter device must be already opened.
909 * \see wifi_direct_get_discovery_result
911 * \par Sync (or) Async:
912 * This is a Asynchronous API.
918 * \par Async Response Message:
919 * - WIFI_DIRECT_DISCOVERY_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (80211 Scan) started. \n
920 * - 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
921 * - WIFI_DIRECT_DISCOVERY_FOUND : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when peer or group is found. \n
922 * - WIFI_DIRECT_DISCOVERY_FINISHED : Once the whole discovery process is completed, applications will receive it via wifi_direct_discovery_state_chagned_cb (). \n
923 * Applications may then call wifi_direct_foreach_discovered_peers() to get the final result. \n
924 * With the intermediate or final list of P2P capable devices, applications can update their UI if needed. \n
925 * It is up to the applications to control how often to update their UI display. \n
928 * \return Return Type (int) \n
929 * - WIFI_DIRECT_ERROR_NONE on success \n
930 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
931 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
932 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
933 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
934 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
935 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
936 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
939 * \par Prospective Clients:
944 * #include <wifi-direct.h>
951 * result = wifi_direct_start_discovery(TRUE, 0);
953 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery request is successful
957 *\remarks If discover is over, peer can not find the device and the device can not find peer, too.
959 ******************************************************************************/
960 int wifi_direct_start_discovery(bool listen_only, int timeout);
963 /*****************************************************************************************/
964 /* wifi_direct_cancel_discovery API function prototype
965 * int wifi_direct_cancel_discovery(void);
968 * \brief This API shall cancel the discovery process started from wifi_direct_start_discovery. \n
970 * \pre discovery process must be started.
972 * \post discovery process stopped.
974 * \see wifi_direct_client_start_discovery
976 * \par Sync (or) Async:
977 * This is a Asynchronous API.
983 * \par Async Response Message:
984 * - WIFI_DIRECT_DISCOVERY_FINISHED : Applications will receive a this event
985 * via callback when the discovery process is cancelled or completed.
988 * \return Return Type (int) \n
989 * - WIFI_DIRECT_ERROR_NONE on success \n
990 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
991 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
992 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
993 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
994 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
995 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
997 * \par Prospective Clients:
1002 * #include <wifi-direct.h>
1009 * result = wifi_direct_cancel_discovery();
1011 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery cancel request is successful
1017 ******************************************************************************/
1018 int wifi_direct_cancel_discovery(void);
1022 * discorverd peers notification callback function type. \n
1024 * @param peer The discovered peer information.
1025 * @param user_data The user data passed from the foreach function.
1026 * @return @c true to continue with the next iteration of the loop,
1027 * \n @c false to break out of the loop.
1029 * @pre wifi_direct_foreach_discovered_peers() will invoke this function.
1031 * @see wifi_direct_foreach_discovered_peers()
1034 typedef bool(*wifi_direct_discovered_peer_cb) (wifi_direct_discovered_peer_info_s *peer, void *user_data);
1037 /*****************************************************************************************/
1038 /* wifi_direct_foreach_discovered_peers API function prototype
1039 * int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb, void* user_data)
1042 * \brief This API shall get the information of all discovered peers. \n
1044 * @param callback The callback function to invoke.
1045 * @param user_data The user data passed from the foreach function.
1047 * \see wifi_direct_discovered_peer_cb
1049 * \par Sync (or) Async:
1050 * This is a Synchronous API.
1055 * \return Return Type (int) \n
1056 * - WIFI_DIRECT_ERROR_NONE on success \n
1057 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1058 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1059 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1060 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1061 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1062 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1063 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1066 * \par Prospective Clients:
1071 * #include <wifi-direct.h>
1073 * bool _cb_discovered_peers_impl(wifi_direct_discovered_peer_info_s* peer, void* user_data)
1075 * struct appdata* ad = (struct appdata*) user_data;
1079 * if ( ad->peer_count >= MAX_PEER_NUM )
1080 * return false; // break out of the loop
1082 * memcpy(&ad->peer_list[ad->peer_count], peer, sizeof(wifi_direct_discovered_peer_info_s));
1086 * return true; // continue with the next iteration of the loop
1094 * ad->peer_list = NULL;
1095 * ad->peer_count = 0;
1096 * ad ->selected_peer_index = 0;
1097 * result = wifi_direct_foreach_discovered_peers(_cb_discovered_peers_impl, (void*)ad);
1099 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1105 ******************************************************************************/
1106 int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb callback,
1110 /*****************************************************************************************/
1111 /* wifi_direct_connect API function prototype
1112 * int wifi_direct_connect(const char* mac_address);
1115 * \brief This API shall connect to specified peer by automatically determining whether to perform group \n
1116 * formation, join an existing group, invite, re-invoke a group. The decision is \n
1117 * based on the current state of the peers (i.e. GO, STA, not connected) and the \n
1118 * availability of persistent data. \n
1120 * @param mac_addr Device address of target peer.
1122 * \par Sync (or) Async:
1123 * This is a Asynchronous API.
1129 * \par Async Response Message:
1130 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
1131 * via callback when the connection process is started.
1132 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
1133 * via callback when the connection process is completed or failed.
1135 * \return Return Type (int) \n
1136 * - WIFI_DIRECT_ERROR_NONE on success \n
1137 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1138 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1139 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1140 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1141 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1142 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1143 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
1144 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1145 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1146 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1149 * \par Prospective Clients:
1154 * #include <wifi-direct.h>
1156 * void foo(unsigned char* mac_addr)
1161 * result = wifi_direct_connect(mac_addr);
1163 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
1167 *\remarks This API will try to send provisioning request befre connecting.
1169 ******************************************************************************/
1170 int wifi_direct_connect(const char *mac_address);
1173 * @brief Cancel the connection now in progress .
1174 * @param[in] mac_address The MAC address of rejected device.
1175 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1176 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1177 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1178 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1179 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1180 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1182 int wifi_direct_cancel_connection(const char *mac_address);
1185 * @brief Reject the connection request from other device now in progress.
1186 * @param[in] mac_address The MAC address of rejected device.
1187 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1188 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1189 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1190 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1191 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1192 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1194 int wifi_direct_reject_connection(const char *mac_address);
1196 /*****************************************************************************************/
1197 /* wifi_direct_disconnect_all API function prototype
1198 * int wifi_direct_disconnect_all(void);
1201 * \brief This API shall tear down all connected links to peers (stop soft AP, and close interface). \n
1203 * \see wifi_direct_connect
1205 * \par Sync (or) Async:
1206 * This is a Asynchronous API.
1212 * \par Async Response Message:
1213 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive this event
1214 * via callback when the disconnection process is completed.
1217 * \return Return Type (int) \n
1218 * - WIFI_DIRECT_ERROR_NONE on success \n
1219 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1220 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1221 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1222 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1223 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1224 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1227 * \par Prospective Clients:
1232 * #include <wifi-direct.h>
1239 * result = wifi_direct_disconnect_all();
1241 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1247 ******************************************************************************/
1248 int wifi_direct_disconnect_all(void);
1252 /*****************************************************************************************/
1253 /* wifi_direct_disconnect API function prototype
1254 * int wifi_direct_disconnect(const char* mac_address);
1257 * \brief This API shall disconnect the specified peer by mac address.
1259 * @param mac_addr Device address of target peer.
1263 * \par Sync (or) Async:
1264 * This is a Asynchronous API.
1270 * \par Async Response Message:
1271 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive a this event
1272 * via callback when a peer is disconnected.
1274 * \return Return Type (int) \n
1275 * - WIFI_DIRECT_ERROR_NONE on success \n
1276 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1277 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1278 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1279 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1280 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1281 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1282 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1285 * \par Prospective Clients:
1290 * #include <wifi-direct.h>
1292 * void foo(unsigned char* mac_addr)
1297 * result = wifi_direct_disconnect(mac_addr);
1299 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1305 ******************************************************************************/
1306 int wifi_direct_disconnect(const char *mac_address);
1311 * connected peers notification callback function type. \n
1313 * @param peer The connected peer information.
1314 * @param user_data The user data passed from the foreach function.
1315 * @return @c true to continue with the next iteration of the loop,
1316 * \n @c false to break out of the loop.
1318 * @pre wifi_direct_foreach_connected_peers() will invoke this function.
1320 * @see wifi_direct_foreach_connected_peers()
1323 typedef bool(*wifi_direct_connected_peer_cb) (wifi_direct_connected_peer_info_s *peer,
1327 /*****************************************************************************************/
1328 /* wifi_direct_foreach_connected_peers API function prototype
1329 * int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb, void* user_data)
1332 * \brief This API shall get the information of all connected peers. \n
1334 * @param callback The callback function to invoke.
1335 * @param user_data The user data passed from the foreach function.
1337 * \see wifi_direct_connected_peer_cb
1339 * \par Sync (or) Async:
1340 * This is a Synchronous API.
1345 * \return Return Type (int) \n
1346 * - WIFI_DIRECT_ERROR_NONE on success \n
1347 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1348 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1349 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1350 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1351 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1352 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1353 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1355 * \par Prospective Clients:
1360 * #include <wifi-direct.h>
1362 * bool _cb_connected_peers_impl(wifi_direct_connected_peer_info_s* peer, void* user_data)
1365 * struct appdata* ad = (struct appdata*) user_data;
1369 * if ( ad->connected_peer_count >= MAX_PEER_NUM )
1370 * return false; // break out of the loop
1372 * memcpy(&ad->connected_peer_list[ad->connected_peer_count], peer, sizeof(wifi_direct_connected_peer_info_s));
1373 * ad->connected_peer_count++;
1377 * return true; // continue with the next iteration of the loop
1384 * ad->connected_peer_list = NULL;
1385 * ad->connected_peer_count = 0;
1387 * result = wifi_direct_foreach_connected_peers(_cb_connected_peers_impl, (void*)ad);
1389 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1395 ******************************************************************************/
1396 int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb
1397 callback, void *user_data);
1401 /*****************************************************************************************/
1402 /* wifi_direct_create_group API function prototype
1403 * int wifi_direct_create_group();
1406 * \brief This API shall set up device as a Group Owner and wait for clients to connect. \n
1407 * Create a soft AP, start the WPS registrar, start the DHCP server. \n
1409 * \see wifi_direct_destroy_group
1411 * \par Sync (or) Async:
1412 * This is a Asynchronous API.
1418 * \par Async Response Message:
1419 * - WIFI_DIRECT_GROUP_CREATED : Applications will receive this event
1420 * via callback when the group creating request is successful. \n
1421 * Errorcode will be set to the WFD_ERROR_CREATE_LINK_FAIL value. \n
1423 * \return Return Type (int) \n
1424 * - WIFI_DIRECT_ERROR_NONE on success \n
1425 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1426 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1427 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1428 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1429 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1430 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1431 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1432 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1435 * \par Prospective Clients:
1440 * #include <wifi-direct.h>
1447 * result = wifi_direct_create_group();
1449 * if(result == WIFI_DIRECT_ERROR_NONE)......... // create group request is successful
1455 ******************************************************************************/
1456 int wifi_direct_create_group(void);
1460 /*****************************************************************************************/
1461 /* wifi_direct_destroy_group API function prototype
1462 * int wifi_direct_destroy_group();
1465 * \brief This API shall cancel P2P Group create or tear down a P2P Group that we own. \n
1467 * \see wifi_direct_create_group
1469 * \par Sync (or) Async:
1470 * This is a Asynchronous API.
1476 * \par Async Response Message:
1477 * - WIFI_DIRECT_GROUP_DESTROYED : Applications will receive this event via callback when the group is cancelled. \n
1479 * \return Return Type (int) \n
1480 * - WIFI_DIRECT_ERROR_NONE on success \n
1481 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1482 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1483 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1484 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1485 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1486 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1487 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1488 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1491 * \par Prospective Clients:
1496 * #include <wifi-direct.h>
1503 * result = wifi_direct_destroy_group();
1505 * if(result == WIFI_DIRECT_ERROR_NONE)......... // cancel group request is successful
1511 ******************************************************************************/
1512 int wifi_direct_destroy_group(void);
1515 /*****************************************************************************************/
1516 /* wifi_direct_is_group_owner API function prototype
1517 * int wifi_direct_is_group_owner(bool *owner);
1520 * \brief This API shall check whether the currunt client is group owner or not.
1521 * @param owner Memory to store the value of TURE or FALSE. Application must allocate memory.
1523 * \see wifi_direct_create_group
1525 * \par Sync (or) Async:
1526 * This is a Synchronous API.
1531 * \return Return Type (int) \n
1532 * - WIFI_DIRECT_ERROR_NONE on success \n
1533 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1534 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1535 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1536 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1537 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1538 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1539 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1541 * \par Prospective Clients:
1546 * #include <wifi-direct.h>
1554 * result = wifi_direct_is_group_owner(&owner);
1557 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1563 ******************************************************************************/
1564 int wifi_direct_is_group_owner(bool *is_group_owner);
1568 /*****************************************************************************************/
1569 /* wifi_direct_is_autonomous_group API function prototype
1570 * int wifi_direct_is_autonomous_group(bool *autonomous_group);
1573 * \brief This API shall check whether the currunt group is autonomous group or not.
1574 * @param autonomous_group Memory to store the value of TURE or FALSE. Application must allocate memory.
1576 * \see wifi_direct_create_group
1578 * \par Sync (or) Async:
1579 * This is a Synchronous API.
1584 * \return Return Type (int) \n
1585 * - WIFI_DIRECT_ERROR_NONE on success \n
1586 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1587 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1588 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1589 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1590 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1591 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1592 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1594 * \par Prospective Clients:
1599 * #include <wifi-direct.h>
1605 * bool autonomous_group;
1607 * result = wifi_direct_is_autonomous_group(&autonomous_group);
1610 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1616 ******************************************************************************/
1617 int wifi_direct_is_autonomous_group(bool *is_autonomous_group);
1622 /*****************************************************************************************/
1623 /* wifi_direct_set_ssid API function prototype
1624 * int wifi_direct_set_ssid(const char* ssid);
1627 * \brief This API shall set or update ssid of local device. \n
1628 * @param ssid new ssid to set. Application must set the new ssid before.
1630 * \see wifi_direct_get_ssid
1632 * \par Sync (or) Async:
1633 * This is a Synchronous API.
1639 * \return Return Type (int) \n
1640 * - WIFI_DIRECT_ERROR_NONE on success \n
1641 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1642 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1643 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1644 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1645 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1646 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1647 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1650 * \par Prospective Clients:
1655 * #include <wifi-direct.h>
1660 * char ssid[11] = {0,};
1662 * memset(pin, 0x00, sizeof(pin));
1663 * printf("Input 8 digit PIN number :\n");
1666 *if( strlen(ssid) > 0 )
1667 * result = wifi_direct_set_ssid(ssid);
1669 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting ssid is successful
1673 *\remarks When the wifi direct is re-activated, ssid will be reset to the device name. \n
1676 ******************************************************************************/
1677 int wifi_direct_set_ssid(const char *ssid);
1681 * @brief Sets the friendly name of local device.
1682 * @details This device name is shown to other devices during device discovery.
1683 * @remarks The name set by you is only valid during activated state.
1684 * After Wi-Fi Direct is deactivated, this name will be as the phone name.
1685 * @param[in] device_name The name to local device
1686 * @return 0 on success, otherwise a negative error value.
1687 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1688 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1689 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1690 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1691 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitteds
1692 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1693 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1694 * @pre Wi-Fi Direct must be activated by wifi_direct_activate().
1695 * @see wifi_direct_activate()
1696 * @see wifi_direct_get_device_name()
1698 int wifi_direct_set_device_name(const char *device_name);
1701 * @brief Gets the name of local device.
1702 * @remarks @a device_name must be released with free() by you.
1703 * @param[out] device_name The name to local device
1704 * @return 0 on success, otherwise a negative error value.
1705 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1706 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1707 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1708 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1709 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1710 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1711 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1712 * @see wifi_direct_initialize()
1713 * @see wifi_direct_set_device_name()
1715 int wifi_direct_get_device_name(char **device_name);
1717 /*****************************************************************************************/
1718 /* wifi_direct_get_ssid API function prototype
1719 * int wifi_direct_get_ssid(char** ssid)
1722 * \brief This API shall get ssid of local device. \n
1723 * @param ssid Pointer to store ssid. Application must free this memory.
1725 * \par Sync (or) Async:
1726 * This is a Synchronous API.
1732 * \return Return Type (int) \n
1733 * - WIFI_DIRECT_ERROR_NONE on success \n
1734 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1735 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1736 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1737 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1738 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1739 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1740 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1743 * \par Prospective Clients:
1748 * #include <wifi-direct.h>
1753 * char* ssid = NULL;
1755 * result = wifi_direct_get_ssid(&ssid);
1757 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting ssid is successful
1759 * free(ssid); // Application should free the memory.
1766 ******************************************************************************/
1767 int wifi_direct_get_ssid(char **ssid);
1771 * @brief Gets the name of network interface. For example, eth0 and pdp0.
1772 * @remarks @a name must be released with free() by you.
1773 * @param[out] name The name of network interface
1774 * @return 0 on success, otherwise negative error value.
1775 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1776 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1777 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1778 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1779 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1780 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1781 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1782 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1783 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1784 * @see wifi_direct_activate()
1786 int wifi_direct_get_network_interface_name(char **name);
1789 /*****************************************************************************************/
1790 /* wifi_direct_get_ip_address API function prototype
1791 * int wifi_direct_get_ip_address(char** ip_address)
1794 * \brief This API shall get IP address of local device interface. \n
1795 * @param ip_addr Pointer to store ip address. Application must free this memory.
1797 * \par Sync (or) Async:
1798 * This is a Synchronous API.
1804 * \return Return Type (int) \n
1805 * - WIFI_DIRECT_ERROR_NONE on success \n
1806 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1807 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1808 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1809 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1810 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1811 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1812 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1815 * \par Prospective Clients:
1820 * #include <wifi-direct.h>
1827 * result = wifi_direct_get_ip_address(&ip);
1829 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting IP is successful
1831 * free(ip); // Application should free the memory.
1837 ******************************************************************************/
1838 int wifi_direct_get_ip_address(char **ip_address);
1841 * @brief Gets the Subnet Mask.
1842 * @remarks @a subnet_mask must be released with free() by you.
1843 * @param[out] subnet_mask The subnet mask
1844 * @return 0 on success, otherwise negative error value.
1845 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1846 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1847 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1848 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1849 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1850 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1851 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1852 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1853 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1854 * @see wifi_direct_activate()
1856 int wifi_direct_get_subnet_mask(char **subnet_mask);
1860 * @brief Gets the Gateway address.
1861 * @remarks @a gateway_address must be released with free() by you.
1862 * @param[out] gateway_address The gateway address
1863 * @return 0 on success, otherwise negative error value.
1864 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1865 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1866 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1867 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1868 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1869 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1870 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1871 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1872 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1873 * @see wifi_direct_activate()
1875 int wifi_direct_get_gateway_address(char **gateway_address);
1879 /*****************************************************************************************/
1880 /* wifi_direct_get_mac_addr API function prototype
1881 * int wifi_direct_get_mac_address(char **mac_address)
1884 * \brief This API shall get device MAC address of local device.\n
1885 * @param mac_addr Pointer to store MAC address. Application must free this memory.
1887 * \par Sync (or) Async:
1888 * This is a Synchronous API.
1894 * \return Return Type (int) \n
1895 * - WIFI_DIRECT_ERROR_NONE on success \n
1896 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1897 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1898 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1899 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1900 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1901 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1902 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1905 * \par Prospective Clients:
1910 * #include <wifi-direct.h>
1915 * char* mac_addr =NULL;
1917 * result = wifi_direct_get_mac_addr(&mac_addr);
1919 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting device MAC is successful
1925 ******************************************************************************/
1926 int wifi_direct_get_mac_address(char **mac_address);
1929 /*****************************************************************************************/
1930 /* wifi_direct_get_state API function prototype
1931 * int wifi_direct_get_state(wifi_direct_state_e * status);
1934 * \brief This API shall get current Wi-Fi direct link status. \n
1935 * @param status Memory to store link status information. Application must allocate memory.
1937 * \see wifi_direct_state_e
1939 * \par Sync (or) Async:
1940 * This is a Synchronous API.
1946 * \return Return Type (int) \n
1947 * - WIFI_DIRECT_ERROR_NONE on success \n
1948 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1949 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1950 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1951 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1952 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1953 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1954 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1957 * \par Prospective Clients:
1962 * #include <wifi-direct.h>
1967 * wifi_direct_state_e status;
1969 * result = wifi_direct_get_state(&status);
1971 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting link status is successful
1977 ******************************************************************************/
1978 int wifi_direct_get_state(wifi_direct_state_e *state);
1983 * @brief Checks whether this device is discoverable or not by P2P discovery.
1984 * @details If you call wifi_direct_start_discovery(), then your device can be discoverable.
1985 * @param[out] discoverable The status of discoverable: (@c true = discoverable, @c false = non-discoverable)
1986 * @return 0 on success, otherwise a negative error value.
1987 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1988 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1989 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1990 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1991 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1992 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1993 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1994 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1995 * @see wifi_direct_initialize()
1996 * @see wifi_direct_start_discovery()
1997 * @see wifi_direct_cancel_discovery()
1999 int wifi_direct_is_discoverable(bool *discoverable);
2002 * @brief Checks whether the local device is listening only.
2003 * @details If you call wifi_direct_start_discovery() with @a listen_only as @c true,
2004 * then skip the initial 802.11 Scan and then enter Listen state instead of cycling between Scan andListen.
2005 * @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)
2006 * @return 0 on success, otherwise a negative error value.
2007 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2008 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2009 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2010 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2011 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2012 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2013 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2014 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
2015 * @see wifi_direct_start_discovery()
2016 * @see wifi_direct_cancel_discovery()
2017 * @see wifi_direct_is_discoverable()
2019 int wifi_direct_is_listening_only(bool *listen_only);
2022 * @brief Gets the primary device type of local device.
2023 * @param[out] type The primary device type
2024 * @return 0 on success, otherwise a negative error value.
2025 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2026 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2027 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2028 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2029 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2030 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2031 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2032 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2033 * @see wifi_direct_initialize()
2035 int wifi_direct_get_primary_device_type(wifi_direct_primary_device_type_e *type);
2038 * @brief Gets the secondary device type of local device.
2039 * @param[out] type The secondary device type
2040 * @return 0 on success, otherwise a negative error value.
2041 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2042 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2043 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2044 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2045 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2046 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2047 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2048 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2049 * @see wifi_direct_initialize()
2051 int wifi_direct_get_secondary_device_type(wifi_direct_secondary_device_type_e *type);
2054 /*****************************************************************************************/
2055 /* wifi_direct_accept_connection API function prototype
2056 * int wifi_direct_accept_connection(char* mac_address);
2059 * \brief This API shall accept connection request from specified peer. \n
2060 * This API shall be used to respond the connection request event, WIFI_DIRECT_CONNECTION_REQ.
2062 * @param mac_addr Device address of target peer.
2064 * \see wifi_direct_connect
2066 * \par Sync (or) Async:
2067 * This is a Asynchronous API.
2072 * \par Async Response Message:
2073 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
2074 * via callback when the connection process is started.
2075 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
2076 * via callback when the connection process is completed or failed.
2078 * \return Return Type (int) \n
2079 * - WIFI_DIRECT_ERROR_NONE on success \n
2080 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2081 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2082 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2083 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2084 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2085 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2086 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
2087 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2088 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
2089 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
2092 * \par Prospective Clients:
2097 * #include <wifi-direct.h>
2099 * void foo(unsigned char* mac_addr)
2103 * result = wifi_direct_accept_connection(mac_addr);
2105 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
2109 *\remarks This API will not try to send provisioning request.
2111 ******************************************************************************/
2112 int wifi_direct_accept_connection(char *mac_address);
2115 /*****************************************************************************************/
2116 /* wifi_direct_get_passphrase API function prototype
2117 * int wifi_direct_get_passphrase(char** passphrase)
2120 * \brief If a client create Group (Soft AP), this API shall get wpa password. \n
2121 * @param passphrase Pointer to store wpa password. Application must free this memory.
2124 * \par Sync (or) Async:
2125 * This is a Synchronous API.
2131 * \return Return Type (int) \n
2132 * - WIFI_DIRECT_ERROR_NONE on success \n
2133 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2134 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2135 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2136 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2137 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2138 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2139 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2141 * \par Prospective Clients:
2146 * #include <wifi-direct.h>
2153 * result=wifi_direct_get_passphrase(&wpa);
2155 * if(result == WIFI_DIRECT_ERROR_NONE)........//getting wpa passphrase is successful
2157 * free(wpa); // Application should free the memory
2163 ******************************************************************************/
2164 int wifi_direct_get_passphrase(char **passphrase);
2167 /*****************************************************************************************/
2168 /* wifi_direct_set_wpa_passphrase API function prototype
2169 * int wifi_direct_set_wpa_passphrase(char* passphrase)
2172 * \brief This API shall set or update wpa password. If a client create Group (Soft AP), this password will be used. \n
2173 * @param passphrase new wpa password to set. Application must set the new password before.
2176 * \par Sync (or) Async:
2177 * This is a Synchronous API.
2183 * \return Return Type (int) \n
2184 * - WIFI_DIRECT_ERROR_NONE on success \n
2185 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2186 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2187 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2188 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2189 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2190 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2191 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2193 * \par Prospective Clients:
2198 * #include <wifi-direct.h>
2203 * char new_wpa[64+1] = {0,};
2205 * printf("Input new WPA:\n");
2206 * scanf("%s",new_wpa);
2208 *if( strlen(new_wpa) > 0 )
2209 * result = wifi_direct_set_wpa_passphrase(new_wpa);
2211 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting password is successful
2217 ******************************************************************************/
2218 int wifi_direct_set_wpa_passphrase(char *passphrase);
2221 /*****************************************************************************************/
2222 /* wifi_direct_activate_pushbutton API function prototype
2223 * int wifi_direct_activate_pushbutton(void);
2226 * \brief This API shall start wps PBC.
2228 * \pre Device must support the pbc button mode.
2230 * \see wifi_direct_foreach_supported_wps_types
2232 * \par Sync (or) Async:
2233 * This is a Synchronous API.
2238 * \return Return Type (int) \n
2239 * - WIFI_DIRECT_ERROR_NONE on success \n
2240 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2241 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2242 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2243 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2244 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2245 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2247 * \par Prospective Clients:
2252 * #include <wifi-direct.h>
2259 * result = wifi_direct_activate_pushbutton();
2261 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activating push button is successful
2267 ******************************************************************************/
2268 int wifi_direct_activate_pushbutton(void);
2271 /*****************************************************************************************/
2272 /* wifi_direct_set_wps_pin API function prototype
2273 * int wifi_direct_set_wps_pin(char* pin)
2276 * \brief This API shall set or update the WPS PIN number user expects. \n
2277 * @param pin new pin to set. Application must set the new pin number before.
2279 * \see wifi_direct_generate_wps_pin.
2280 * \see wifi_direct_get_wps_pin
2282 * \par Sync (or) Async:
2283 * This is a Synchronous API.
2289 * \return Return Type (int) \n
2290 * - WIFI_DIRECT_ERROR_NONE on success \n
2291 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2292 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2293 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2294 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2295 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2296 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2297 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2300 * \par Prospective Clients:
2305 * #include <wifi-direct.h>
2310 * char pin[WIFI_DIRECT_WPS_PIN_LEN+1]= { 0, };
2312 * memset(pin, 0x00, sizeof(pin));
2313 * printf("Input 8 digit PIN number :\n");
2316 *if( strlen(pin) > 0 )
2317 * result = wifi_direct_set_wps_pin(pin);
2319 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting wps pin number is successful
2325 ******************************************************************************/
2326 int wifi_direct_set_wps_pin(char *pin);
2329 /*****************************************************************************************/
2330 /* wifi_direct_get_wps_pin API function prototype
2331 * int wifi_direct_get_wps_pin(char** pin)
2334 * \brief This API shall get the WPS PIN number. \n
2335 * @param pin Pointer to store pin number. Application must free this memory.
2337 * \see wifi_direct_set_wps_pin
2339 * \par Sync (or) Async:
2340 * This is a Synchronous API.
2346 * \return Return Type (int) \n
2347 * - WIFI_DIRECT_ERROR_NONE on success \n
2348 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2349 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2350 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2351 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2352 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2353 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2354 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2357 * \par Prospective Clients:
2362 * #include <wifi-direct.h>
2369 * result = wifi_direct_get_wps_pin(&pin);
2371 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting wps pin number is successful
2373 * free(pin); // Application should free the memory.
2379 ******************************************************************************/
2380 int wifi_direct_get_wps_pin(char **pin);
2383 /*****************************************************************************************/
2384 /* wifi_direct_generate_wps_pin API function prototype
2385 * wifi_direct_generate_wps_pin(void);
2388 * \brief This API shall generate the random WPS PIN number.\n
2389 * To get the generated PIN number, use wifi_direct_get_wps_pin() API.
2391 * \see wifi_direct_set_wps_pin
2392 * \see wifi_direct_get_wps_pin
2394 * \par Sync (or) Async:
2395 * This is a Synchronous API.
2401 * \return Return Type (int) \n
2402 * - WIFI_DIRECT_ERROR_NONE on success \n
2403 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2404 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2405 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2406 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2407 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2408 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2411 * \par Prospective Clients:
2416 * #include <wifi-direct.h>
2422 * result = wifi_direct_generate_wps_pin();
2424 * if(result == WIFI_DIRECT_ERROR_NONE)......... // generating wps pin number is successful
2430 ******************************************************************************/
2431 int wifi_direct_generate_wps_pin(void);
2434 /*****************************************************************************************/
2435 /* wifi_direct_get_supported_wps_mode API function prototype
2436 * int wifi_direct_get_supported_wps_mode(int *wps_mode);
2439 * \brief This API shall get the supported wps mode. \n
2440 * The result is bit flag.
2442 * @param wps_mode Memory to store supported wps mode. Application must allocate memory.
2444 * \see wifi_direct_wps_type_e
2446 * \par Sync (or) Async:
2447 * This is a Synchronous API.
2453 * \return Return Type (int) \n
2454 * - WIFI_DIRECT_ERROR_NONE on success \n
2455 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2456 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2457 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2458 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2459 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2460 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2461 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2464 * \par Prospective Clients:
2469 * #include <wifi-direct.h>
2474 * int supported_wps_mode = 0;
2476 * result = wifi_direct_get_supported_wps_mode(&supported_wps_mode);
2478 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting supported wps mode is successful
2484 ******************************************************************************/
2485 int wifi_direct_get_supported_wps_mode(int *wps_mode);
2489 * @brief Called when you get the supported WPS(Wi-Fi Protected Setup) type repeatedly.
2490 * @param[in] type The type of WPS
2491 * @param[in] user_data The user data passed from the request function
2492 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
2493 * @pre wifi_direct_foreach_supported_wps_types() will invoke this callback.
2494 * @see wifi_direct_foreach_supported_wps_types()
2496 typedef bool(*wifi_direct_supported_wps_type_cb)(wifi_direct_wps_type_e type, void *user_data);
2499 * @brief Gets the supported WPS(Wi-Fi Protected Setup) types.
2500 * @param[in] callback The callback function to invoke
2501 * @param[in] user_data The user data to be passed to the callback function
2502 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2503 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2504 * @see wifi_direct_supported_wps_type_cb()
2506 int wifi_direct_foreach_supported_wps_types(wifi_direct_supported_wps_type_cb callback, void *user_data);
2509 * @brief Gets the WPS(Wi-Fi Protected Setup) type.
2510 * @param[out] type The type of WPS
2511 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2512 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2513 * @see wifi_direct_foreach_supported_wps_types()
2515 int wifi_direct_get_local_wps_type(wifi_direct_wps_type_e *type);
2518 * @brief Sets the requested WPS(Wi-Fi Protected Setup) type.
2519 * @param[in] type The type of WPS
2520 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2521 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2522 * @see wifi_direct_foreach_supported_wps_types()
2524 int wifi_direct_set_req_wps_type(wifi_direct_wps_type_e type);
2527 * @brief Gets the requested WPS(Wi-Fi Protected Setup) type.
2528 * @param[out] type The type of WPS
2529 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2530 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2531 * @see wifi_direct_foreach_supported_wps_types()
2533 int wifi_direct_get_req_wps_type(wifi_direct_wps_type_e *type);
2536 * @brief Sets the intent of a group owner.
2537 * @remakrs The range of intent is 0 ~ 15.
2538 * @param[in] intent The intent of a group owner
2539 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2540 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2541 * @see wifi_direct_get_group_owner_intent()
2543 int wifi_direct_set_group_owner_intent(int intent);
2546 * @brief Gets the intent of a group owner.
2547 * @param[out] intent The intent of a group owner
2548 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2549 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2550 * @see wifi_direct_set_group_owner_intent()
2552 int wifi_direct_get_group_owner_intent(int *intent);
2555 * @brief Sets the max number of clients.
2556 * @param[in] max The max number of clients
2557 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2558 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2559 * @see wifi_direct_get_max_clients()
2561 int wifi_direct_set_max_clients(int max);
2564 * @brief Gets the max number of clients.
2565 * @param[in] max The max number of clients
2566 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2567 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2568 * @see wifi_direct_set_max_clients()
2570 int wifi_direct_get_max_clients(int *max);
2574 * @brief Gets the channel of own group. - DEPRECATED
2575 * @param[out] channel The channel of own group
2576 * @return 0 on success, otherwise a negative error value.
2577 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2578 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2579 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2580 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2581 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2582 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2583 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2584 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2585 * @see wifi_direct_initialize()
2587 int wifi_direct_get_own_group_channel(int *channel);
2591 * @brief Gets the operating channel.
2592 * @param[out] channel The operating channel
2593 * @return 0 on success, otherwise a negative error value.
2594 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2595 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2596 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2597 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2598 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2599 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2600 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2601 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2602 * @see wifi_direct_initialize()
2604 int wifi_direct_get_operating_channel(int *channel);
2607 * @brief Sets the Autoconnection mode.
2609 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2610 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2611 * @see wifi_direct_foreach_supported_wps_types()
2613 int wifi_direct_set_autoconnection_mode(bool mode);
2615 int wifi_direct_is_autoconnection_mode(bool *mode);
2618 * @brief Enables the persistent group.
2619 * @details If @a enabled is true, then P2P persisten group will be used when creating a group and establishing a connection.
2620 * @param[in] enabled The status of persistent group: (@c true = enabled, @c false = disabled)
2621 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2622 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2623 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2624 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2625 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2626 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2627 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2628 * @see wifi_direct_initialize()
2629 * @see wifi_direct_is_persistent_group_enabled()
2631 int wifi_direct_set_persistent_group_enabled(bool enabled);
2634 * @brief Checks whether the persistent group is enabled or disabled.
2635 * @param[out] enabled The status of persistent group: (@c true = enabled, @c false = disabled)
2636 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2637 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2638 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2639 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2640 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2641 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2642 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2643 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2644 * @see wifi_direct_initialize()
2645 * @see wifi_direct_set_persistent_group_enabled()
2647 int wifi_direct_is_persistent_group_enabled(bool *enabled);
2651 * @brief Called when you get the persistent groups repeatedly.
2652 * @param[in] mac_address The MAC address of persistent group owner
2653 * @param[in] ssid The SSID(Service Set Identifier) of persistent group owner
2654 * @param[in] user_data The user data passed from the request function
2655 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of theloop
2656 * @pre wifi_direct_foreach_persistent_groups() will invoke this callback.
2657 * @see wifi_direct_foreach_persistent_groups()
2659 typedef bool(*wifi_direct_persistent_group_cb)(const char *mac_address, const char *ssid, void *user_data);
2662 * @brief Gets the persistent groups.
2663 * @param[in] callback The callback function to invoke
2664 * @param[in] user_data The user data to be passed to the callback function
2665 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2666 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2667 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2668 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2669 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2670 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2671 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2672 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2673 * @post wifi_direct_persistent_group_cb() will be called.
2674 * @see wifi_direct_initialize()
2675 * @see wifi_direct_persistent_group_cb()
2677 int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb callback, void *user_data);
2680 * @brief Remove a persistent group.
2681 * @param[in] mac_address The MAC address of persistent group owner
2682 * @param[in] ssid The SSID(Service Set Identifier) of persistent group owner
2683 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2684 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2685 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2686 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2687 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2688 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2689 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2690 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2691 * @see wifi_direct_initialize()
2692 * @see wifi_direct_foreach_persistent_groups()
2694 int wifi_direct_remove_persistent_group(const char *mac_address, const char *ssid);
2696 /*****************************************************************************************/
2697 /* wifi_direct_service_add API function prototype
2698 * int wifi_direct_service_add(wifi_direct_service_type_e type, char *data1, char *data2)
2701 * \brief This API shall add the service user expects. \n
2702 * @param type new service type to add. Application must run the new service before.
2703 * @param data1 new service query to add. Application must run the new service before.
2705 * bonjour: <RDATA hexdump>
2706 * vendor specific: <service string>
2707 * @param data2 new service data to add. Application must run the new service before.
2708 * upnp: <version hex>
2709 * bonjour: <query hexdump>
2710 * vendor specific: NULL
2712 * \see wifi_direct_service_del.
2713 * \see wifi_direct_serv_disc_req.
2714 * \see wifi_direct_serv_disc_cancel.
2716 * \par Sync (or) Async:
2717 * This is a Synchronous API.
2723 * \return Return Type (int) \n
2724 * WIFI_DIRECT_ERROR_NONE on Success \n
2725 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2726 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2727 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2728 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2729 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2730 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2731 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2732 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2733 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2734 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2735 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2736 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2737 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2738 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2739 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2746 ******************************************************************************/
2747 int wifi_direct_service_add(wifi_direct_service_type_e type, char *data1, char *data2);
2749 /*****************************************************************************************/
2750 /* wifi_direct_service_del API function prototype
2751 * int wifi_direct_service_del(wifi_direct_service_type_e type, char *data1, char *data2)
2754 * \brief This API shall delete the service user expects. \n
2755 * @param type service type to delete. Application must run and add the service to wpasupplicant before.
2756 * @param data1 new service query to delete. Application must run and add the service to wpasupplicant before.
2758 * bonjour: <query hexdump>
2759 * vendor specific: <service string>
2760 * @param data2 new service data to delete. Application must run and add the service to wpasupplicant before.
2761 * upnp: <version hex>
2763 * vendor specific: NULL
2765 * \see wifi_direct_service_add.
2766 * \see wifi_direct_serv_disc_req.
2767 * \see wifi_direct_serv_disc_cancel.
2769 * \par Sync (or) Async:
2770 * This is a Synchronous API.
2776 * \return Return Type (int) \n
2777 * WIFI_DIRECT_ERROR_NONE on Success \n
2778 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2779 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2780 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2781 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2782 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2783 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2784 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2785 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2786 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2787 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2788 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2789 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2790 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2791 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2792 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2799 ******************************************************************************/
2800 int wifi_direct_service_del(wifi_direct_service_type_e type, char *data1, char *data2);
2802 /*****************************************************************************************/
2803 /* wifi_direct_service_del API function prototype
2804 * int wifi_direct_serv_disc_req(char* MAC, wifi_direct_service_type_e type, char *data1, char *data2)
2807 * \brief This API shall delete the service user expects. \n
2808 * @param MAC peer MAC address to discover service. this value can be specific MAC address or 00:00:00:00:00:00 as wildcard
2809 * @param type service type to discover. this value can be NULL if this value is not needed.
2810 * @param data1 service query to discover. this value can be NULL if this value is not needed.
2812 * upnp: <service> or NULL for finding all upnp services
2813 * bonjour: <query hexdump> or NULL for finding all bonjour services
2814 * vendor specific: <service string> or NULL for finding all vendor specific services
2815 * @param data2 service data to discover. this value is mandatory and can be Service Query TLV,
2817 * upnp: <version hex> or NULL for finding all upnp services
2819 * vendor specific: NULL
2821 * \see wifi_direct_service_add.
2822 * \see wifi_direct_service_del.
2823 * \see wifi_direct_serv_disc_cancel.
2825 * \par Sync (or) Async:
2826 * This is a Synchronous API.
2832 * \return Return Type (int) \n
2833 * Request Handle on Success \n
2834 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2835 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2836 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2837 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2838 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2839 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2840 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2841 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2842 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2843 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2844 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2845 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2846 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2847 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2848 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2855 ******************************************************************************/
2856 int wifi_direct_serv_disc_req(char* MAC, wifi_direct_service_type_e type, char *data1, char *data2);
2858 /*****************************************************************************************/
2859 /* wifi_direct_service_del API function prototype
2860 * int wifi_direct_serv_disc_cancel(int handle)
2863 * \brief This API shall delete the service user expects. \n
2864 * @param handle query handle to delete. Application had requested service discovery to manager and has gotten this handle.
2866 * \see wifi_direct_service_add.
2867 * \see wifi_direct_service_del.
2868 * \see wifi_direct_serv_disc_req.
2870 * \par Sync (or) Async:
2871 * This is a Synchronous API.
2877 * \return Return Type (int) \n
2878 * WIFI_DIRECT_ERROR_NONE on Success \n
2879 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2880 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2881 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2882 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2883 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2884 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2885 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2886 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2887 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2888 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2889 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2890 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2891 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2892 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2893 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2901 ******************************************************************************/
2902 int wifi_direct_serv_disc_cancel(int handle);
2904 /*****************************************************************************************/
2905 /* wifi_direct_init_wifi_display API function prototype
2906 * int wifi_direct_init_wifi_display(wifi_direct_display_type type, int port, int hdcp)
2909 * \brief This API shall initialize the wifi display. \n
2910 * @param type wifi direct display device type.
2911 * @param port port number that is used by wifi direct display.
2912 * @param hdcp indicate that hdcp is support capability.
2914 * \see wifi_direct_deinit_wifi_display.
2915 * \see wifi_direct_get_display_port
2916 * \see wifi_direct_get_display_type.
2918 * \par Sync (or) Async:
2919 * This is a Synchronous API.
2925 * \return Return Type (int) \n
2926 * WIFI_DIRECT_ERROR_NONE on Success \n
2927 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2928 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2929 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2930 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2931 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2932 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2933 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2934 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2935 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2936 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2937 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2938 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2939 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2940 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2941 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2949 ******************************************************************************/
2950 int wifi_direct_init_wifi_display(wifi_direct_display_type_e type, int port, int hdcp);
2952 /*****************************************************************************************/
2953 /* wifi_direct_deinit_wifi_display API function prototype
2954 * int wifi_direct_deinit_wifi_display(void)
2957 * \brief This API shall deinitialize the wifi direct display. \n
2959 * \see wifi_direct_init_wifi_display.
2960 * \see wifi_direct_get_display_port
2961 * \see wifi_direct_get_display_type.
2963 * \par Sync (or) Async:
2964 * This is a Synchronous API.
2970 * \return Return Type (int) \n
2971 * WIFI_DIRECT_ERROR_NONE on Success \n
2972 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2973 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2974 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2975 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2976 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2977 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2978 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2979 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2980 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2981 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2982 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2983 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2984 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2985 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2986 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2994 ******************************************************************************/
2995 int wifi_direct_deinit_wifi_display(void);
2997 /*****************************************************************************************/
2998 /* wifi_direct_get_display_port API function prototype
2999 * int wifi_direct_get_display_port(int *port)
3002 * \brief This API shall get wifi display port. \n
3003 * @param port TCP control port of this wifi direct diplay device. Application had enabled the wifi direct display before use this function.
3005 * \see wifi_direct_init_wifi_display.
3006 * \see wifi_direct_deinit_wifi_display.
3007 * \see wifi_direct_get_display_type.
3009 * \par Sync (or) Async:
3010 * This is a Synchronous API.
3016 * \return Return Type (int) \n
3017 * WIFI_DIRECT_ERROR_NONE on Success \n
3018 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3019 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3020 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3021 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3022 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3023 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3024 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3025 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3026 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3027 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3028 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3029 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3030 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3031 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3032 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3040 ******************************************************************************/
3041 int wifi_direct_get_display_port(int *port);
3043 /*****************************************************************************************/
3044 /* wifi_direct_get_display_type API function prototype
3045 * int wifi_direct_get_display_type(wifi_direct_display_type *type)
3048 * \brief This API shall get wifi display type. \n
3049 * @param type wifi direct display type of this device. Application had enabled the wifi direct display before use this function.
3051 * \see wifi_direct_init_wifi_display.
3052 * \see wifi_direct_deinit_wifi_display.
3053 * \see wifi_direct_get_display_port.
3055 * \par Sync (or) Async:
3056 * This is a Synchronous API.
3062 * \return Return Type (int) \n
3063 * WIFI_DIRECT_ERROR_NONE on Success \n
3064 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3065 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3066 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3067 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3068 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3069 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3070 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3071 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3072 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3073 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3074 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3075 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3076 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3077 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3078 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3086 ******************************************************************************/
3087 int wifi_direct_get_display_type(wifi_direct_display_type_e *type);
3089 /*****************************************************************************************/
3090 /* wifi_direct_add_to_access_list API function prototype
3091 * int wifi_direct_add_to_access_list(const char *mac_address, bool allow)
3094 * \brief This API shall add device to list to automatically allow or deny connection request. \n
3095 * @param mac_address device mac address to add device list.
3096 * @param allow allow or deny flag.
3098 * \see wifi_direct_del_from_access_list.
3100 * \par Sync (or) Async:
3101 * This is a Synchronous API.
3107 * \return Return Type (int) \n
3108 * WIFI_DIRECT_ERROR_NONE on Success \n
3109 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3110 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3111 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3112 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3113 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3114 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3115 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3116 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3117 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3118 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3119 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3120 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3121 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3122 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3123 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3131 ******************************************************************************/
3132 int wifi_direct_add_to_access_list(const char *mac_address, bool allow);
3134 /*****************************************************************************************/
3135 /* wifi_direct_del_from_access_list API function prototype
3136 * int wifi_direct_del_from_access_list(const char *mac_address, bool allow)
3139 * \brief This API shall add device to list to automatically allow or deny connection request. \n
3140 * @param mac_address device mac address to delete from list.
3142 * \see wifi_direct_add_to_access_list.
3144 * \par Sync (or) Async:
3145 * This is a Synchronous API.
3151 * \return Return Type (int) \n
3152 * WIFI_DIRECT_ERROR_NONE on Success \n
3153 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3154 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3155 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3156 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3157 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3158 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3159 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3160 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3161 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3162 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3163 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3164 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3165 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3166 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3167 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3175 ******************************************************************************/
3176 int wifi_direct_del_from_access_list(const char *mac_address);
3186 #endif //__WIFI_DIRECT_INTERFACE_H_