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_e;
61 * @brief Enumeration for Wi-Fi Direct link status
65 WIFI_DIRECT_STATE_DEACTIVATED = 0,
67 WIFI_DIRECT_STATE_DEACTIVATING, /**< */
68 WIFI_DIRECT_STATE_ACTIVATING, /**< */
69 WIFI_DIRECT_STATE_ACTIVATED, /**< */
70 WIFI_DIRECT_STATE_DISCOVERING, /**< */
71 WIFI_DIRECT_STATE_CONNECTING, /**< */
72 WIFI_DIRECT_STATE_DISCONNECTING, /**< */
73 WIFI_DIRECT_STATE_CONNECTED, /**< */
74 WIFI_DIRECT_STATE_GROUP_OWNER /**< */
75 } wifi_direct_state_e;
78 * @brief Enumeration for Wi-Fi Direct device state
82 WIFI_DIRECT_DEVICE_STATE_ACTIVATED,
83 WIFI_DIRECT_DEVICE_STATE_DEACTIVATED,
84 } wifi_direct_device_state_e;
87 * @brief Enumeration for Wi-Fi Direct discovery state
91 WIFI_DIRECT_ONLY_LISTEN_STARTED,
92 WIFI_DIRECT_DISCOVERY_STARTED,
93 WIFI_DIRECT_DISCOVERY_FOUND,
94 WIFI_DIRECT_DISCOVERY_FINISHED,
95 } wifi_direct_discovery_state_e;
98 * @brief Enumeration for Wi-Fi Direct connection state
102 WIFI_DIRECT_CONNECTION_REQ, /**< */
103 WIFI_DIRECT_CONNECTION_WPS_REQ, /**< */
104 WIFI_DIRECT_CONNECTION_IN_PROGRESS, /**< */
105 WIFI_DIRECT_CONNECTION_RSP, /**< */
106 WIFI_DIRECT_DISASSOCIATION_IND, /**< */
107 WIFI_DIRECT_DISCONNECTION_RSP, /**< */
108 WIFI_DIRECT_DISCONNECTION_IND, /**< */
109 WIFI_DIRECT_GROUP_CREATED, /**< */
110 WIFI_DIRECT_GROUP_DESTROYED, /**< */
111 WIFI_DIRECT_INVITATION_REQ,
112 } wifi_direct_connection_state_e;
115 * @brief Enumeration for Wi-Fi Direct secondary device type
119 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_PC = 1, /**< */
120 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_SERVER = 2, /**< */
121 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_MEDIA_CTR = 3, /**< */
122 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_UMPC = 4, /**< */
123 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_NOTEBOOK = 5, /**< */
124 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_DESKTOP = 6, /**< */
125 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_MID = 7, /**< */
126 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_NETBOOK = 8, /**< */
127 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_KEYBOARD = 1, /**< */
128 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_MOUSE = 2, /**< */
129 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_JOYSTICK = 3, /**< */
130 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_TRACKBALL = 4, /**< */
131 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_CONTROLLER = 5, /**< */
132 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_REMOTE = 6, /**< */
133 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_TOUCHSCREEN = 7,/**< */
134 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_BIO_READER = 8, /**< */
135 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_BAR_READER = 9, /**< */
136 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_PRINTER = 1, /**< */
137 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_SCANNER = 2, /**< */
138 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_FAX = 3, /**< */
139 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_COPIER = 4, /**< */
140 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_ALLINONE = 5, /**< */
141 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_DIGITAL_STILL = 1, /**< */
142 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_VIDEO = 2, /**< */
143 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_WEBCAM = 3, /**< */
144 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_SECONDARYURITY = 4, /**< */
145 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_STORAGE_NAS = 1, /**< */
146 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_AP = 1, /**< */
147 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_ROUTER = 2, /**< */
148 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_SWITCH = 3, /**< */
149 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_GATEWAY = 4, /**< */
150 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_TV = 1, /**< */
151 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_PIC_FRAME = 2, /**< */
152 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_PROJECTOR = 3, /**< */
153 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_MONITOR = 4, /**< */
154 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_DAR = 1, /**< */
155 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVR = 2, /**< */
156 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MCX = 3, /**< */
157 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB = 4, /**< */
158 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MSMAME = 5, /**< */
159 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP = 6, /**< */
160 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_XBOX = 1, /**< */
161 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_XBOX_360 = 2, /**< */
162 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_PS = 3, /**< */
163 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_CONSOLE = 4, /**< */
164 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_PORTABLE = 5, /**< */
165 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_WM = 1, /**< */
166 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SINGLE = 2, /**< */
167 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_DUAL = 3, /**< */
168 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SM_SINGLE = 4,
170 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SM_DUAL = 5, /**< */
171 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER = 1, /**< */
172 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_SPEAKER = 2, /**< */
173 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_PMP = 3, /**< */
174 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_HEADSET = 4, /**< */
175 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_HEADPHONE = 5,
177 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_MIC = 6, /**< */
178 } wifi_direct_secondary_device_type_e;
181 * @brief Enumeration for Wi-Fi Direct primary device type
185 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_COMPUTER = 1, /**< */
186 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_INPUT_DEVICE = 2, /**< */
187 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_PRINTER = 3, /**< */
188 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_CAMERA = 4, /**< */
189 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_STORAGE = 5, /**< */
190 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_NETWORK_INFRA = 6, /**< */
191 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_DISPLAY = 7, /**< */
192 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_MULTIMEDIA_DEVICE = 8, /**< */
193 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_GAME_DEVICE = 9, /**< */
194 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_TELEPHONE = 10, /**< */
195 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_AUDIO = 11, /**< */
196 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_OTHER = 255 /**< */
197 } wifi_direct_primary_device_type_e;
200 * @brief Enumeration for Wi-Fi WPS type
203 WIFI_DIRECT_WPS_TYPE_NONE = 0x00, /**< No WPS type */
204 WIFI_DIRECT_WPS_TYPE_PBC = 0x01, /**< Push Button Configuration */
205 WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY = 0x02, /**< Display PIN code */
206 WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD = 0x04, /**< Provide the keypad to input the PIN */
207 } wifi_direct_wps_type_e;
211 * @struct wifi_direct_discovered_peer_info_s
212 * Wi-Fi Direct buffer structure to store result of peer discovery
216 char *device_name; /** Null-terminated device friendly name. */
217 char *mac_address; /** Device's P2P Device Address */
218 char *interface_address; /** Device's P2P Interface Address. Valid only if device is a P2P GO. */
219 int channel; /** Channel the device is listening on. */
220 bool is_connected; /** Is peer connected*/
221 bool is_group_owner; /** Is an active P2P Group Owner */
222 bool is_persistent_group_owner; /** Is a stored Persistent GO */
223 wifi_direct_primary_device_type_e primary_device_type; /** Primary category of device */
224 wifi_direct_secondary_device_type_e secondary_device_type; /** Sub category of device */
225 int supported_wps_types; /** The list of supported WPS type. \n
226 The OR operation on #wifi_direct_wps_type_e can be used like #WIFI_DIRECT_WPS_TYPE_PBC | #WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY */
227 char *ssid; /**< Service set identifier - DEPRECATED */
228 } wifi_direct_discovered_peer_info_s;
232 * @struct wifi_direct_connected_peer_info_s
233 * Wi-Fi Direct buffer structure to store information of connected peer
237 char* device_name; /** Device friendly name. */
238 char* ip_address; /**< The IP address */
239 char* mac_address; /** Device's P2P Device Address */
240 char* interface_address; /** Device's P2P Interface Address */
241 bool p2p_supported; /* whether peer is a P2P device */
242 wifi_direct_primary_device_type_e primary_device_type; /* primary category of device */
243 int channel; /* Operating channel */
244 char* ssid; /**< Service set identifier - DEPRECATED */
245 } wifi_direct_connected_peer_info_s;
248 * Notification callback function type. \n
250 * Discover notifications can occur at the peers or P2P groups are found.
252 * @param event Specifies the types of notifications.
253 * - WIFI_DIRECT_DISCOVERY_STARTED
254 * - WIFI_DIRECT_ONLY_LISTEN_STARTED
255 * - WIFI_DIRECT_DISCOVERY_FOUND
256 * - WIFI_DIRECT_DISCOVERY_FINISHED
257 * @param error_code In failure case.
258 * @param user_data User can transfer the user specific data in callback.
261 typedef void (*wifi_direct_discovery_state_chagned_cb) (int error_code,
262 wifi_direct_discovery_state_e discovery_state,
266 * Notification callback function type. \n
268 * Activation notifications callback function type.
270 * @param event Specifies the types of notifications.
271 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED
272 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED
273 * @param error_code In failure case.
274 * @param user_data User can transfer the user specific data in callback.
277 typedef void (*wifi_direct_device_state_changed_cb) (int error_code,
278 wifi_direct_device_state_e device_state,
282 * connection notification callback function type. \n
284 * @param event Specifies the types of notifications.
285 * - WIFI_DIRECT_CONNECTION_REQ
286 * - WIFI_DIRECT_CONNECTION_WPS_REQ
287 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS
288 * - WIFI_DIRECT_CONNECTION_RSP
289 * - WIFI_DIRECT_DISASSOCIATION_IND
290 * - WIFI_DIRECT_DISCONNECTION_RSP
291 * - WIFI_DIRECT_DISCONNECTION_IND
292 * - WIFI_DIRECT_GROUP_CREATED
293 * - WIFI_DIRECT_GROUP_DESTROYED
295 * @param error_code In failure case.
297 * @param param1 additional data for connection. ex) MAC
298 * @param param2 additional data for connection. ex) SSID
300 * @param user_data User can transfer the user specific data in callback.
303 typedef void (*wifi_direct_connection_state_changed_cb) (int error_code,
304 wifi_direct_connection_state_e connection_state,
305 const char *mac_address,
309 * @brief Called when IP address of client is assigned when your device is group owner.
310 * @param[in] mac_address The MAC address of connection peer
311 * @param[in] ip_address The IP address of connection peer
312 * @param[in] interface_address The interface address of connection peer
313 * @param[in] user_data The user data passed from the callback registration function
314 * @see wifi_direct_set_client_ip_address_assigned_cb()
315 * @see wifi_direct_unset_client_ip_address_assigned_cb()
317 typedef void (*wifi_direct_client_ip_address_assigned_cb) (const char *mac_address,
318 const char *ip_address,
319 const char *interface_address,
324 /*=============================================================================
325 Wifi Direct Client APIs
326 =============================================================================*/
328 /*****************************************************************************/
329 /* wifi_direct_initialize API function prototype
330 * int wifi_direct_initialize (void);
333 * \brief This API shall register the client application with the Wi-Fi Direct server and initialize the various variables. \n
337 * \post Application is registered.
339 * \see wifi_direct_device_state_changed_cb
340 * \see wifi_direct_discovery_state_chagned_cb
341 * \see wifi_direct_connection_state_changed_cb
343 * \par Sync (or) Async:
344 * This is a Synchronous API.
349 * \return Return Type (int) \n
351 * - WIFI_DIRECT_ERROR_NONE on success \n
352 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
353 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
354 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
355 * - WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for "Too many users" \n
356 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
357 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
359 * \par Prospective Clients:
365 * #include <wifi-direct.h>
372 * result = wifi_direct_initialize();
374 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully connected to the wifi direct server
377 ******************************************************************************/
378 int wifi_direct_initialize(void);
381 /*****************************************************************************************/
382 /* wifi_direct_deinitialize API function prototype
383 * int wifi_direct_deinitialize(void);
387 * \brief This API shall deregister the client application with the Wi-Fi Direct server and releases all resources.
389 * \pre Application must be already registered to the Wi-Fi Direct server.
391 * \post Application is de-registered.
393 * \see wifi_direct_initialize
395 * \par Sync (or) Async:
396 * This is a Synchronous API.
402 * \par Async Response Message:
406 * \return Return Type (int) \n
407 * - WIFI_DIRECT_ERROR_NONE on success \n
408 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
409 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
410 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
411 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
412 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
413 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
415 * \par Prospective Clients:
420 * #include <wifi-direct.h>
427 * result = wifi_direct_deinitialize();
429 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deregister is successful
435 ******************************************************************************/
436 int wifi_direct_deinitialize(void);
439 /*****************************************************************************/
440 /* wifi_direct_set_connection_state_changed_cb API function prototype
441 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_device_state_changed_cb cb, void* user_data)
444 * \brief This API shall register the activation callback function and user data from client. \n
446 * \pre The Client should be initialized.
448 * \see wifi_direct_initialize
449 * \see wifi_direct_device_state_changed_cb
451 * \par Sync (or) Async:
452 * This is a Synchronous API.
457 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
458 * \param[in] user_data user data
460 * \return Return Type (int) \n
462 * - WIFI_DIRECT_ERROR_NONE on success \n
463 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
465 * \par Prospective Clients:
471 * #include <wifi-direct.h>
478 * result = wifi_direct_set_connection_state_changed_cb(_cb_activation, void* user_data);
480 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
483 ******************************************************************************/
484 int wifi_direct_set_device_state_changed_cb(wifi_direct_device_state_changed_cb cb, void *user_data);
487 /*****************************************************************************/
488 /* wifi_direct_unset_connection_state_changed_cb API function prototype
489 * int wifi_direct_unset_connection_state_changed_cb(void)
492 * \brief This API shall deregister the activation callback function and user data from client. \n
494 * \pre The Client should be initialized.
496 * \see wifi_direct_initialize
497 * \see wifi_direct_set_connection_state_changed_cb
499 * \par Sync (or) Async:
500 * This is a Synchronous API.
505 * \return Return Type (int) \n
507 * - WIFI_DIRECT_ERROR_NONE on success \n
508 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
510 * \par Prospective Clients:
516 * #include <wifi-direct.h>
523 * result = wifi_direct_unset_connection_state_changed_cb();
525 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
528 ******************************************************************************/
529 int wifi_direct_unset_device_state_changed_cb(void);
533 /*****************************************************************************/
534 /* wifi_direct_set_discovery_state_changed_cb API function prototype
535 * int wifi_direct_set_discover_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void* user_data)
538 * \brief This API shall register the discover callback function and user data from client. \n
540 * \pre The Client should be initialized.
542 * \see wifi_direct_initialize
543 * \see wifi_direct_discovery_state_chagned_cb
545 * \par Sync (or) Async:
546 * This is a Synchronous API.
551 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
552 * \param[in] user_data user data
554 * \return Return Type (int) \n
556 * - WIFI_DIRECT_ERROR_NONE on success \n
557 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
559 * \par Prospective Clients:
565 * #include <wifi-direct.h>
572 * result = wifi_direct_set_discovery_state_changed_cb(_cb_discover, void* user_data);
574 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
577 ******************************************************************************/
578 int wifi_direct_set_discovery_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void *user_data);
581 /*****************************************************************************/
582 /* wifi_direct_unset_discovery_state_changed_cb API function prototype
583 * int wifi_direct_unset_discovery_state_changed_cb(void)
586 * \brief This API shall deregister the discover callback function and user data from client. \n
588 * \pre The Client should be initialized.
590 * \see wifi_direct_initialize
591 * \see wifi_direct_set_discovery_state_changed_cb
593 * \par Sync (or) Async:
594 * This is a Synchronous API.
599 * \return Return Type (int) \n
601 * - WIFI_DIRECT_ERROR_NONE on success \n
602 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
604 * \par Prospective Clients:
610 * #include <wifi-direct.h>
617 * result = wifi_direct_unset_discovery_state_changed_cb();
619 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
622 ******************************************************************************/
623 int wifi_direct_unset_discovery_state_changed_cb(void);
627 /*****************************************************************************/
628 /* wifi_direct_set_connection_state_changed_cb API function prototype
629 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void* user_data)
632 * \brief This API shall register the connection callback function and user data from client. \n
634 * \pre The Client should be initialized.
636 * \see wifi_direct_initialize
637 * \see wifi_direct_connection_state_changed_cb
639 * \par Sync (or) Async:
640 * This is a Synchronous API.
645 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
646 * \param[in] user_data user data
648 * \return Return Type (int) \n
650 * - WIFI_DIRECT_ERROR_NONE on success \n
651 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
653 * \par Prospective Clients:
659 * #include <wifi-direct.h>
666 * result = wifi_direct_set_connection_state_changed_cb(_cb_connection, void* user_data);
668 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
671 ******************************************************************************/
672 int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void *user_data);
675 /*****************************************************************************/
676 /* wifi_direct_unset_connection_state_changed_cb API function prototype
677 * int wifi_direct_unset_connection_state_changed_cb(void)
680 * \brief This API shall deregister the connection callback function and user data from client. \n
682 * \pre The Client should be initialized.
684 * \see wifi_direct_initialize
685 * \see wifi_direct_set_connection_state_changed_cb
687 * \par Sync (or) Async:
688 * This is a Synchronous API.
693 * \return Return Type (int) \n
695 * - WIFI_DIRECT_ERROR_NONE on success \n
696 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
698 * \par Prospective Clients:
704 * #include <wifi-direct.h>
711 * result = wifi_direct_unset_connection_state_changed_cb();
713 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
716 ******************************************************************************/
717 int wifi_direct_unset_connection_state_changed_cb(void);
721 * @brief Registers the callback called when IP address of client is assigned when your device is group owner.
722 * @param[in] cb The callback function to invoke
723 * @param[in] user_data The user data to be passed to the callback function
724 * @return 0 on success, otherwise a negative error value.
725 * @retval #WIFI_DIRECT_ERROR_NONE Successful
726 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
727 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
728 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
729 * @see wifi_direct_initialize()
730 * @see wifi_direct_unset_client_ip_address_assigned_cb()
731 * @see wifi_direct_client_ip_address_assigned_cb()
733 int wifi_direct_set_client_ip_address_assigned_cb(wifi_direct_client_ip_address_assigned_cb cb, void *user_data);
737 * @brief Unregisters the callback called when IP address of client is assigned when your device is group owner.
738 * @return 0 on success, otherwise a negative error value.
739 * @retval #WIFI_DIRECT_ERROR_NONE Successful
740 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
741 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
742 * @see wifi_direct_initialize()
743 * @see wifi_direct_set_connection_state_changed_cb()
745 int wifi_direct_unset_client_ip_address_assigned_cb(void);
750 /*****************************************************************************************/
751 /* wifi_direct_activate API function prototype
752 * int wifi_direct_activate(void);
756 * \brief This API shall open a wireless adapter device for P2P use.
758 * \pre Application must be already registered to the Wi-Fi Direct server.
760 * \post wireless adapter device will be ready to use.
762 * \see wifi_direct_initialize
764 * \par Sync (or) Async:
765 * This is a Asynchronous API.
771 * \par Async Response Message:
772 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when activation process is completed. \n
775 * \return Return Type (int*) \n
776 * - WIFI_DIRECT_ERROR_NONE on success \n
777 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
778 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
779 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
780 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
781 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
782 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
783 * - WIFI_DIRECT_ERROR_WIFI_USED for "WiFi is being used" \n
784 * - WIFI_DIRECT_ERROR_MOBILE_AP_USED for "Mobile AP is being used" \n
787 * \par Prospective Clients:
792 * #include <wifi-direct.h>
799 * result = wifi_direct_activate();
801 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activation is successful
807 ******************************************************************************/
808 int wifi_direct_activate(void);
811 /*****************************************************************************************/
812 /* wifi_direct_deactivate API function prototype
813 * int wifi_direct_deactivate(void);
817 * \brief This API shall close a wireless adapter device for P2P use
819 * \pre Wireless adapter device must be already opened.
821 * \post wireless adapter device will be closed.
823 * \see wifi_direct_activate
825 * \par Sync (or) Async:
826 * This is a Asynchronous API.
832 * \par Async Response Message:
833 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when deactivation process is completed. \n
835 * \return Return Type (int) \n
836 * - WIFI_DIRECT_ERROR_NONE on success \n
837 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
838 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
839 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
840 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
841 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
842 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
845 * \par Prospective Clients:
850 * #include <wifi-direct.h>
856 * result = wifi_direct_deactivate();
858 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deactivation is successful
864 ******************************************************************************/
865 int wifi_direct_deactivate(void);
868 /*****************************************************************************************/
869 /* wifi_direct_start_discovery API function prototype
870 * int wifi_direct_start_discovery(bool listen_only, int timeout);
873 * \brief This API shall Start a discovery to find all P2P capable devices. \n
874 * Applications will be notified event via wifi_direct_discovery_state_chagned_cb(). \n
876 * @param listen_only if true, skip the initial 802.11 scan and then enter
877 * Listen state instead of cycling between Search and Listen.
878 * @param timeout Specifies the duration of discovery period, in seconds.
879 * APs. If 0, a default value will be used, which depends on UX guideline.
881 * \pre Wireless adapter device must be already opened.
884 * \see wifi_direct_get_discovery_result
886 * \par Sync (or) Async:
887 * This is a Asynchronous API.
893 * \par Async Response Message:
894 * - WIFI_DIRECT_DISCOVERY_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (80211 Scan) started. \n
895 * - 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
896 * - WIFI_DIRECT_DISCOVERY_FOUND : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when peer or group is found. \n
897 * - WIFI_DIRECT_DISCOVERY_FINISHED : Once the whole discovery process is completed, applications will receive it via wifi_direct_discovery_state_chagned_cb (). \n
898 * Applications may then call wifi_direct_foreach_discovered_peers() to get the final result. \n
899 * With the intermediate or final list of P2P capable devices, applications can update their UI if needed. \n
900 * It is up to the applications to control how often to update their UI display. \n
903 * \return Return Type (int) \n
904 * - WIFI_DIRECT_ERROR_NONE on success \n
905 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
906 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
907 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
908 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
909 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
910 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
911 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
914 * \par Prospective Clients:
919 * #include <wifi-direct.h>
926 * result = wifi_direct_start_discovery(TRUE, 0);
928 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery request is successful
932 *\remarks If discover is over, peer can not find the device and the device can not find peer, too.
934 ******************************************************************************/
935 int wifi_direct_start_discovery(bool listen_only, int timeout);
938 /*****************************************************************************************/
939 /* wifi_direct_cancel_discovery API function prototype
940 * int wifi_direct_cancel_discovery(void);
943 * \brief This API shall cancel the discovery process started from wifi_direct_start_discovery. \n
945 * \pre discovery process must be started.
947 * \post discovery process stopped.
949 * \see wifi_direct_client_start_discovery
951 * \par Sync (or) Async:
952 * This is a Asynchronous API.
958 * \par Async Response Message:
959 * - WIFI_DIRECT_DISCOVERY_FINISHED : Applications will receive a this event
960 * via callback when the discovery process is cancelled or completed.
963 * \return Return Type (int) \n
964 * - WIFI_DIRECT_ERROR_NONE on success \n
965 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
966 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
967 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
968 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
969 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
970 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
972 * \par Prospective Clients:
977 * #include <wifi-direct.h>
984 * result = wifi_direct_cancel_discovery();
986 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery cancel request is successful
992 ******************************************************************************/
993 int wifi_direct_cancel_discovery(void);
997 * discorverd peers notification callback function type. \n
999 * @param peer The discovered peer information.
1000 * @param user_data The user data passed from the foreach function.
1001 * @return @c true to continue with the next iteration of the loop,
1002 * \n @c false to break out of the loop.
1004 * @pre wifi_direct_foreach_discovered_peers() will invoke this function.
1006 * @see wifi_direct_foreach_discovered_peers()
1009 typedef bool(*wifi_direct_discovered_peer_cb) (wifi_direct_discovered_peer_info_s *peer, void *user_data);
1012 /*****************************************************************************************/
1013 /* wifi_direct_foreach_discovered_peers API function prototype
1014 * int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb, void* user_data)
1017 * \brief This API shall get the information of all discovered peers. \n
1019 * @param callback The callback function to invoke.
1020 * @param user_data The user data passed from the foreach function.
1022 * \see wifi_direct_discovered_peer_cb
1024 * \par Sync (or) Async:
1025 * This is a Synchronous API.
1030 * \return Return Type (int) \n
1031 * - WIFI_DIRECT_ERROR_NONE on success \n
1032 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1033 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1034 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1035 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1036 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1037 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1038 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1041 * \par Prospective Clients:
1046 * #include <wifi-direct.h>
1048 * bool _cb_discovered_peers_impl(wifi_direct_discovered_peer_info_s* peer, void* user_data)
1050 * struct appdata* ad = (struct appdata*) user_data;
1054 * if ( ad->peer_count >= MAX_PEER_NUM )
1055 * return false; // break out of the loop
1057 * memcpy(&ad->peer_list[ad->peer_count], peer, sizeof(wifi_direct_discovered_peer_info_s));
1061 * return true; // continue with the next iteration of the loop
1069 * ad->peer_list = NULL;
1070 * ad->peer_count = 0;
1071 * ad ->selected_peer_index = 0;
1072 * result = wifi_direct_foreach_discovered_peers(_cb_discovered_peers_impl, (void*)ad);
1074 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1080 ******************************************************************************/
1081 int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb callback,
1085 /*****************************************************************************************/
1086 /* wifi_direct_connect API function prototype
1087 * int wifi_direct_connect(const char* mac_address);
1090 * \brief This API shall connect to specified peer by automatically determining whether to perform group \n
1091 * formation, join an existing group, invite, re-invoke a group. The decision is \n
1092 * based on the current state of the peers (i.e. GO, STA, not connected) and the \n
1093 * availability of persistent data. \n
1095 * @param mac_addr Device address of target peer.
1097 * \par Sync (or) Async:
1098 * This is a Asynchronous API.
1104 * \par Async Response Message:
1105 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
1106 * via callback when the connection process is started.
1107 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
1108 * via callback when the connection process is completed or failed.
1110 * \return Return Type (int) \n
1111 * - WIFI_DIRECT_ERROR_NONE on success \n
1112 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1113 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1114 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1115 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1116 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1117 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1118 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
1119 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1120 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1121 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1124 * \par Prospective Clients:
1129 * #include <wifi-direct.h>
1131 * void foo(unsigned char* mac_addr)
1136 * result = wifi_direct_connect(mac_addr);
1138 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
1142 *\remarks This API will try to send provisioning request befre connecting.
1144 ******************************************************************************/
1145 int wifi_direct_connect(const char *mac_address);
1148 /*****************************************************************************************/
1149 /* wifi_direct_disconnect_all API function prototype
1150 * int wifi_direct_disconnect_all(void);
1153 * \brief This API shall tear down all connected links to peers (stop soft AP, and close interface). \n
1155 * \see wifi_direct_connect
1157 * \par Sync (or) Async:
1158 * This is a Asynchronous API.
1164 * \par Async Response Message:
1165 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive this event
1166 * via callback when the disconnection process is completed.
1169 * \return Return Type (int) \n
1170 * - WIFI_DIRECT_ERROR_NONE on success \n
1171 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1172 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1173 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1174 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1175 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1176 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1179 * \par Prospective Clients:
1184 * #include <wifi-direct.h>
1191 * result = wifi_direct_disconnect_all();
1193 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1199 ******************************************************************************/
1200 int wifi_direct_disconnect_all(void);
1204 /*****************************************************************************************/
1205 /* wifi_direct_disconnect API function prototype
1206 * int wifi_direct_disconnect(const char* mac_address);
1209 * \brief This API shall disconnect the specified peer by mac address.
1211 * @param mac_addr Device address of target peer.
1215 * \par Sync (or) Async:
1216 * This is a Asynchronous API.
1222 * \par Async Response Message:
1223 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive a this event
1224 * via callback when a peer is disconnected.
1226 * \return Return Type (int) \n
1227 * - WIFI_DIRECT_ERROR_NONE on success \n
1228 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1229 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1230 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1231 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1232 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1233 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1234 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1237 * \par Prospective Clients:
1242 * #include <wifi-direct.h>
1244 * void foo(unsigned char* mac_addr)
1249 * result = wifi_direct_disconnect(mac_addr);
1251 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1257 ******************************************************************************/
1258 int wifi_direct_disconnect(const char *mac_address);
1263 * connected peers notification callback function type. \n
1265 * @param peer The connected peer information.
1266 * @param user_data The user data passed from the foreach function.
1267 * @return @c true to continue with the next iteration of the loop,
1268 * \n @c false to break out of the loop.
1270 * @pre wifi_direct_foreach_connected_peers() will invoke this function.
1272 * @see wifi_direct_foreach_connected_peers()
1275 typedef bool(*wifi_direct_connected_peer_cb) (wifi_direct_connected_peer_info_s *peer,
1279 /*****************************************************************************************/
1280 /* wifi_direct_foreach_connected_peers API function prototype
1281 * int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb, void* user_data)
1284 * \brief This API shall get the information of all connected peers. \n
1286 * @param callback The callback function to invoke.
1287 * @param user_data The user data passed from the foreach function.
1289 * \see wifi_direct_connected_peer_cb
1291 * \par Sync (or) Async:
1292 * This is a Synchronous API.
1297 * \return Return Type (int) \n
1298 * - WIFI_DIRECT_ERROR_NONE on success \n
1299 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1300 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1301 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1302 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1303 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1304 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1305 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1307 * \par Prospective Clients:
1312 * #include <wifi-direct.h>
1314 * bool _cb_connected_peers_impl(wifi_direct_connected_peer_info_s* peer, void* user_data)
1317 * struct appdata* ad = (struct appdata*) user_data;
1321 * if ( ad->connected_peer_count >= MAX_PEER_NUM )
1322 * return false; // break out of the loop
1324 * memcpy(&ad->connected_peer_list[ad->connected_peer_count], peer, sizeof(wifi_direct_connected_peer_info_s));
1325 * ad->connected_peer_count++;
1329 * return true; // continue with the next iteration of the loop
1336 * ad->connected_peer_list = NULL;
1337 * ad->connected_peer_count = 0;
1339 * result = wifi_direct_foreach_connected_peers(_cb_connected_peers_impl, (void*)ad);
1341 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1347 ******************************************************************************/
1348 int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb
1349 callback, void *user_data);
1353 /*****************************************************************************************/
1354 /* wifi_direct_create_group API function prototype
1355 * int wifi_direct_create_group();
1358 * \brief This API shall set up device as a Group Owner and wait for clients to connect. \n
1359 * Create a soft AP, start the WPS registrar, start the DHCP server. \n
1361 * \see wifi_direct_destroy_group
1363 * \par Sync (or) Async:
1364 * This is a Asynchronous API.
1370 * \par Async Response Message:
1371 * - WIFI_DIRECT_GROUP_CREATED : Applications will receive this event
1372 * via callback when the group creating request is successful. \n
1373 * Errorcode will be set to the WFD_ERROR_CREATE_LINK_FAIL value. \n
1375 * \return Return Type (int) \n
1376 * - WIFI_DIRECT_ERROR_NONE on success \n
1377 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1378 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1379 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1380 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1381 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1382 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1383 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1384 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1387 * \par Prospective Clients:
1392 * #include <wifi-direct.h>
1399 * result = wifi_direct_create_group();
1401 * if(result == WIFI_DIRECT_ERROR_NONE)......... // create group request is successful
1407 ******************************************************************************/
1408 int wifi_direct_create_group(void);
1412 /*****************************************************************************************/
1413 /* wifi_direct_destroy_group API function prototype
1414 * int wifi_direct_destroy_group();
1417 * \brief This API shall cancel P2P Group create or tear down a P2P Group that we own. \n
1419 * \see wifi_direct_create_group
1421 * \par Sync (or) Async:
1422 * This is a Asynchronous API.
1428 * \par Async Response Message:
1429 * - WIFI_DIRECT_GROUP_DESTROYED : Applications will receive this event via callback when the group is cancelled. \n
1431 * \return Return Type (int) \n
1432 * - WIFI_DIRECT_ERROR_NONE on success \n
1433 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1434 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1435 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1436 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1437 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1438 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1439 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1440 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1443 * \par Prospective Clients:
1448 * #include <wifi-direct.h>
1455 * result = wifi_direct_destroy_group();
1457 * if(result == WIFI_DIRECT_ERROR_NONE)......... // cancel group request is successful
1463 ******************************************************************************/
1464 int wifi_direct_destroy_group(void);
1467 /*****************************************************************************************/
1468 /* wifi_direct_is_group_owner API function prototype
1469 * int wifi_direct_is_group_owner(bool *owner);
1472 * \brief This API shall check whether the currunt client is group owner or not.
1473 * @param owner Memory to store the value of TURE or FALSE. Application must allocate memory.
1475 * \see wifi_direct_create_group
1477 * \par Sync (or) Async:
1478 * This is a Synchronous API.
1483 * \return Return Type (int) \n
1484 * - WIFI_DIRECT_ERROR_NONE on success \n
1485 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1486 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1487 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1488 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1489 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1490 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1491 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1493 * \par Prospective Clients:
1498 * #include <wifi-direct.h>
1506 * result = wifi_direct_is_group_owner(&owner);
1509 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1515 ******************************************************************************/
1516 int wifi_direct_is_group_owner(bool *is_group_owner);
1520 /*****************************************************************************************/
1521 /* wifi_direct_is_autonomous_group API function prototype
1522 * int wifi_direct_is_autonomous_group(bool *autonomous_group);
1525 * \brief This API shall check whether the currunt group is autonomous group or not.
1526 * @param autonomous_group Memory to store the value of TURE or FALSE. Application must allocate memory.
1528 * \see wifi_direct_create_group
1530 * \par Sync (or) Async:
1531 * This is a Synchronous API.
1536 * \return Return Type (int) \n
1537 * - WIFI_DIRECT_ERROR_NONE on success \n
1538 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1539 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1540 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1541 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1542 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1543 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1544 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1546 * \par Prospective Clients:
1551 * #include <wifi-direct.h>
1557 * bool autonomous_group;
1559 * result = wifi_direct_is_autonomous_group(&autonomous_group);
1562 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1568 ******************************************************************************/
1569 int wifi_direct_is_autonomous_group(bool *is_autonomous_group);
1574 /*****************************************************************************************/
1575 /* wifi_direct_set_ssid API function prototype
1576 * int wifi_direct_set_ssid(const char* ssid);
1579 * \brief This API shall set or update ssid of local device. \n
1580 * @param ssid new ssid to set. Application must set the new ssid before.
1582 * \see wifi_direct_get_ssid
1584 * \par Sync (or) Async:
1585 * This is a Synchronous API.
1591 * \return Return Type (int) \n
1592 * - WIFI_DIRECT_ERROR_NONE on success \n
1593 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1594 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1595 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1596 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1597 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1598 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1599 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1602 * \par Prospective Clients:
1607 * #include <wifi-direct.h>
1612 * char ssid[11] = {0,};
1614 * memset(pin, 0x00, sizeof(pin));
1615 * printf("Input 8 digit PIN number :\n");
1618 *if( strlen(ssid) > 0 )
1619 * result = wifi_direct_set_ssid(ssid);
1621 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting ssid is successful
1625 *\remarks When the wifi direct is re-activated, ssid will be reset to the device name. \n
1628 ******************************************************************************/
1629 int wifi_direct_set_ssid(const char *ssid);
1633 * @brief Sets the friendly name of local device.
1634 * @details This device name is shown to other devices during device discovery.
1635 * @remarks The name set by you is only valid during activated state.
1636 * After Wi-Fi Direct is deactivated, this name will be as the phone name.
1637 * @param[in] device_name The name to local device
1638 * @return 0 on success, otherwise a negative error value.
1639 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1640 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1641 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1642 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1643 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitteds
1644 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1645 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1646 * @pre Wi-Fi Direct must be activated by wifi_direct_activate().
1647 * @see wifi_direct_activate()
1648 * @see wifi_direct_get_device_name()
1650 int wifi_direct_set_device_name(const char *device_name);
1653 * @brief Gets the name of local device.
1654 * @remarks @a device_name must be released with free() by you.
1655 * @param[out] device_name The name to local device
1656 * @return 0 on success, otherwise a negative error value.
1657 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1658 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1659 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1660 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1661 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1662 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1663 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1664 * @see wifi_direct_initialize()
1665 * @see wifi_direct_set_device_name()
1667 int wifi_direct_get_device_name(char **device_name);
1669 /*****************************************************************************************/
1670 /* wifi_direct_get_ssid API function prototype
1671 * int wifi_direct_get_ssid(char** ssid)
1674 * \brief This API shall get ssid of local device. \n
1675 * @param ssid Pointer to store ssid. Application must free this memory.
1677 * \par Sync (or) Async:
1678 * This is a Synchronous API.
1684 * \return Return Type (int) \n
1685 * - WIFI_DIRECT_ERROR_NONE on success \n
1686 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1687 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1688 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1689 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1690 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1691 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1692 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1695 * \par Prospective Clients:
1700 * #include <wifi-direct.h>
1705 * char* ssid = NULL;
1707 * result = wifi_direct_get_ssid(&ssid);
1709 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting ssid is successful
1711 * free(ssid); // Application should free the memory.
1718 ******************************************************************************/
1719 int wifi_direct_get_ssid(char **ssid);
1723 * @brief Gets the name of network interface. For example, eth0 and pdp0.
1724 * @remarks @a name must be released with free() by you.
1725 * @param[out] name The name of network interface
1726 * @return 0 on success, otherwise negative error value.
1727 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1728 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1729 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1730 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1731 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1732 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1733 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1734 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1735 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1736 * @see wifi_direct_activate()
1738 int wifi_direct_get_network_interface_name(char **name);
1741 /*****************************************************************************************/
1742 /* wifi_direct_get_ip_address API function prototype
1743 * int wifi_direct_get_ip_address(char** ip_address)
1746 * \brief This API shall get IP address of local device interface. \n
1747 * @param ip_addr Pointer to store ip address. Application must free this memory.
1749 * \par Sync (or) Async:
1750 * This is a Synchronous API.
1756 * \return Return Type (int) \n
1757 * - WIFI_DIRECT_ERROR_NONE on success \n
1758 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1759 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1760 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1761 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1762 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1763 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1764 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1767 * \par Prospective Clients:
1772 * #include <wifi-direct.h>
1779 * result = wifi_direct_get_ip_address(&ip);
1781 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting IP is successful
1783 * free(ip); // Application should free the memory.
1789 ******************************************************************************/
1790 int wifi_direct_get_ip_address(char **ip_address);
1793 * @brief Gets the Subnet Mask.
1794 * @remarks @a subnet_mask must be released with free() by you.
1795 * @param[out] subnet_mask The subnet mask
1796 * @return 0 on success, otherwise negative error value.
1797 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1798 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1799 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1800 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1801 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1802 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1803 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1804 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1805 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1806 * @see wifi_direct_activate()
1808 int wifi_direct_get_subnet_mask(char **subnet_mask);
1812 * @brief Gets the Gateway address.
1813 * @remarks @a gateway_address must be released with free() by you.
1814 * @param[out] gateway_address The gateway address
1815 * @return 0 on success, otherwise negative error value.
1816 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1817 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1818 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1819 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1820 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1821 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1822 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1823 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1824 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1825 * @see wifi_direct_activate()
1827 int wifi_direct_get_gateway_address(char **gateway_address);
1831 /*****************************************************************************************/
1832 /* wifi_direct_get_mac_addr API function prototype
1833 * int wifi_direct_get_mac_address(char **mac_address)
1836 * \brief This API shall get device MAC address of local device.\n
1837 * @param mac_addr Pointer to store MAC address. Application must free this memory.
1839 * \par Sync (or) Async:
1840 * This is a Synchronous API.
1846 * \return Return Type (int) \n
1847 * - WIFI_DIRECT_ERROR_NONE on success \n
1848 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1849 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1850 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1851 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1852 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1853 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1854 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1857 * \par Prospective Clients:
1862 * #include <wifi-direct.h>
1867 * char* mac_addr =NULL;
1869 * result = wifi_direct_get_mac_addr(&mac_addr);
1871 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting device MAC is successful
1877 ******************************************************************************/
1878 int wifi_direct_get_mac_address(char **mac_address);
1881 /*****************************************************************************************/
1882 /* wifi_direct_get_state API function prototype
1883 * int wifi_direct_get_state(wifi_direct_state_e * status);
1886 * \brief This API shall get current Wi-Fi direct link status. \n
1887 * @param status Memory to store link status information. Application must allocate memory.
1889 * \see wifi_direct_state_e
1891 * \par Sync (or) Async:
1892 * This is a Synchronous API.
1898 * \return Return Type (int) \n
1899 * - WIFI_DIRECT_ERROR_NONE on success \n
1900 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1901 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1902 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1903 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1904 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1905 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1906 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1909 * \par Prospective Clients:
1914 * #include <wifi-direct.h>
1919 * wifi_direct_state_e status;
1921 * result = wifi_direct_get_state(&status);
1923 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting link status is successful
1929 ******************************************************************************/
1930 int wifi_direct_get_state(wifi_direct_state_e *state);
1935 * @brief Checks whether this device is discoverable or not by P2P discovery.
1936 * @details If you call wifi_direct_start_discovery(), then your device can be discoverable.
1937 * @param[out] discoverable The status of discoverable: (@c true = discoverable, @c false = non-discoverable)
1938 * @return 0 on success, otherwise a negative error value.
1939 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1940 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1941 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1942 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1943 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1944 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1945 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1946 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1947 * @see wifi_direct_initialize()
1948 * @see wifi_direct_start_discovery()
1949 * @see wifi_direct_cancel_discovery()
1951 int wifi_direct_is_discoverable(bool *discoverable);
1954 * @brief Checks whether the local device is listening only.
1955 * @details If you call wifi_direct_start_discovery() with @a listen_only as @c true,
1956 * then skip the initial 802.11 Scan and then enter Listen state instead of cycling between Scan andListen.
1957 * @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)
1958 * @return 0 on success, otherwise a negative error value.
1959 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1960 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1961 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1962 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1963 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1964 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1965 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1966 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1967 * @see wifi_direct_start_discovery()
1968 * @see wifi_direct_cancel_discovery()
1969 * @see wifi_direct_is_discoverable()
1971 int wifi_direct_is_listening_only(bool *listen_only);
1974 * @brief Gets the primary device type of local device.
1975 * @param[out] type The primary device type
1976 * @return 0 on success, otherwise a negative error value.
1977 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1978 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1979 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1980 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1981 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1982 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1983 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1984 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1985 * @see wifi_direct_initialize()
1987 int wifi_direct_get_primary_device_type(wifi_direct_primary_device_type_e *type);
1990 * @brief Gets the secondary device type of local device.
1991 * @param[out] type The secondary device type
1992 * @return 0 on success, otherwise a negative error value.
1993 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1994 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1995 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1996 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1997 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1998 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1999 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2000 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2001 * @see wifi_direct_initialize()
2003 int wifi_direct_get_secondary_device_type(wifi_direct_secondary_device_type_e *type);
2006 /*****************************************************************************************/
2007 /* wifi_direct_accept_connection API function prototype
2008 * int wifi_direct_accept_connection(char* mac_address);
2011 * \brief This API shall accept connection request from specified peer. \n
2012 * This API shall be used to respond the connection request event, WIFI_DIRECT_CONNECTION_REQ.
2014 * @param mac_addr Device address of target peer.
2016 * \see wifi_direct_connect
2018 * \par Sync (or) Async:
2019 * This is a Asynchronous API.
2024 * \par Async Response Message:
2025 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
2026 * via callback when the connection process is started.
2027 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
2028 * via callback when the connection process is completed or failed.
2030 * \return Return Type (int) \n
2031 * - WIFI_DIRECT_ERROR_NONE on success \n
2032 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2033 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2034 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2035 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2036 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2037 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2038 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
2039 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2040 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
2041 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
2044 * \par Prospective Clients:
2049 * #include <wifi-direct.h>
2051 * void foo(unsigned char* mac_addr)
2055 * result = wifi_direct_accept_connection(mac_addr);
2057 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
2061 *\remarks This API will not try to send provisioning request.
2063 ******************************************************************************/
2064 int wifi_direct_accept_connection(char *mac_address);
2067 /*****************************************************************************************/
2068 /* wifi_direct_get_passphrase API function prototype
2069 * int wifi_direct_get_passphrase(char** passphrase)
2072 * \brief If a client create Group (Soft AP), this API shall get wpa password. \n
2073 * @param passphrase Pointer to store wpa password. Application must free this memory.
2076 * \par Sync (or) Async:
2077 * This is a Synchronous API.
2083 * \return Return Type (int) \n
2084 * - WIFI_DIRECT_ERROR_NONE on success \n
2085 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2086 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2087 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2088 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2089 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2090 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2091 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2093 * \par Prospective Clients:
2098 * #include <wifi-direct.h>
2105 * result=wifi_direct_get_passphrase(&wpa);
2107 * if(result == WIFI_DIRECT_ERROR_NONE)........//getting wpa passphrase is successful
2109 * free(wpa); // Application should free the memory
2115 ******************************************************************************/
2116 int wifi_direct_get_passphrase(char **passphrase);
2119 /*****************************************************************************************/
2120 /* wifi_direct_set_wpa_passphrase API function prototype
2121 * int wifi_direct_set_wpa_passphrase(char* passphrase)
2124 * \brief This API shall set or update wpa password. If a client create Group (Soft AP), this password will be used. \n
2125 * @param passphrase new wpa password to set. Application must set the new password before.
2128 * \par Sync (or) Async:
2129 * This is a Synchronous API.
2135 * \return Return Type (int) \n
2136 * - WIFI_DIRECT_ERROR_NONE on success \n
2137 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2138 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2139 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2140 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2141 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2142 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2143 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2145 * \par Prospective Clients:
2150 * #include <wifi-direct.h>
2155 * char new_wpa[64+1] = {0,};
2157 * printf("Input new WPA:\n");
2158 * scanf("%s",new_wpa);
2160 *if( strlen(new_wpa) > 0 )
2161 * result = wifi_direct_set_wpa_passphrase(new_wpa);
2163 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting password is successful
2169 ******************************************************************************/
2170 int wifi_direct_set_wpa_passphrase(char *passphrase);
2173 /*****************************************************************************************/
2174 /* wifi_direct_activate_pushbutton API function prototype
2175 * int wifi_direct_activate_pushbutton(void);
2178 * \brief This API shall start wps PBC.
2180 * \pre Device must support the pbc button mode.
2182 * \see wifi_direct_foreach_supported_wps_types
2184 * \par Sync (or) Async:
2185 * This is a Synchronous API.
2190 * \return Return Type (int) \n
2191 * - WIFI_DIRECT_ERROR_NONE on success \n
2192 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2193 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2194 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2195 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2196 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2197 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2199 * \par Prospective Clients:
2204 * #include <wifi-direct.h>
2211 * result = wifi_direct_activate_pushbutton();
2213 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activating push button is successful
2219 ******************************************************************************/
2220 int wifi_direct_activate_pushbutton(void);
2223 /*****************************************************************************************/
2224 /* wifi_direct_set_wps_pin API function prototype
2225 * int wifi_direct_set_wps_pin(char* pin)
2228 * \brief This API shall set or update the WPS PIN number user expects. \n
2229 * @param pin new pin to set. Application must set the new pin number before.
2231 * \see wifi_direct_generate_wps_pin.
2232 * \see wifi_direct_get_wps_pin
2234 * \par Sync (or) Async:
2235 * This is a Synchronous API.
2241 * \return Return Type (int) \n
2242 * - WIFI_DIRECT_ERROR_NONE on success \n
2243 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2244 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2245 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2246 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2247 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2248 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2249 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2252 * \par Prospective Clients:
2257 * #include <wifi-direct.h>
2262 * char pin[WIFI_DIRECT_WPS_PIN_LEN+1]= { 0, };
2264 * memset(pin, 0x00, sizeof(pin));
2265 * printf("Input 8 digit PIN number :\n");
2268 *if( strlen(pin) > 0 )
2269 * result = wifi_direct_set_wps_pin(pin);
2271 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting wps pin number is successful
2277 ******************************************************************************/
2278 int wifi_direct_set_wps_pin(char *pin);
2281 /*****************************************************************************************/
2282 /* wifi_direct_get_wps_pin API function prototype
2283 * int wifi_direct_get_wps_pin(char** pin)
2286 * \brief This API shall get the WPS PIN number. \n
2287 * @param pin Pointer to store pin number. Application must free this memory.
2289 * \see wifi_direct_set_wps_pin
2291 * \par Sync (or) Async:
2292 * This is a Synchronous API.
2298 * \return Return Type (int) \n
2299 * - WIFI_DIRECT_ERROR_NONE on success \n
2300 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2301 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2302 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2303 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2304 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2305 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2306 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2309 * \par Prospective Clients:
2314 * #include <wifi-direct.h>
2321 * result = wifi_direct_get_wps_pin(&pin);
2323 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting wps pin number is successful
2325 * free(pin); // Application should free the memory.
2331 ******************************************************************************/
2332 int wifi_direct_get_wps_pin(char **pin);
2335 /*****************************************************************************************/
2336 /* wifi_direct_generate_wps_pin API function prototype
2337 * wifi_direct_generate_wps_pin(void);
2340 * \brief This API shall generate the random WPS PIN number.\n
2341 * To get the generated PIN number, use wifi_direct_get_wps_pin() API.
2343 * \see wifi_direct_set_wps_pin
2344 * \see wifi_direct_get_wps_pin
2346 * \par Sync (or) Async:
2347 * This is a Synchronous API.
2353 * \return Return Type (int) \n
2354 * - WIFI_DIRECT_ERROR_NONE on success \n
2355 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2356 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2357 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2358 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2359 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2360 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2363 * \par Prospective Clients:
2368 * #include <wifi-direct.h>
2374 * result = wifi_direct_generate_wps_pin();
2376 * if(result == WIFI_DIRECT_ERROR_NONE)......... // generating wps pin number is successful
2382 ******************************************************************************/
2383 int wifi_direct_generate_wps_pin(void);
2386 /*****************************************************************************************/
2387 /* wifi_direct_get_supported_wps_mode API function prototype
2388 * int wifi_direct_get_supported_wps_mode(int *wps_mode);
2391 * \brief This API shall get the supported wps mode. \n
2392 * The result is bit flag.
2394 * @param wps_mode Memory to store supported wps mode. Application must allocate memory.
2396 * \see wifi_direct_wps_type_e
2398 * \par Sync (or) Async:
2399 * This is a Synchronous API.
2405 * \return Return Type (int) \n
2406 * - WIFI_DIRECT_ERROR_NONE on success \n
2407 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2408 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2409 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2410 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2411 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2412 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2413 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2416 * \par Prospective Clients:
2421 * #include <wifi-direct.h>
2426 * int supported_wps_mode = 0;
2428 * result = wifi_direct_get_supported_wps_mode(&supported_wps_mode);
2430 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting supported wps mode is successful
2436 ******************************************************************************/
2437 int wifi_direct_get_supported_wps_mode(int *wps_mode);
2441 * @brief Called when you get the supported WPS(Wi-Fi Protected Setup) type repeatedly.
2442 * @param[in] type The type of WPS
2443 * @param[in] user_data The user data passed from the request function
2444 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
2445 * @pre wifi_direct_foreach_supported_wps_types() will invoke this callback.
2446 * @see wifi_direct_foreach_supported_wps_types()
2448 typedef bool(*wifi_direct_supported_wps_type_cb)(wifi_direct_wps_type_e type, void *user_data);
2451 * @brief Gets the supported WPS(Wi-Fi Protected Setup) types.
2452 * @param[in] callback The callback function to invoke
2453 * @param[in] user_data The user data to be passed to the callback function
2454 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2455 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2456 * @see wifi_direct_supported_wps_type_cb()
2458 int wifi_direct_foreach_supported_wps_types(wifi_direct_supported_wps_type_cb callback, void *user_data);
2461 * @brief Gets the WPS(Wi-Fi Protected Setup) type.
2462 * @param[out] type The type of WPS
2463 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2464 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2465 * @see wifi_direct_foreach_supported_wps_types()
2467 int wifi_direct_get_local_wps_type(wifi_direct_wps_type_e *type);
2470 * @brief Sets the requested WPS(Wi-Fi Protected Setup) type.
2471 * @param[in] type The type of WPS
2472 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2473 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2474 * @see wifi_direct_foreach_supported_wps_types()
2476 int wifi_direct_set_req_wps_type(wifi_direct_wps_type_e type);
2479 * @brief Gets the requested WPS(Wi-Fi Protected Setup) type.
2480 * @param[out] type The type of WPS
2481 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2482 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2483 * @see wifi_direct_foreach_supported_wps_types()
2485 int wifi_direct_get_req_wps_type(wifi_direct_wps_type_e *type);
2488 * @brief Sets the intent of a group owner.
2489 * @remakrs The range of intent is 0 ~ 15.
2490 * @param[in] intent The intent of a group owner
2491 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2492 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2493 * @see wifi_direct_get_group_owner_intent()
2495 int wifi_direct_set_group_owner_intent(int intent);
2498 * @brief Gets the intent of a group owner.
2499 * @param[out] intent The intent of a group owner
2500 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2501 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2502 * @see wifi_direct_set_group_owner_intent()
2504 int wifi_direct_get_group_owner_intent(int *intent);
2507 * @brief Sets the max number of clients.
2508 * @param[in] max The max number of clients
2509 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2510 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2511 * @see wifi_direct_get_max_clients()
2513 int wifi_direct_set_max_clients(int max);
2516 * @brief Gets the max number of clients.
2517 * @param[in] max The max number of clients
2518 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2519 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2520 * @see wifi_direct_set_max_clients()
2522 int wifi_direct_get_max_clients(int *max);
2526 * @brief Gets the channel of own group. - DEPRECATED
2527 * @param[out] channel The channel of own group
2528 * @return 0 on success, otherwise a negative error value.
2529 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2530 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2531 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2532 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2533 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2534 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2535 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2536 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2537 * @see wifi_direct_initialize()
2539 int wifi_direct_get_own_group_channel(int *channel);
2543 * @brief Gets the operating channel.
2544 * @param[out] channel The operating channel
2545 * @return 0 on success, otherwise a negative error value.
2546 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2547 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2548 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2549 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2550 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2551 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2552 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2553 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2554 * @see wifi_direct_initialize()
2556 int wifi_direct_get_operating_channel(int *channel);
2559 * @brief Sets the Autoconnection mode.
2561 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2562 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2563 * @see wifi_direct_foreach_supported_wps_types()
2565 int wifi_direct_set_autoconnection_mode(bool mode);
2567 int wifi_direct_is_autoconnection_mode(bool *mode);
2570 * @brief Enables the persistent group.
2571 * @details If @a enabled is true, then P2P persisten group will be used when creating a group and establishing a connection.
2572 * @param[in] enabled The status of persistent group: (@c true = enabled, @c false = disabled)
2573 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2574 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2575 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2576 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2577 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2578 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2579 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2580 * @see wifi_direct_initialize()
2581 * @see wifi_direct_is_persistent_group_enabled()
2583 int wifi_direct_set_persistent_group_enabled(bool enabled);
2586 * @brief Checks whether the persistent group is enabled or disabled.
2587 * @param[out] enabled The status of persistent group: (@c true = enabled, @c false = disabled)
2588 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2589 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2590 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2591 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2592 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2593 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2594 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2595 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2596 * @see wifi_direct_initialize()
2597 * @see wifi_direct_set_persistent_group_enabled()
2599 int wifi_direct_is_persistent_group_enabled(bool *enabled);
2603 * @brief Called when you get the persistent groups repeatedly.
2604 * @param[in] mac_address The MAC address of persistent group owner
2605 * @param[in] ssid The SSID(Service Set Identifier) of persistent group owner
2606 * @param[in] user_data The user data passed from the request function
2607 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of theloop
2608 * @pre wifi_direct_foreach_persistent_groups() will invoke this callback.
2609 * @see wifi_direct_foreach_persistent_groups()
2611 typedef bool(*wifi_direct_persistent_group_cb)(const char *mac_address, const char *ssid, void *user_data);
2614 * @brief Gets the persistent groups.
2615 * @param[in] callback The callback function to invoke
2616 * @param[in] user_data The user data to be passed to the callback function
2617 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2618 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2619 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2620 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2621 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2622 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2623 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2624 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2625 * @post wifi_direct_persistent_group_cb() will be called.
2626 * @see wifi_direct_initialize()
2627 * @see wifi_direct_persistent_group_cb()
2629 int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb callback, void *user_data);
2632 * @brief Remove a persistent group.
2633 * @param[in] mac_address The MAC address of persistent group owner
2634 * @param[in] ssid The SSID(Service Set Identifier) of persistent group owner
2635 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2636 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2637 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2638 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2639 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2640 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2641 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2642 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2643 * @see wifi_direct_initialize()
2644 * @see wifi_direct_foreach_persistent_groups()
2646 int wifi_direct_remove_persistent_group(const char *mac_address, const char *ssid);
2657 #endif //__WIFI_DIRECT_INTERFACE_H_