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 int allowed; /** Is device allowed**/
240 char *device_name; /** Null-terminated device friendly name. */
241 char *mac_address; /** Device's P2P Device Address */
242 } wifi_direct_access_list_info_s;
246 * @struct wifi_direct_discovered_peer_info_s
247 * Wi-Fi Direct buffer structure to store result of peer discovery
251 char *device_name; /** Null-terminated device friendly name. */
252 char *mac_address; /** Device's P2P Device Address */
253 char *interface_address; /** Device's P2P Interface Address. Valid only if device is a P2P GO. */
254 int channel; /** Channel the device is listening on. */
255 bool is_connected; /** Is peer connected*/
256 bool is_group_owner; /** Is an active P2P Group Owner */
257 bool is_persistent_group_owner; /** Is a stored Persistent GO */
258 wifi_direct_primary_device_type_e primary_device_type; /** Primary category of device */
259 wifi_direct_secondary_device_type_e secondary_device_type; /** Sub category of device */
260 int supported_wps_types; /** The list of supported WPS type. \n
261 The OR operation on #wifi_direct_wps_type_e can be used like #WIFI_DIRECT_WPS_TYPE_PBC | #WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY */
262 char *ssid; /**< Service set identifier - DEPRECATED */
263 unsigned int service_count;
266 } wifi_direct_discovered_peer_info_s;
270 * @struct wifi_direct_connected_peer_info_s
271 * Wi-Fi Direct buffer structure to store information of connected peer
275 char* device_name; /** Device friendly name. */
276 char* ip_address; /**< The IP address */
277 char* mac_address; /** Device's P2P Device Address */
278 char* interface_address; /** Device's P2P Interface Address */
279 bool p2p_supported; /* whether peer is a P2P device */
280 wifi_direct_primary_device_type_e primary_device_type; /* primary category of device */
281 int channel; /* Operating channel */
282 char* ssid; /**< Service set identifier - DEPRECATED */
283 unsigned int service_count;
286 } wifi_direct_connected_peer_info_s;
289 * Notification callback function type. \n
291 * Discover notifications can occur at the peers or P2P groups are found.
293 * @param event Specifies the types of notifications.
294 * - WIFI_DIRECT_DISCOVERY_STARTED
295 * - WIFI_DIRECT_ONLY_LISTEN_STARTED
296 * - WIFI_DIRECT_DISCOVERY_FOUND
297 * - WIFI_DIRECT_DISCOVERY_FINISHED
298 * @param error_code In failure case.
299 * @param user_data User can transfer the user specific data in callback.
302 typedef void (*wifi_direct_discovery_state_chagned_cb) (int error_code,
303 wifi_direct_discovery_state_e discovery_state,
307 * Notification callback function type. \n
309 * Activation notifications callback function type.
311 * @param event Specifies the types of notifications.
312 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED
313 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED
314 * @param error_code In failure case.
315 * @param user_data User can transfer the user specific data in callback.
318 typedef void (*wifi_direct_device_state_changed_cb) (int error_code,
319 wifi_direct_device_state_e device_state,
323 * connection notification callback function type. \n
325 * @param event Specifies the types of notifications.
326 * - WIFI_DIRECT_CONNECTION_REQ
327 * - WIFI_DIRECT_CONNECTION_WPS_REQ
328 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS
329 * - WIFI_DIRECT_CONNECTION_RSP
330 * - WIFI_DIRECT_DISASSOCIATION_IND
331 * - WIFI_DIRECT_DISCONNECTION_RSP
332 * - WIFI_DIRECT_DISCONNECTION_IND
333 * - WIFI_DIRECT_GROUP_CREATED
334 * - WIFI_DIRECT_GROUP_DESTROYED
336 * @param error_code In failure case.
338 * @param param1 additional data for connection. ex) MAC
339 * @param param2 additional data for connection. ex) SSID
341 * @param user_data User can transfer the user specific data in callback.
344 typedef void (*wifi_direct_connection_state_changed_cb) (int error_code,
345 wifi_direct_connection_state_e connection_state,
346 const char *mac_address,
350 * @brief Called when IP address of client is assigned when your device is group owner.
351 * @param[in] mac_address The MAC address of connection peer
352 * @param[in] ip_address The IP address of connection peer
353 * @param[in] interface_address The interface address of connection peer
354 * @param[in] user_data The user data passed from the callback registration function
355 * @see wifi_direct_set_client_ip_address_assigned_cb()
356 * @see wifi_direct_unset_client_ip_address_assigned_cb()
358 typedef void (*wifi_direct_client_ip_address_assigned_cb) (const char *mac_address,
359 const char *ip_address,
360 const char *interface_address,
363 /*=============================================================================
364 Wifi Direct Client APIs
365 =============================================================================*/
367 /*****************************************************************************/
368 /* wifi_direct_initialize API function prototype
369 * int wifi_direct_initialize (void);
372 * \brief This API shall register the client application with the Wi-Fi Direct server and initialize the various variables. \n
376 * \post Application is registered.
378 * \see wifi_direct_device_state_changed_cb
379 * \see wifi_direct_discovery_state_chagned_cb
380 * \see wifi_direct_connection_state_changed_cb
382 * \par Sync (or) Async:
383 * This is a Synchronous API.
388 * \return Return Type (int) \n
390 * - WIFI_DIRECT_ERROR_NONE on success \n
391 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
392 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
393 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
394 * - WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for "Too many users" \n
395 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
396 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
398 * \par Prospective Clients:
404 * #include <wifi-direct.h>
411 * result = wifi_direct_initialize();
413 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully connected to the wifi direct server
416 ******************************************************************************/
417 int wifi_direct_initialize(void);
420 /*****************************************************************************************/
421 /* wifi_direct_deinitialize API function prototype
422 * int wifi_direct_deinitialize(void);
426 * \brief This API shall deregister the client application with the Wi-Fi Direct server and releases all resources.
428 * \pre Application must be already registered to the Wi-Fi Direct server.
430 * \post Application is de-registered.
432 * \see wifi_direct_initialize
434 * \par Sync (or) Async:
435 * This is a Synchronous API.
441 * \par Async Response Message:
445 * \return Return Type (int) \n
446 * - WIFI_DIRECT_ERROR_NONE on success \n
447 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
448 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
449 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
450 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
451 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
452 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
454 * \par Prospective Clients:
459 * #include <wifi-direct.h>
466 * result = wifi_direct_deinitialize();
468 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deregister is successful
474 ******************************************************************************/
475 int wifi_direct_deinitialize(void);
478 /*****************************************************************************/
479 /* wifi_direct_set_connection_state_changed_cb API function prototype
480 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_device_state_changed_cb cb, void* user_data)
483 * \brief This API shall register the activation callback function and user data from client. \n
485 * \pre The Client should be initialized.
487 * \see wifi_direct_initialize
488 * \see wifi_direct_device_state_changed_cb
490 * \par Sync (or) Async:
491 * This is a Synchronous API.
496 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
497 * \param[in] user_data user data
499 * \return Return Type (int) \n
501 * - WIFI_DIRECT_ERROR_NONE on success \n
502 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
504 * \par Prospective Clients:
510 * #include <wifi-direct.h>
517 * result = wifi_direct_set_connection_state_changed_cb(_cb_activation, void* user_data);
519 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
522 ******************************************************************************/
523 int wifi_direct_set_device_state_changed_cb(wifi_direct_device_state_changed_cb cb, void *user_data);
526 /*****************************************************************************/
527 /* wifi_direct_unset_connection_state_changed_cb API function prototype
528 * int wifi_direct_unset_connection_state_changed_cb(void)
531 * \brief This API shall deregister the activation callback function and user data from client. \n
533 * \pre The Client should be initialized.
535 * \see wifi_direct_initialize
536 * \see wifi_direct_set_connection_state_changed_cb
538 * \par Sync (or) Async:
539 * This is a Synchronous API.
544 * \return Return Type (int) \n
546 * - WIFI_DIRECT_ERROR_NONE on success \n
547 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
549 * \par Prospective Clients:
555 * #include <wifi-direct.h>
562 * result = wifi_direct_unset_connection_state_changed_cb();
564 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
567 ******************************************************************************/
568 int wifi_direct_unset_device_state_changed_cb(void);
572 /*****************************************************************************/
573 /* wifi_direct_set_discovery_state_changed_cb API function prototype
574 * int wifi_direct_set_discover_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void* user_data)
577 * \brief This API shall register the discover callback function and user data from client. \n
579 * \pre The Client should be initialized.
581 * \see wifi_direct_initialize
582 * \see wifi_direct_discovery_state_chagned_cb
584 * \par Sync (or) Async:
585 * This is a Synchronous API.
590 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
591 * \param[in] user_data user data
593 * \return Return Type (int) \n
595 * - WIFI_DIRECT_ERROR_NONE on success \n
596 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
598 * \par Prospective Clients:
604 * #include <wifi-direct.h>
611 * result = wifi_direct_set_discovery_state_changed_cb(_cb_discover, void* user_data);
613 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
616 ******************************************************************************/
617 int wifi_direct_set_discovery_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void *user_data);
620 /*****************************************************************************/
621 /* wifi_direct_unset_discovery_state_changed_cb API function prototype
622 * int wifi_direct_unset_discovery_state_changed_cb(void)
625 * \brief This API shall deregister the discover callback function and user data from client. \n
627 * \pre The Client should be initialized.
629 * \see wifi_direct_initialize
630 * \see wifi_direct_set_discovery_state_changed_cb
632 * \par Sync (or) Async:
633 * This is a Synchronous API.
638 * \return Return Type (int) \n
640 * - WIFI_DIRECT_ERROR_NONE on success \n
641 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
643 * \par Prospective Clients:
649 * #include <wifi-direct.h>
656 * result = wifi_direct_unset_discovery_state_changed_cb();
658 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
661 ******************************************************************************/
662 int wifi_direct_unset_discovery_state_changed_cb(void);
666 /*****************************************************************************/
667 /* wifi_direct_set_connection_state_changed_cb API function prototype
668 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void* user_data)
671 * \brief This API shall register the connection callback function and user data from client. \n
673 * \pre The Client should be initialized.
675 * \see wifi_direct_initialize
676 * \see wifi_direct_connection_state_changed_cb
678 * \par Sync (or) Async:
679 * This is a Synchronous API.
684 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
685 * \param[in] user_data user data
687 * \return Return Type (int) \n
689 * - WIFI_DIRECT_ERROR_NONE on success \n
690 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
692 * \par Prospective Clients:
698 * #include <wifi-direct.h>
705 * result = wifi_direct_set_connection_state_changed_cb(_cb_connection, void* user_data);
707 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
710 ******************************************************************************/
711 int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void *user_data);
714 /*****************************************************************************/
715 /* wifi_direct_unset_connection_state_changed_cb API function prototype
716 * int wifi_direct_unset_connection_state_changed_cb(void)
719 * \brief This API shall deregister the connection callback function and user data from client. \n
721 * \pre The Client should be initialized.
723 * \see wifi_direct_initialize
724 * \see wifi_direct_set_connection_state_changed_cb
726 * \par Sync (or) Async:
727 * This is a Synchronous API.
732 * \return Return Type (int) \n
734 * - WIFI_DIRECT_ERROR_NONE on success \n
735 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
737 * \par Prospective Clients:
743 * #include <wifi-direct.h>
750 * result = wifi_direct_unset_connection_state_changed_cb();
752 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
755 ******************************************************************************/
756 int wifi_direct_unset_connection_state_changed_cb(void);
760 * @brief Registers the callback called when IP address of client is assigned when your device is group owner.
761 * @param[in] cb The callback function to invoke
762 * @param[in] user_data The user data to be passed to the callback function
763 * @return 0 on success, otherwise a negative error value.
764 * @retval #WIFI_DIRECT_ERROR_NONE Successful
765 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
766 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
767 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
768 * @see wifi_direct_initialize()
769 * @see wifi_direct_unset_client_ip_address_assigned_cb()
770 * @see wifi_direct_client_ip_address_assigned_cb()
772 int wifi_direct_set_client_ip_address_assigned_cb(wifi_direct_client_ip_address_assigned_cb cb, void *user_data);
776 * @brief Unregisters the callback called when IP address of client is assigned when your device is group owner.
777 * @return 0 on success, otherwise a negative error value.
778 * @retval #WIFI_DIRECT_ERROR_NONE Successful
779 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
780 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
781 * @see wifi_direct_initialize()
782 * @see wifi_direct_set_connection_state_changed_cb()
784 int wifi_direct_unset_client_ip_address_assigned_cb(void);
787 /*****************************************************************************************/
788 /* wifi_direct_activate API function prototype
789 * int wifi_direct_activate(void);
793 * \brief This API shall open a wireless adapter device for P2P use.
795 * \pre Application must be already registered to the Wi-Fi Direct server.
797 * \post wireless adapter device will be ready to use.
799 * \see wifi_direct_initialize
801 * \par Sync (or) Async:
802 * This is a Asynchronous API.
808 * \par Async Response Message:
809 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when activation process is completed. \n
812 * \return Return Type (int*) \n
813 * - WIFI_DIRECT_ERROR_NONE on success \n
814 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
815 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
816 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
817 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
818 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
819 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
820 * - WIFI_DIRECT_ERROR_WIFI_USED for "WiFi is being used" \n
821 * - WIFI_DIRECT_ERROR_MOBILE_AP_USED for "Mobile AP is being used" \n
824 * \par Prospective Clients:
829 * #include <wifi-direct.h>
836 * result = wifi_direct_activate();
838 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activation is successful
844 ******************************************************************************/
845 int wifi_direct_activate(void);
848 /*****************************************************************************************/
849 /* wifi_direct_deactivate API function prototype
850 * int wifi_direct_deactivate(void);
854 * \brief This API shall close a wireless adapter device for P2P use
856 * \pre Wireless adapter device must be already opened.
858 * \post wireless adapter device will be closed.
860 * \see wifi_direct_activate
862 * \par Sync (or) Async:
863 * This is a Asynchronous API.
869 * \par Async Response Message:
870 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when deactivation process is completed. \n
872 * \return Return Type (int) \n
873 * - WIFI_DIRECT_ERROR_NONE on success \n
874 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
875 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
876 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
877 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
878 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
879 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
882 * \par Prospective Clients:
887 * #include <wifi-direct.h>
893 * result = wifi_direct_deactivate();
895 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deactivation is successful
901 ******************************************************************************/
902 int wifi_direct_deactivate(void);
905 /*****************************************************************************************/
906 /* wifi_direct_start_discovery API function prototype
907 * int wifi_direct_start_discovery(bool listen_only, int timeout);
910 * \brief This API shall Start a discovery to find all P2P capable devices. \n
911 * Applications will be notified event via wifi_direct_discovery_state_chagned_cb(). \n
913 * @param listen_only if true, skip the initial 802.11 scan and then enter
914 * Listen state instead of cycling between Search and Listen.
915 * @param timeout Specifies the duration of discovery period, in seconds.
916 * APs. If 0, a default value will be used, which depends on UX guideline.
918 * \pre Wireless adapter device must be already opened.
921 * \see wifi_direct_get_discovery_result
923 * \par Sync (or) Async:
924 * This is a Asynchronous API.
930 * \par Async Response Message:
931 * - WIFI_DIRECT_DISCOVERY_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (80211 Scan) started. \n
932 * - WIFI_DIRECT_ONLY_LISTEN_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (listen only mode) started. \n
933 * - WIFI_DIRECT_DISCOVERY_FOUND : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when peer or group is found. \n
934 * - WIFI_DIRECT_DISCOVERY_FINISHED : Once the whole discovery process is completed, applications will receive it via wifi_direct_discovery_state_chagned_cb (). \n
935 * Applications may then call wifi_direct_foreach_discovered_peers() to get the final result. \n
936 * With the intermediate or final list of P2P capable devices, applications can update their UI if needed. \n
937 * It is up to the applications to control how often to update their UI display. \n
940 * \return Return Type (int) \n
941 * - WIFI_DIRECT_ERROR_NONE on success \n
942 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
943 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
944 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
945 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
946 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
947 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
948 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
951 * \par Prospective Clients:
956 * #include <wifi-direct.h>
963 * result = wifi_direct_start_discovery(TRUE, 0);
965 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery request is successful
969 *\remarks If discover is over, peer can not find the device and the device can not find peer, too.
971 ******************************************************************************/
972 int wifi_direct_start_discovery(bool listen_only, int timeout);
975 /*****************************************************************************************/
976 /* wifi_direct_cancel_discovery API function prototype
977 * int wifi_direct_cancel_discovery(void);
980 * \brief This API shall cancel the discovery process started from wifi_direct_start_discovery. \n
982 * \pre discovery process must be started.
984 * \post discovery process stopped.
986 * \see wifi_direct_client_start_discovery
988 * \par Sync (or) Async:
989 * This is a Asynchronous API.
995 * \par Async Response Message:
996 * - WIFI_DIRECT_DISCOVERY_FINISHED : Applications will receive a this event
997 * via callback when the discovery process is cancelled or completed.
1000 * \return Return Type (int) \n
1001 * - WIFI_DIRECT_ERROR_NONE on success \n
1002 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1003 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1004 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1005 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1006 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1007 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1009 * \par Prospective Clients:
1014 * #include <wifi-direct.h>
1021 * result = wifi_direct_cancel_discovery();
1023 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery cancel request is successful
1029 ******************************************************************************/
1030 int wifi_direct_cancel_discovery(void);
1034 * access list notification callback function type. \n
1036 * @param device The device that is in access list.
1037 * @param user_data The user data passed from the foreach function.
1038 * @return @c true to continue with the next iteration of the loop,
1039 * \n @c false to break out of the loop.
1041 * @pre wifi_direct_get_access_list() will invoke this function.
1043 * @see wifi_direct_get_access_list()
1046 typedef bool(*wifi_direct_access_list_cb) (wifi_direct_access_list_info_s *device, void *user_data);
1048 /*****************************************************************************************/
1049 /* wifi_direct_get_access_list API function prototype
1050 * int wifi_direct_get_access_list(wifi_direct_discovered_peer_cb, void* user_data)
1053 * \brief This API shall get the information of all devices in access list. \n
1055 * @param callback The callback function to invoke.
1056 * @param user_data The user data passed from the foreach function.
1058 * \see wifi_direct_discovered_peer_cb
1060 * \par Sync (or) Async:
1061 * This is a Synchronous API.
1066 * \return Return Type (int) \n
1067 * - WIFI_DIRECT_ERROR_NONE on success \n
1068 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1069 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1070 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1071 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1072 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1073 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1074 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1077 * \par Prospective Clients:
1082 * #include <wifi-direct.h>
1084 * bool _cb_access_list_impl(wifi_direct_access_list_info_s* device, void* user_data)
1086 * struct appdata* ad = (struct appdata*) user_data;
1088 * if(NULL != device)
1090 * memcpy(&ad->access_list[ad->access_list_count], device, sizeof(wifi_direct_access_list_info_s));
1091 ad->access_list_count++;
1094 * return true; // continue with the next iteration of the loop
1102 * ad->access_list = NULL;
1103 * ad->access_list_count = 0;
1104 * result = wifi_direct_get_access_list(_cb_access_list_impl, (void*)ad);
1106 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get access list is successful
1112 ******************************************************************************/
1113 int wifi_direct_get_access_list(wifi_direct_access_list_cb callback,
1118 * discorverd peers notification callback function type. \n
1120 * @param peer The discovered peer information.
1121 * @param user_data The user data passed from the foreach function.
1122 * @return @c true to continue with the next iteration of the loop,
1123 * \n @c false to break out of the loop.
1125 * @pre wifi_direct_foreach_discovered_peers() will invoke this function.
1127 * @see wifi_direct_foreach_discovered_peers()
1130 typedef bool(*wifi_direct_discovered_peer_cb) (wifi_direct_discovered_peer_info_s *peer, void *user_data);
1133 /*****************************************************************************************/
1134 /* wifi_direct_foreach_discovered_peers API function prototype
1135 * int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb, void* user_data)
1138 * \brief This API shall get the information of all discovered peers. \n
1140 * @param callback The callback function to invoke.
1141 * @param user_data The user data passed from the foreach function.
1143 * \see wifi_direct_discovered_peer_cb
1145 * \par Sync (or) Async:
1146 * This is a Synchronous API.
1151 * \return Return Type (int) \n
1152 * - WIFI_DIRECT_ERROR_NONE on success \n
1153 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1154 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1155 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1156 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1157 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1158 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1159 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1162 * \par Prospective Clients:
1167 * #include <wifi-direct.h>
1169 * bool _cb_discovered_peers_impl(wifi_direct_discovered_peer_info_s* peer, void* user_data)
1171 * struct appdata* ad = (struct appdata*) user_data;
1175 * if ( ad->peer_count >= MAX_PEER_NUM )
1176 * return false; // break out of the loop
1178 * memcpy(&ad->peer_list[ad->peer_count], peer, sizeof(wifi_direct_discovered_peer_info_s));
1182 * return true; // continue with the next iteration of the loop
1190 * ad->peer_list = NULL;
1191 * ad->peer_count = 0;
1192 * ad ->selected_peer_index = 0;
1193 * result = wifi_direct_foreach_discovered_peers(_cb_discovered_peers_impl, (void*)ad);
1195 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1201 ******************************************************************************/
1202 int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb callback,
1206 /*****************************************************************************************/
1207 /* wifi_direct_connect API function prototype
1208 * int wifi_direct_connect(const char* mac_address);
1211 * \brief This API shall connect to specified peer by automatically determining whether to perform group \n
1212 * formation, join an existing group, invite, re-invoke a group. The decision is \n
1213 * based on the current state of the peers (i.e. GO, STA, not connected) and the \n
1214 * availability of persistent data. \n
1216 * @param mac_addr Device address of target peer.
1218 * \par Sync (or) Async:
1219 * This is a Asynchronous API.
1225 * \par Async Response Message:
1226 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
1227 * via callback when the connection process is started.
1228 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
1229 * via callback when the connection process is completed or failed.
1231 * \return Return Type (int) \n
1232 * - WIFI_DIRECT_ERROR_NONE on success \n
1233 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1234 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1235 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1236 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1237 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1238 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1239 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
1240 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1241 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1242 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1245 * \par Prospective Clients:
1250 * #include <wifi-direct.h>
1252 * void foo(unsigned char* mac_addr)
1257 * result = wifi_direct_connect(mac_addr);
1259 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
1263 *\remarks This API will try to send provisioning request befre connecting.
1265 ******************************************************************************/
1266 int wifi_direct_connect(const char *mac_address);
1269 * @brief Cancel the connection now in progress .
1270 * @param[in] mac_address The MAC address of rejected device.
1271 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1272 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1273 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1274 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1275 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1276 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1278 int wifi_direct_cancel_connection(const char *mac_address);
1281 * @brief Reject the connection request from other device now in progress.
1282 * @param[in] mac_address The MAC address of rejected device.
1283 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1284 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1285 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1286 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1287 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1288 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1290 int wifi_direct_reject_connection(const char *mac_address);
1292 /*****************************************************************************************/
1293 /* wifi_direct_disconnect_all API function prototype
1294 * int wifi_direct_disconnect_all(void);
1297 * \brief This API shall tear down all connected links to peers (stop soft AP, and close interface). \n
1299 * \see wifi_direct_connect
1301 * \par Sync (or) Async:
1302 * This is a Asynchronous API.
1308 * \par Async Response Message:
1309 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive this event
1310 * via callback when the disconnection process is completed.
1313 * \return Return Type (int) \n
1314 * - WIFI_DIRECT_ERROR_NONE on success \n
1315 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1316 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1317 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1318 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1319 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1320 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1323 * \par Prospective Clients:
1328 * #include <wifi-direct.h>
1335 * result = wifi_direct_disconnect_all();
1337 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1343 ******************************************************************************/
1344 int wifi_direct_disconnect_all(void);
1348 /*****************************************************************************************/
1349 /* wifi_direct_disconnect API function prototype
1350 * int wifi_direct_disconnect(const char* mac_address);
1353 * \brief This API shall disconnect the specified peer by mac address.
1355 * @param mac_addr Device address of target peer.
1359 * \par Sync (or) Async:
1360 * This is a Asynchronous API.
1366 * \par Async Response Message:
1367 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive a this event
1368 * via callback when a peer is disconnected.
1370 * \return Return Type (int) \n
1371 * - WIFI_DIRECT_ERROR_NONE on success \n
1372 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1373 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1374 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1375 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1376 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1377 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1378 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1381 * \par Prospective Clients:
1386 * #include <wifi-direct.h>
1388 * void foo(unsigned char* mac_addr)
1393 * result = wifi_direct_disconnect(mac_addr);
1395 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1401 ******************************************************************************/
1402 int wifi_direct_disconnect(const char *mac_address);
1407 * connected peers notification callback function type. \n
1409 * @param peer The connected peer information.
1410 * @param user_data The user data passed from the foreach function.
1411 * @return @c true to continue with the next iteration of the loop,
1412 * \n @c false to break out of the loop.
1414 * @pre wifi_direct_foreach_connected_peers() will invoke this function.
1416 * @see wifi_direct_foreach_connected_peers()
1419 typedef bool(*wifi_direct_connected_peer_cb) (wifi_direct_connected_peer_info_s *peer,
1423 /*****************************************************************************************/
1424 /* wifi_direct_foreach_connected_peers API function prototype
1425 * int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb, void* user_data)
1428 * \brief This API shall get the information of all connected peers. \n
1430 * @param callback The callback function to invoke.
1431 * @param user_data The user data passed from the foreach function.
1433 * \see wifi_direct_connected_peer_cb
1435 * \par Sync (or) Async:
1436 * This is a Synchronous API.
1441 * \return Return Type (int) \n
1442 * - WIFI_DIRECT_ERROR_NONE on success \n
1443 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1444 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1445 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1446 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1447 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1448 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1449 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1451 * \par Prospective Clients:
1456 * #include <wifi-direct.h>
1458 * bool _cb_connected_peers_impl(wifi_direct_connected_peer_info_s* peer, void* user_data)
1461 * struct appdata* ad = (struct appdata*) user_data;
1465 * if ( ad->connected_peer_count >= MAX_PEER_NUM )
1466 * return false; // break out of the loop
1468 * memcpy(&ad->connected_peer_list[ad->connected_peer_count], peer, sizeof(wifi_direct_connected_peer_info_s));
1469 * ad->connected_peer_count++;
1473 * return true; // continue with the next iteration of the loop
1480 * ad->connected_peer_list = NULL;
1481 * ad->connected_peer_count = 0;
1483 * result = wifi_direct_foreach_connected_peers(_cb_connected_peers_impl, (void*)ad);
1485 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1491 ******************************************************************************/
1492 int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb
1493 callback, void *user_data);
1497 /*****************************************************************************************/
1498 /* wifi_direct_create_group API function prototype
1499 * int wifi_direct_create_group();
1502 * \brief This API shall set up device as a Group Owner and wait for clients to connect. \n
1503 * Create a soft AP, start the WPS registrar, start the DHCP server. \n
1505 * \see wifi_direct_destroy_group
1507 * \par Sync (or) Async:
1508 * This is a Asynchronous API.
1514 * \par Async Response Message:
1515 * - WIFI_DIRECT_GROUP_CREATED : Applications will receive this event
1516 * via callback when the group creating request is successful. \n
1517 * Errorcode will be set to the WFD_ERROR_CREATE_LINK_FAIL value. \n
1519 * \return Return Type (int) \n
1520 * - WIFI_DIRECT_ERROR_NONE on success \n
1521 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1522 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1523 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1524 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1525 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1526 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1527 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1528 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1531 * \par Prospective Clients:
1536 * #include <wifi-direct.h>
1543 * result = wifi_direct_create_group();
1545 * if(result == WIFI_DIRECT_ERROR_NONE)......... // create group request is successful
1551 ******************************************************************************/
1552 int wifi_direct_create_group(void);
1556 /*****************************************************************************************/
1557 /* wifi_direct_destroy_group API function prototype
1558 * int wifi_direct_destroy_group();
1561 * \brief This API shall cancel P2P Group create or tear down a P2P Group that we own. \n
1563 * \see wifi_direct_create_group
1565 * \par Sync (or) Async:
1566 * This is a Asynchronous API.
1572 * \par Async Response Message:
1573 * - WIFI_DIRECT_GROUP_DESTROYED : Applications will receive this event via callback when the group is cancelled. \n
1575 * \return Return Type (int) \n
1576 * - WIFI_DIRECT_ERROR_NONE on success \n
1577 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1578 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1579 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1580 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1581 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1582 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1583 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1584 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1587 * \par Prospective Clients:
1592 * #include <wifi-direct.h>
1599 * result = wifi_direct_destroy_group();
1601 * if(result == WIFI_DIRECT_ERROR_NONE)......... // cancel group request is successful
1607 ******************************************************************************/
1608 int wifi_direct_destroy_group(void);
1611 /*****************************************************************************************/
1612 /* wifi_direct_is_group_owner API function prototype
1613 * int wifi_direct_is_group_owner(bool *owner);
1616 * \brief This API shall check whether the currunt client is group owner or not.
1617 * @param owner Memory to store the value of TURE or FALSE. Application must allocate memory.
1619 * \see wifi_direct_create_group
1621 * \par Sync (or) Async:
1622 * This is a Synchronous API.
1627 * \return Return Type (int) \n
1628 * - WIFI_DIRECT_ERROR_NONE on success \n
1629 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1630 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1631 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1632 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1633 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1634 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1635 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1637 * \par Prospective Clients:
1642 * #include <wifi-direct.h>
1650 * result = wifi_direct_is_group_owner(&owner);
1653 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1659 ******************************************************************************/
1660 int wifi_direct_is_group_owner(bool *is_group_owner);
1664 /*****************************************************************************************/
1665 /* wifi_direct_is_autonomous_group API function prototype
1666 * int wifi_direct_is_autonomous_group(bool *autonomous_group);
1669 * \brief This API shall check whether the currunt group is autonomous group or not.
1670 * @param autonomous_group Memory to store the value of TURE or FALSE. Application must allocate memory.
1672 * \see wifi_direct_create_group
1674 * \par Sync (or) Async:
1675 * This is a Synchronous API.
1680 * \return Return Type (int) \n
1681 * - WIFI_DIRECT_ERROR_NONE on success \n
1682 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1683 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1684 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1685 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1686 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1687 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1688 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1690 * \par Prospective Clients:
1695 * #include <wifi-direct.h>
1701 * bool autonomous_group;
1703 * result = wifi_direct_is_autonomous_group(&autonomous_group);
1706 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1712 ******************************************************************************/
1713 int wifi_direct_is_autonomous_group(bool *is_autonomous_group);
1718 /*****************************************************************************************/
1719 /* wifi_direct_set_ssid API function prototype
1720 * int wifi_direct_set_ssid(const char* ssid);
1723 * \brief This API shall set or update ssid of local device. \n
1724 * @param ssid new ssid to set. Application must set the new ssid before.
1726 * \see wifi_direct_get_ssid
1728 * \par Sync (or) Async:
1729 * This is a Synchronous API.
1735 * \return Return Type (int) \n
1736 * - WIFI_DIRECT_ERROR_NONE on success \n
1737 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1738 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1739 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1740 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1741 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1742 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1743 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1746 * \par Prospective Clients:
1751 * #include <wifi-direct.h>
1756 * char ssid[11] = {0,};
1758 * memset(pin, 0x00, sizeof(pin));
1759 * printf("Input 8 digit PIN number :\n");
1762 *if( strlen(ssid) > 0 )
1763 * result = wifi_direct_set_ssid(ssid);
1765 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting ssid is successful
1769 *\remarks When the wifi direct is re-activated, ssid will be reset to the device name. \n
1772 ******************************************************************************/
1773 int wifi_direct_set_ssid(const char *ssid);
1777 * @brief Sets the friendly name of local device.
1778 * @details This device name is shown to other devices during device discovery.
1779 * @remarks The name set by you is only valid during activated state.
1780 * After Wi-Fi Direct is deactivated, this name will be as the phone name.
1781 * @param[in] device_name The name to local device
1782 * @return 0 on success, otherwise a negative error value.
1783 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1784 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1785 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1786 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1787 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitteds
1788 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1789 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1790 * @pre Wi-Fi Direct must be activated by wifi_direct_activate().
1791 * @see wifi_direct_activate()
1792 * @see wifi_direct_get_device_name()
1794 int wifi_direct_set_device_name(const char *device_name);
1797 * @brief Gets the name of local device.
1798 * @remarks @a device_name must be released with free() by you.
1799 * @param[out] device_name The name to local device
1800 * @return 0 on success, otherwise a negative error value.
1801 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1802 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1803 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1804 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1805 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1806 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1807 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
1808 * @see wifi_direct_initialize()
1809 * @see wifi_direct_set_device_name()
1811 int wifi_direct_get_device_name(char **device_name);
1813 /*****************************************************************************************/
1814 /* wifi_direct_get_ssid API function prototype
1815 * int wifi_direct_get_ssid(char** ssid)
1818 * \brief This API shall get ssid of local device. \n
1819 * @param ssid Pointer to store ssid. Application must free this memory.
1821 * \par Sync (or) Async:
1822 * This is a Synchronous API.
1828 * \return Return Type (int) \n
1829 * - WIFI_DIRECT_ERROR_NONE on success \n
1830 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1831 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1832 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1833 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1834 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1835 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1836 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1839 * \par Prospective Clients:
1844 * #include <wifi-direct.h>
1849 * char* ssid = NULL;
1851 * result = wifi_direct_get_ssid(&ssid);
1853 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting ssid is successful
1855 * free(ssid); // Application should free the memory.
1862 ******************************************************************************/
1863 int wifi_direct_get_ssid(char **ssid);
1867 * @brief Gets the name of network interface. For example, eth0 and pdp0.
1868 * @remarks @a name must be released with free() by you.
1869 * @param[out] name The name of network interface
1870 * @return 0 on success, otherwise negative error value.
1871 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1872 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1873 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1874 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1875 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1876 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1877 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1878 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1879 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1880 * @see wifi_direct_activate()
1882 int wifi_direct_get_network_interface_name(char **name);
1885 /*****************************************************************************************/
1886 /* wifi_direct_get_ip_address API function prototype
1887 * int wifi_direct_get_ip_address(char** ip_address)
1890 * \brief This API shall get IP address of local device interface. \n
1891 * @param ip_addr Pointer to store ip address. Application must free this memory.
1893 * \par Sync (or) Async:
1894 * This is a Synchronous API.
1900 * \return Return Type (int) \n
1901 * - WIFI_DIRECT_ERROR_NONE on success \n
1902 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1903 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1904 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1905 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1906 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1907 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1908 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1911 * \par Prospective Clients:
1916 * #include <wifi-direct.h>
1923 * result = wifi_direct_get_ip_address(&ip);
1925 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting IP is successful
1927 * free(ip); // Application should free the memory.
1933 ******************************************************************************/
1934 int wifi_direct_get_ip_address(char **ip_address);
1937 * @brief Gets the Subnet Mask.
1938 * @remarks @a subnet_mask must be released with free() by you.
1939 * @param[out] subnet_mask The subnet mask
1940 * @return 0 on success, otherwise negative error value.
1941 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1942 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1943 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1944 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1945 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1946 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1947 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1948 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1949 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1950 * @see wifi_direct_activate()
1952 int wifi_direct_get_subnet_mask(char **subnet_mask);
1956 * @brief Gets the Gateway address.
1957 * @remarks @a gateway_address must be released with free() by you.
1958 * @param[out] gateway_address The gateway address
1959 * @return 0 on success, otherwise negative error value.
1960 * @retval #WIFI_DIRECT_ERROR_NONE Successful
1961 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
1962 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
1963 * @retval #WIFI_DIRECT_ERROR_OUT_OF_MEMORY Out of memory
1964 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
1965 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
1966 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
1967 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
1968 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
1969 * @see wifi_direct_activate()
1971 int wifi_direct_get_gateway_address(char **gateway_address);
1975 /*****************************************************************************************/
1976 /* wifi_direct_get_mac_addr API function prototype
1977 * int wifi_direct_get_mac_address(char **mac_address)
1980 * \brief This API shall get device MAC address of local device.\n
1981 * @param mac_addr Pointer to store MAC address. Application must free this memory.
1983 * \par Sync (or) Async:
1984 * This is a Synchronous API.
1990 * \return Return Type (int) \n
1991 * - WIFI_DIRECT_ERROR_NONE on success \n
1992 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1993 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1994 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1995 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1996 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1997 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1998 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2001 * \par Prospective Clients:
2006 * #include <wifi-direct.h>
2011 * char* mac_addr =NULL;
2013 * result = wifi_direct_get_mac_addr(&mac_addr);
2015 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting device MAC is successful
2021 ******************************************************************************/
2022 int wifi_direct_get_mac_address(char **mac_address);
2025 /*****************************************************************************************/
2026 /* wifi_direct_get_state API function prototype
2027 * int wifi_direct_get_state(wifi_direct_state_e * status);
2030 * \brief This API shall get current Wi-Fi direct link status. \n
2031 * @param status Memory to store link status information. Application must allocate memory.
2033 * \see wifi_direct_state_e
2035 * \par Sync (or) Async:
2036 * This is a Synchronous API.
2042 * \return Return Type (int) \n
2043 * - WIFI_DIRECT_ERROR_NONE on success \n
2044 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2045 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2046 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2047 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2048 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2049 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2050 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2053 * \par Prospective Clients:
2058 * #include <wifi-direct.h>
2063 * wifi_direct_state_e status;
2065 * result = wifi_direct_get_state(&status);
2067 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting link status is successful
2073 ******************************************************************************/
2074 int wifi_direct_get_state(wifi_direct_state_e *state);
2079 * @brief Checks whether this device is discoverable or not by P2P discovery.
2080 * @details If you call wifi_direct_start_discovery(), then your device can be discoverable.
2081 * @param[out] discoverable The status of discoverable: (@c true = discoverable, @c false = non-discoverable)
2082 * @return 0 on success, otherwise a negative error value.
2083 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2084 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2085 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2086 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2087 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2088 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2089 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2090 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2091 * @see wifi_direct_initialize()
2092 * @see wifi_direct_start_discovery()
2093 * @see wifi_direct_cancel_discovery()
2095 int wifi_direct_is_discoverable(bool *discoverable);
2098 * @brief Checks whether the local device is listening only.
2099 * @details If you call wifi_direct_start_discovery() with @a listen_only as @c true,
2100 * then skip the initial 802.11 Scan and then enter Listen state instead of cycling between Scan andListen.
2101 * @param[out] listen_only The status of listen only: (@c true = listen only, @c false = cycling between Scan and Listen or not in discovery state)
2102 * @return 0 on success, otherwise a negative error value.
2103 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2104 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2105 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2106 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2107 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2108 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2109 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2110 * @pre Wi-Fi Direct service must be activated by wifi_direct_activate().
2111 * @see wifi_direct_start_discovery()
2112 * @see wifi_direct_cancel_discovery()
2113 * @see wifi_direct_is_discoverable()
2115 int wifi_direct_is_listening_only(bool *listen_only);
2118 * @brief Gets the primary device type of local device.
2119 * @param[out] type The primary device type
2120 * @return 0 on success, otherwise a negative error value.
2121 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2122 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2123 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2124 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2125 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2126 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2127 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2128 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2129 * @see wifi_direct_initialize()
2131 int wifi_direct_get_primary_device_type(wifi_direct_primary_device_type_e *type);
2134 * @brief Gets the secondary device type of local device.
2135 * @param[out] type The secondary device type
2136 * @return 0 on success, otherwise a negative error value.
2137 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2138 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2139 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2140 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2141 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2142 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2143 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2144 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2145 * @see wifi_direct_initialize()
2147 int wifi_direct_get_secondary_device_type(wifi_direct_secondary_device_type_e *type);
2150 /*****************************************************************************************/
2151 /* wifi_direct_accept_connection API function prototype
2152 * int wifi_direct_accept_connection(char* mac_address);
2155 * \brief This API shall accept connection request from specified peer. \n
2156 * This API shall be used to respond the connection request event, WIFI_DIRECT_CONNECTION_REQ.
2158 * @param mac_addr Device address of target peer.
2160 * \see wifi_direct_connect
2162 * \par Sync (or) Async:
2163 * This is a Asynchronous API.
2168 * \par Async Response Message:
2169 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
2170 * via callback when the connection process is started.
2171 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
2172 * via callback when the connection process is completed or failed.
2174 * \return Return Type (int) \n
2175 * - WIFI_DIRECT_ERROR_NONE on success \n
2176 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2177 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2178 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2179 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2180 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2181 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2182 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
2183 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2184 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
2185 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
2188 * \par Prospective Clients:
2193 * #include <wifi-direct.h>
2195 * void foo(unsigned char* mac_addr)
2199 * result = wifi_direct_accept_connection(mac_addr);
2201 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
2205 *\remarks This API will not try to send provisioning request.
2207 ******************************************************************************/
2208 int wifi_direct_accept_connection(char *mac_address);
2211 /*****************************************************************************************/
2212 /* wifi_direct_get_passphrase API function prototype
2213 * int wifi_direct_get_passphrase(char** passphrase)
2216 * \brief If a client create Group (Soft AP), this API shall get wpa password. \n
2217 * @param passphrase Pointer to store wpa password. Application must free this memory.
2220 * \par Sync (or) Async:
2221 * This is a Synchronous API.
2227 * \return Return Type (int) \n
2228 * - WIFI_DIRECT_ERROR_NONE on success \n
2229 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2230 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2231 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2232 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2233 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2234 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2235 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2237 * \par Prospective Clients:
2242 * #include <wifi-direct.h>
2249 * result=wifi_direct_get_passphrase(&wpa);
2251 * if(result == WIFI_DIRECT_ERROR_NONE)........//getting wpa passphrase is successful
2253 * free(wpa); // Application should free the memory
2259 ******************************************************************************/
2260 int wifi_direct_get_passphrase(char **passphrase);
2263 /*****************************************************************************************/
2264 /* wifi_direct_set_wpa_passphrase API function prototype
2265 * int wifi_direct_set_wpa_passphrase(char* passphrase)
2268 * \brief This API shall set or update wpa password. If a client create Group (Soft AP), this password will be used. \n
2269 * @param passphrase new wpa password to set. Application must set the new password before.
2272 * \par Sync (or) Async:
2273 * This is a Synchronous API.
2279 * \return Return Type (int) \n
2280 * - WIFI_DIRECT_ERROR_NONE on success \n
2281 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2282 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2283 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2284 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2285 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2286 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2287 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2289 * \par Prospective Clients:
2294 * #include <wifi-direct.h>
2299 * char new_wpa[64+1] = {0,};
2301 * printf("Input new WPA:\n");
2302 * scanf("%s",new_wpa);
2304 *if( strlen(new_wpa) > 0 )
2305 * result = wifi_direct_set_wpa_passphrase(new_wpa);
2307 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting password is successful
2313 ******************************************************************************/
2314 int wifi_direct_set_wpa_passphrase(char *passphrase);
2317 /*****************************************************************************************/
2318 /* wifi_direct_activate_pushbutton API function prototype
2319 * int wifi_direct_activate_pushbutton(void);
2322 * \brief This API shall start wps PBC.
2324 * \pre Device must support the pbc button mode.
2326 * \see wifi_direct_foreach_supported_wps_types
2328 * \par Sync (or) Async:
2329 * This is a Synchronous API.
2334 * \return Return Type (int) \n
2335 * - WIFI_DIRECT_ERROR_NONE on success \n
2336 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2337 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2338 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2339 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2340 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2341 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2343 * \par Prospective Clients:
2348 * #include <wifi-direct.h>
2355 * result = wifi_direct_activate_pushbutton();
2357 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activating push button is successful
2363 ******************************************************************************/
2364 int wifi_direct_activate_pushbutton(void);
2367 /*****************************************************************************************/
2368 /* wifi_direct_set_wps_pin API function prototype
2369 * int wifi_direct_set_wps_pin(char* pin)
2372 * \brief This API shall set or update the WPS PIN number user expects. \n
2373 * @param pin new pin to set. Application must set the new pin number before.
2375 * \see wifi_direct_generate_wps_pin.
2376 * \see wifi_direct_get_wps_pin
2378 * \par Sync (or) Async:
2379 * This is a Synchronous API.
2385 * \return Return Type (int) \n
2386 * - WIFI_DIRECT_ERROR_NONE on success \n
2387 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2388 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2389 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2390 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2391 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2392 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2393 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2396 * \par Prospective Clients:
2401 * #include <wifi-direct.h>
2406 * char pin[WIFI_DIRECT_WPS_PIN_LEN+1]= { 0, };
2408 * memset(pin, 0x00, sizeof(pin));
2409 * printf("Input 8 digit PIN number :\n");
2412 *if( strlen(pin) > 0 )
2413 * result = wifi_direct_set_wps_pin(pin);
2415 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting wps pin number is successful
2421 ******************************************************************************/
2422 int wifi_direct_set_wps_pin(char *pin);
2425 /*****************************************************************************************/
2426 /* wifi_direct_get_wps_pin API function prototype
2427 * int wifi_direct_get_wps_pin(char** pin)
2430 * \brief This API shall get the WPS PIN number. \n
2431 * @param pin Pointer to store pin number. Application must free this memory.
2433 * \see wifi_direct_set_wps_pin
2435 * \par Sync (or) Async:
2436 * This is a Synchronous API.
2442 * \return Return Type (int) \n
2443 * - WIFI_DIRECT_ERROR_NONE on success \n
2444 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2445 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2446 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2447 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2448 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2449 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2450 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2453 * \par Prospective Clients:
2458 * #include <wifi-direct.h>
2465 * result = wifi_direct_get_wps_pin(&pin);
2467 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting wps pin number is successful
2469 * free(pin); // Application should free the memory.
2475 ******************************************************************************/
2476 int wifi_direct_get_wps_pin(char **pin);
2479 /*****************************************************************************************/
2480 /* wifi_direct_generate_wps_pin API function prototype
2481 * wifi_direct_generate_wps_pin(void);
2484 * \brief This API shall generate the random WPS PIN number.\n
2485 * To get the generated PIN number, use wifi_direct_get_wps_pin() API.
2487 * \see wifi_direct_set_wps_pin
2488 * \see wifi_direct_get_wps_pin
2490 * \par Sync (or) Async:
2491 * This is a Synchronous API.
2497 * \return Return Type (int) \n
2498 * - WIFI_DIRECT_ERROR_NONE on success \n
2499 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2500 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2501 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2502 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2503 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2504 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2507 * \par Prospective Clients:
2512 * #include <wifi-direct.h>
2518 * result = wifi_direct_generate_wps_pin();
2520 * if(result == WIFI_DIRECT_ERROR_NONE)......... // generating wps pin number is successful
2526 ******************************************************************************/
2527 int wifi_direct_generate_wps_pin(void);
2530 /*****************************************************************************************/
2531 /* wifi_direct_get_supported_wps_mode API function prototype
2532 * int wifi_direct_get_supported_wps_mode(int *wps_mode);
2535 * \brief This API shall get the supported wps mode. \n
2536 * The result is bit flag.
2538 * @param wps_mode Memory to store supported wps mode. Application must allocate memory.
2540 * \see wifi_direct_wps_type_e
2542 * \par Sync (or) Async:
2543 * This is a Synchronous API.
2549 * \return Return Type (int) \n
2550 * - WIFI_DIRECT_ERROR_NONE on success \n
2551 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2552 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2553 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2554 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2555 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2556 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2557 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2560 * \par Prospective Clients:
2565 * #include <wifi-direct.h>
2570 * int supported_wps_mode = 0;
2572 * result = wifi_direct_get_supported_wps_mode(&supported_wps_mode);
2574 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting supported wps mode is successful
2580 ******************************************************************************/
2581 int wifi_direct_get_supported_wps_mode(int *wps_mode);
2585 * @brief Called when you get the supported WPS(Wi-Fi Protected Setup) type repeatedly.
2586 * @param[in] type The type of WPS
2587 * @param[in] user_data The user data passed from the request function
2588 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
2589 * @pre wifi_direct_foreach_supported_wps_types() will invoke this callback.
2590 * @see wifi_direct_foreach_supported_wps_types()
2592 typedef bool(*wifi_direct_supported_wps_type_cb)(wifi_direct_wps_type_e type, void *user_data);
2595 * @brief Gets the supported WPS(Wi-Fi Protected Setup) types.
2596 * @param[in] callback The callback function to invoke
2597 * @param[in] user_data The user data to be passed to the callback function
2598 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2599 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2600 * @see wifi_direct_supported_wps_type_cb()
2602 int wifi_direct_foreach_supported_wps_types(wifi_direct_supported_wps_type_cb callback, void *user_data);
2605 * @brief Gets the WPS(Wi-Fi Protected Setup) type.
2606 * @param[out] type The type of WPS
2607 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2608 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2609 * @see wifi_direct_foreach_supported_wps_types()
2611 int wifi_direct_get_local_wps_type(wifi_direct_wps_type_e *type);
2614 * @brief Sets the requested WPS(Wi-Fi Protected Setup) type.
2615 * @param[in] type The type of WPS
2616 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2617 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2618 * @see wifi_direct_foreach_supported_wps_types()
2620 int wifi_direct_set_req_wps_type(wifi_direct_wps_type_e type);
2623 * @brief Gets the requested WPS(Wi-Fi Protected Setup) type.
2624 * @param[out] type The type of WPS
2625 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2626 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2627 * @see wifi_direct_foreach_supported_wps_types()
2629 int wifi_direct_get_req_wps_type(wifi_direct_wps_type_e *type);
2632 * @brief Sets the intent of a group owner.
2633 * @remakrs The range of intent is 0 ~ 15.
2634 * @param[in] intent The intent of a group owner
2635 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2636 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2637 * @see wifi_direct_get_group_owner_intent()
2639 int wifi_direct_set_group_owner_intent(int intent);
2642 * @brief Gets the intent of a group owner.
2643 * @param[out] intent The intent of a group owner
2644 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2645 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2646 * @see wifi_direct_set_group_owner_intent()
2648 int wifi_direct_get_group_owner_intent(int *intent);
2651 * @brief Sets the max number of clients.
2652 * @param[in] max The max number of clients
2653 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2654 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2655 * @see wifi_direct_get_max_clients()
2657 int wifi_direct_set_max_clients(int max);
2660 * @brief Gets the max number of clients.
2661 * @param[in] max The max number of clients
2662 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2663 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2664 * @see wifi_direct_set_max_clients()
2666 int wifi_direct_get_max_clients(int *max);
2670 * @brief Gets the channel of own group. - DEPRECATED
2671 * @param[out] channel The channel of own group
2672 * @return 0 on success, otherwise a negative error value.
2673 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2674 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2675 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2676 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2677 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2678 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2679 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2680 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2681 * @see wifi_direct_initialize()
2683 int wifi_direct_get_own_group_channel(int *channel);
2687 * @brief Gets the operating channel.
2688 * @param[out] channel The operating channel
2689 * @return 0 on success, otherwise a negative error value.
2690 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2691 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2692 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2693 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2694 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2695 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2696 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2697 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2698 * @see wifi_direct_initialize()
2700 int wifi_direct_get_operating_channel(int *channel);
2703 * @brief Sets the Autoconnection mode.
2705 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2706 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2707 * @see wifi_direct_foreach_supported_wps_types()
2709 int wifi_direct_set_autoconnection_mode(bool mode);
2711 int wifi_direct_is_autoconnection_mode(bool *mode);
2714 * @brief Enables the persistent group.
2715 * @details If @a enabled is true, then P2P persisten group will be used when creating a group and establishing a connection.
2716 * @param[in] enabled The status of persistent group: (@c true = enabled, @c false = disabled)
2717 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2718 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2719 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2720 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2721 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2722 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2723 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2724 * @see wifi_direct_initialize()
2725 * @see wifi_direct_is_persistent_group_enabled()
2727 int wifi_direct_set_persistent_group_enabled(bool enabled);
2730 * @brief Checks whether the persistent group is enabled or disabled.
2731 * @param[out] enabled The status of persistent group: (@c true = enabled, @c false = disabled)
2732 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2733 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2734 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2735 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2736 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2737 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2738 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2739 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2740 * @see wifi_direct_initialize()
2741 * @see wifi_direct_set_persistent_group_enabled()
2743 int wifi_direct_is_persistent_group_enabled(bool *enabled);
2747 * @brief Called when you get the persistent groups repeatedly.
2748 * @param[in] mac_address The MAC address of persistent group owner
2749 * @param[in] ssid The SSID(Service Set Identifier) of persistent group owner
2750 * @param[in] user_data The user data passed from the request function
2751 * @return @c true to continue with the next iteration of the loop, \n @c false to break out of theloop
2752 * @pre wifi_direct_foreach_persistent_groups() will invoke this callback.
2753 * @see wifi_direct_foreach_persistent_groups()
2755 typedef bool(*wifi_direct_persistent_group_cb)(const char *mac_address, const char *ssid, void *user_data);
2758 * @brief Gets the persistent groups.
2759 * @param[in] callback The callback function to invoke
2760 * @param[in] user_data The user data to be passed to the callback function
2761 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2762 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2763 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2764 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2765 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2766 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2767 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2768 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2769 * @post wifi_direct_persistent_group_cb() will be called.
2770 * @see wifi_direct_initialize()
2771 * @see wifi_direct_persistent_group_cb()
2773 int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb callback, void *user_data);
2776 * @brief Remove a persistent group.
2777 * @param[in] mac_address The MAC address of persistent group owner
2778 * @param[in] ssid The SSID(Service Set Identifier) of persistent group owner
2779 * @retval #WIFI_DIRECT_ERROR_NONE Successful
2780 * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER Invalid parameter
2781 * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED Operation failed
2782 * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED Communication failed
2783 * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED Operation not permitted
2784 * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED Not initialized
2785 * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY Device or resource busy
2786 * @pre Wi-Fi Direct service must be initialized by wifi_direct_initialize().
2787 * @see wifi_direct_initialize()
2788 * @see wifi_direct_foreach_persistent_groups()
2790 int wifi_direct_remove_persistent_group(const char *mac_address, const char *ssid);
2792 /*****************************************************************************************/
2793 /* wifi_direct_service_add API function prototype
2794 * int wifi_direct_service_add(wifi_direct_service_type_e type, char *data1, char *data2)
2797 * \brief This API shall add the service user expects. \n
2798 * @param type new service type to add. Application must run the new service before.
2799 * @param data1 new service query to add. Application must run the new service before.
2801 * bonjour: <RDATA hexdump>
2802 * vendor specific: <service string>
2803 * @param data2 new service data to add. Application must run the new service before.
2804 * upnp: <version hex>
2805 * bonjour: <query hexdump>
2806 * vendor specific: NULL
2808 * \see wifi_direct_service_del.
2809 * \see wifi_direct_serv_disc_req.
2810 * \see wifi_direct_serv_disc_cancel.
2812 * \par Sync (or) Async:
2813 * This is a Synchronous API.
2819 * \return Return Type (int) \n
2820 * WIFI_DIRECT_ERROR_NONE on Success \n
2821 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2822 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2823 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2824 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2825 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2826 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2827 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2828 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2829 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2830 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2831 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2832 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2833 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2834 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2835 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2842 ******************************************************************************/
2843 int wifi_direct_service_add(wifi_direct_service_type_e type, char *data1, char *data2);
2845 /*****************************************************************************************/
2846 /* wifi_direct_service_del API function prototype
2847 * int wifi_direct_service_del(wifi_direct_service_type_e type, char *data1, char *data2)
2850 * \brief This API shall delete the service user expects. \n
2851 * @param type service type to delete. Application must run and add the service to wpasupplicant before.
2852 * @param data1 new service query to delete. Application must run and add the service to wpasupplicant before.
2854 * bonjour: <query hexdump>
2855 * vendor specific: <service string>
2856 * @param data2 new service data to delete. Application must run and add the service to wpasupplicant before.
2857 * upnp: <version hex>
2859 * vendor specific: NULL
2861 * \see wifi_direct_service_add.
2862 * \see wifi_direct_serv_disc_req.
2863 * \see wifi_direct_serv_disc_cancel.
2865 * \par Sync (or) Async:
2866 * This is a Synchronous API.
2872 * \return Return Type (int) \n
2873 * WIFI_DIRECT_ERROR_NONE on Success \n
2874 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2875 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2876 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2877 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2878 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2879 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2880 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2881 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2882 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2883 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2884 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2885 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2886 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2887 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2888 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2895 ******************************************************************************/
2896 int wifi_direct_service_del(wifi_direct_service_type_e type, char *data1, char *data2);
2898 /*****************************************************************************************/
2899 /* wifi_direct_service_del API function prototype
2900 * int wifi_direct_serv_disc_req(char* MAC, wifi_direct_service_type_e type, char *data1, char *data2)
2903 * \brief This API shall delete the service user expects. \n
2904 * @param MAC peer MAC address to discover service. this value can be specific MAC address or 00:00:00:00:00:00 as wildcard
2905 * @param type service type to discover. this value can be NULL if this value is not needed.
2906 * @param data1 service query to discover. this value can be NULL if this value is not needed.
2908 * upnp: <service> or NULL for finding all upnp services
2909 * bonjour: <query hexdump> or NULL for finding all bonjour services
2910 * vendor specific: <service string> or NULL for finding all vendor specific services
2911 * @param data2 service data to discover. this value is mandatory and can be Service Query TLV,
2913 * upnp: <version hex> or NULL for finding all upnp services
2915 * vendor specific: NULL
2917 * \see wifi_direct_service_add.
2918 * \see wifi_direct_service_del.
2919 * \see wifi_direct_serv_disc_cancel.
2921 * \par Sync (or) Async:
2922 * This is a Synchronous API.
2928 * \return Return Type (int) \n
2929 * Request Handle on Success \n
2930 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2931 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2932 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2933 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2934 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2935 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2936 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2937 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2938 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2939 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2940 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2941 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2942 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2943 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2944 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2951 ******************************************************************************/
2952 int wifi_direct_serv_disc_req(char* MAC, wifi_direct_service_type_e type, char *data1, char *data2);
2954 /*****************************************************************************************/
2955 /* wifi_direct_service_del API function prototype
2956 * int wifi_direct_serv_disc_cancel(int handle)
2959 * \brief This API shall delete the service user expects. \n
2960 * @param handle query handle to delete. Application had requested service discovery to manager and has gotten this handle.
2962 * \see wifi_direct_service_add.
2963 * \see wifi_direct_service_del.
2964 * \see wifi_direct_serv_disc_req.
2966 * \par Sync (or) Async:
2967 * This is a Synchronous API.
2973 * \return Return Type (int) \n
2974 * WIFI_DIRECT_ERROR_NONE on Success \n
2975 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
2976 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
2977 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
2978 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
2979 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
2980 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
2981 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
2982 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
2983 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
2984 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
2985 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
2986 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
2987 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
2988 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
2989 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
2997 ******************************************************************************/
2998 int wifi_direct_serv_disc_cancel(int handle);
3000 /*****************************************************************************************/
3001 /* wifi_direct_init_wifi_display API function prototype
3002 * int wifi_direct_init_wifi_display(wifi_direct_display_type type, int port, int hdcp)
3005 * \brief This API shall initialize the wifi display. \n
3006 * @param type wifi direct display device type.
3007 * @param port port number that is used by wifi direct display.
3008 * @param hdcp indicate that hdcp is support capability.
3010 * \see wifi_direct_deinit_wifi_display.
3011 * \see wifi_direct_get_display_port
3012 * \see wifi_direct_get_display_type.
3014 * \par Sync (or) Async:
3015 * This is a Synchronous API.
3021 * \return Return Type (int) \n
3022 * WIFI_DIRECT_ERROR_NONE on Success \n
3023 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3024 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3025 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3026 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3027 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3028 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3029 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3030 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3031 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3032 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3033 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3034 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3035 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3036 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3037 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3045 ******************************************************************************/
3046 int wifi_direct_init_wifi_display(wifi_direct_display_type_e type, int port, int hdcp);
3048 /*****************************************************************************************/
3049 /* wifi_direct_deinit_wifi_display API function prototype
3050 * int wifi_direct_deinit_wifi_display(void)
3053 * \brief This API shall deinitialize the wifi direct display. \n
3055 * \see wifi_direct_init_wifi_display.
3056 * \see wifi_direct_get_display_port
3057 * \see wifi_direct_get_display_type.
3059 * \par Sync (or) Async:
3060 * This is a Synchronous API.
3066 * \return Return Type (int) \n
3067 * WIFI_DIRECT_ERROR_NONE on Success \n
3068 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3069 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3070 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3071 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3072 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3073 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3074 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3075 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3076 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3077 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3078 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3079 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3080 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3081 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3082 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3090 ******************************************************************************/
3091 int wifi_direct_deinit_wifi_display(void);
3093 /*****************************************************************************************/
3094 /* wifi_direct_get_display_port API function prototype
3095 * int wifi_direct_get_display_port(int *port)
3098 * \brief This API shall get wifi display port. \n
3099 * @param port TCP control port of this wifi direct diplay device. Application had enabled the wifi direct display before use this function.
3101 * \see wifi_direct_init_wifi_display.
3102 * \see wifi_direct_deinit_wifi_display.
3103 * \see wifi_direct_get_display_type.
3105 * \par Sync (or) Async:
3106 * This is a Synchronous API.
3112 * \return Return Type (int) \n
3113 * WIFI_DIRECT_ERROR_NONE on Success \n
3114 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3115 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3116 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3117 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3118 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3119 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3120 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3121 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3122 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3123 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3124 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3125 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3126 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3127 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3128 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3136 ******************************************************************************/
3137 int wifi_direct_get_display_port(int *port);
3139 /*****************************************************************************************/
3140 /* wifi_direct_get_display_type API function prototype
3141 * int wifi_direct_get_display_type(wifi_direct_display_type *type)
3144 * \brief This API shall get wifi display type. \n
3145 * @param type wifi direct display type of this device. Application had enabled the wifi direct display before use this function.
3147 * \see wifi_direct_init_wifi_display.
3148 * \see wifi_direct_deinit_wifi_display.
3149 * \see wifi_direct_get_display_port.
3151 * \par Sync (or) Async:
3152 * This is a Synchronous API.
3158 * \return Return Type (int) \n
3159 * WIFI_DIRECT_ERROR_NONE on Success \n
3160 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3161 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3162 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3163 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3164 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3165 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3166 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3167 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3168 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3169 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3170 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3171 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3172 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3173 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3174 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3182 ******************************************************************************/
3183 int wifi_direct_get_display_type(wifi_direct_display_type_e *type);
3185 /*****************************************************************************************/
3186 /* wifi_direct_add_to_access_list API function prototype
3187 * int wifi_direct_add_to_access_list(const char *mac_address, bool allow)
3190 * \brief This API shall add device to list to automatically allow or deny connection request. \n
3191 * @param mac_address device mac address to add device list.
3192 * @param allow allow or deny flag.
3194 * \see wifi_direct_del_from_access_list.
3196 * \par Sync (or) Async:
3197 * This is a Synchronous API.
3203 * \return Return Type (int) \n
3204 * WIFI_DIRECT_ERROR_NONE on Success \n
3205 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3206 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3207 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3208 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3209 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3210 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3211 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3212 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3213 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3214 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3215 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3216 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3217 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3218 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3219 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3227 ******************************************************************************/
3228 int wifi_direct_add_to_access_list(const char *mac_address, bool allow);
3230 /*****************************************************************************************/
3231 /* wifi_direct_del_from_access_list API function prototype
3232 * int wifi_direct_del_from_access_list(const char *mac_address, bool allow)
3235 * \brief This API shall add device to list to automatically allow or deny connection request. \n
3236 * @param mac_address device mac address to delete from list.
3237 * if 00:00:00:00:00:00, reset list
3239 * \see wifi_direct_add_to_access_list.
3241 * \par Sync (or) Async:
3242 * This is a Synchronous API.
3248 * \return Return Type (int) \n
3249 * WIFI_DIRECT_ERROR_NONE on Success \n
3250 * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
3251 * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
3252 * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
3253 * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
3254 * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
3255 * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
3256 * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
3257 * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
3258 * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
3259 * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
3260 * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
3261 * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
3262 * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
3263 * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
3264 * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
3272 ******************************************************************************/
3273 int wifi_direct_del_from_access_list(const char *mac_address);
3283 #endif //__WIFI_DIRECT_INTERFACE_H_