4 * Copyright (c) 2000 - 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_OUT_OF_MEMORY = -ENOMEM, /**< Out of memory */
46 WIFI_DIRECT_ERROR_NOT_PERMITTED = -EPERM, /**< Operation not permitted */
47 WIFI_DIRECT_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid function parameter */
48 WIFI_DIRECT_ERROR_RESOURCE_BUSY = -EBUSY, /**< Device or resource busy */
49 WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT = -ETIMEDOUT, /**< Connection timed out */
50 WIFI_DIRECT_ERROR_STRANGE_CLIENT = -0x00008000|0x0201, /**< Invalid Client */
51 WIFI_DIRECT_ERROR_COMMUNICATION_FAILED = -0x00008000|0x0202, /**< I/O error */
52 WIFI_DIRECT_ERROR_WIFI_USED = -0x00008000|0x0203, /**< WiFi is being used */
53 WIFI_DIRECT_ERROR_MOBILE_AP_USED = -0x00008000|0x0204, /**< Mobile AP is being used */
54 WIFI_DIRECT_ERROR_CONNECTION_FAILED = -0x00008000|0x0205, /**< Connection failed */
55 WIFI_DIRECT_ERROR_AUTH_FAILED = -0x00008000|0x0206, /**< Authentication failed */
56 WIFI_DIRECT_ERROR_OPERATION_FAILED = -0x00008000|0x0207, /**< Operation failed */
57 WIFI_DIRECT_ERROR_TOO_MANY_CLIENT = -0x00008000|0x0208, /**< Too many client */
58 } wifi_direct_error_e;
61 * @brief Enumeration for Wi-Fi Direct link status
65 WIFI_DIRECT_STATE_DEACTIVATED = 0,
67 WIFI_DIRECT_STATE_DEACTIVATING, /**< */
68 WIFI_DIRECT_STATE_ACTIVATING, /**< */
69 WIFI_DIRECT_STATE_ACTIVATED, /**< */
70 WIFI_DIRECT_STATE_DISCOVERING, /**< */
71 WIFI_DIRECT_STATE_CONNECTING, /**< */
72 WIFI_DIRECT_STATE_DISCONNECTING, /**< */
73 WIFI_DIRECT_STATE_CONNECTED, /**< */
74 WIFI_DIRECT_STATE_GROUP_OWNER /**< */
75 } wifi_direct_state_e;
78 * @brief Enumeration for Wi-Fi Direct device state
82 WIFI_DIRECT_DEVICE_STATE_ACTIVATED,
83 WIFI_DIRECT_DEVICE_STATE_DEACTIVATED,
84 } wifi_direct_device_state_e;
87 * @brief Enumeration for Wi-Fi Direct discovery state
91 WIFI_DIRECT_ONLY_LISTEN_STARTED,
92 WIFI_DIRECT_DISCOVERY_STARTED,
93 WIFI_DIRECT_DISCOVERY_FOUND,
94 WIFI_DIRECT_DISCOVERY_FINISHED,
95 } wifi_direct_discovery_state_e;
98 * @brief Enumeration for Wi-Fi Direct connection state
102 WIFI_DIRECT_CONNECTION_REQ, /**< */
103 WIFI_DIRECT_CONNECTION_WPS_REQ, /**< */
104 WIFI_DIRECT_CONNECTION_IN_PROGRESS, /**< */
105 WIFI_DIRECT_CONNECTION_RSP, /**< */
106 WIFI_DIRECT_DISASSOCIATION_IND, /**< */
107 WIFI_DIRECT_DISCONNECTION_RSP, /**< */
108 WIFI_DIRECT_DISCONNECTION_IND, /**< */
109 WIFI_DIRECT_GROUP_CREATED, /**< */
110 WIFI_DIRECT_GROUP_DESTROYED, /**< */
111 } wifi_direct_connection_state_e;
114 * @brief Enumeration for Wi-Fi Direct secondary device type
118 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_PC = 1, /**< */
119 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_SERVER = 2, /**< */
120 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_MEDIA_CTR = 3, /**< */
121 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_UMPC = 4, /**< */
122 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_NOTEBOOK = 5, /**< */
123 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_DESKTOP = 6, /**< */
124 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_MID = 7, /**< */
125 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_COMPUTER_NETBOOK = 8, /**< */
126 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_KEYBOARD = 1, /**< */
127 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_MOUSE = 2, /**< */
128 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_JOYSTICK = 3, /**< */
129 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_TRACKBALL = 4, /**< */
130 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_CONTROLLER = 5, /**< */
131 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_REMOTE = 6, /**< */
132 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_TOUCHSCREEN = 7,/**< */
133 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_BIO_READER = 8, /**< */
134 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_INPUT_BAR_READER = 9, /**< */
135 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_PRINTER = 1, /**< */
136 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_SCANNER = 2, /**< */
137 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_FAX = 3, /**< */
138 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_COPIER = 4, /**< */
139 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PRINTER_ALLINONE = 5, /**< */
140 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_DIGITAL_STILL = 1, /**< */
141 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_VIDEO = 2, /**< */
142 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_WEBCAM = 3, /**< */
143 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_CAMERA_SECONDARYURITY = 4, /**< */
144 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_STORAGE_NAS = 1, /**< */
145 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_AP = 1, /**< */
146 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_ROUTER = 2, /**< */
147 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_SWITCH = 3, /**< */
148 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_NETWORK_INFRA_GATEWAY = 4, /**< */
149 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_TV = 1, /**< */
150 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_PIC_FRAME = 2, /**< */
151 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_PROJECTOR = 3, /**< */
152 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_DISPLAY_MONITOR = 4, /**< */
153 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_DAR = 1, /**< */
154 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVR = 2, /**< */
155 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MCX = 3, /**< */
156 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB = 4, /**< */
157 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MSMAME = 5, /**< */
158 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP = 6, /**< */
159 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_XBOX = 1, /**< */
160 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_XBOX_360 = 2, /**< */
161 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_PS = 3, /**< */
162 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_CONSOLE = 4, /**< */
163 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_GAME_PORTABLE = 5, /**< */
164 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_WM = 1, /**< */
165 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SINGLE = 2, /**< */
166 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_DUAL = 3, /**< */
167 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SM_SINGLE = 4,
169 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_PHONE_SM_DUAL = 5, /**< */
170 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER = 1, /**< */
171 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_SPEAKER = 2, /**< */
172 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_PMP = 3, /**< */
173 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_HEADSET = 4, /**< */
174 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_HEADPHONE = 5,
176 WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_MIC = 6, /**< */
177 } wifi_direct_secondary_device_type_e;
180 * @brief Enumeration for Wi-Fi Direct primary device type
184 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_COMPUTER = 1, /**< */
185 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_INPUT_DEVICE = 2, /**< */
186 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_PRINTER = 3, /**< */
187 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_CAMERA = 4, /**< */
188 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_STORAGE = 5, /**< */
189 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_NETWORK_INFRA = 6, /**< */
190 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_DISPLAY = 7, /**< */
191 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_MULTIMEDIA_DEVICE = 8, /**< */
192 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_GAME_DEVICE = 9, /**< */
193 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_TELEPHONE = 10, /**< */
194 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_AUDIO = 11, /**< */
195 WIFI_DIRECT_PRIMARY_DEVICE_TYPE_OTHER = 255 /**< */
196 } wifi_direct_primary_device_type_e;
200 * Wi-Fi Direct WPS config methods
204 WIFI_DIRECT_WPS_PUSHBUTTON = 0x0001, /**< Push Button mode*/
205 WIFI_DIRECT_WPS_DISPLAY = 0x0002, /**< Display mode */
206 WIFI_DIRECT_WPS_KEYPAD = 0x0004, /**< Keypad mode */
207 } wifi_direct_wps_cfg_e;
210 * @struct wifi_direct_config_data_s
211 * Wi-Fi Direct configuration data structure
218 /** Specifies the operating channel. If zero, auto channel selection
219 * will be used to find a quiet channel.
223 /** WPS configuration parameters. */
224 wifi_direct_wps_cfg_e wps_config;
226 /** Max number of STAs allowed associations */
229 /** TRUE to hide SSID in beacons and probe responses, FALSE otherwise. */
232 /** P2P Group owner intent value. */
233 int group_owner_intent;
235 bool want_persistent_group;
237 /** Auto connection mode */
238 bool auto_connection;
240 wifi_direct_primary_device_type_e primary_dev_type;
241 wifi_direct_secondary_device_type_e secondary_dev_type;
242 } wifi_direct_config_data_s;
246 * @struct wifi_direct_discovered_peer_info_s
247 * Wi-Fi Direct buffer structure to store result of peer discovery
251 char* ssid; /** 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 } wifi_direct_discovered_peer_info_s;
264 * @struct wifi_direct_connected_peer_info_s
265 * Wi-Fi Direct buffer structure to store information of connected peer
269 char* ssid; /** Null-terminated device friendly name. */
270 char* mac_address; /** Device's P2P Device Address */
271 char* interface_address; /** Device's P2P Interface Address */
272 bool p2p_supported; /* whether peer is a P2P device */
273 wifi_direct_primary_device_type_e primary_device_type; /* primary category of device */
274 } wifi_direct_connected_peer_info_s;
277 * Notification callback function type. \n
279 * Discover notifications can occur at the peers or P2P groups are found.
281 * @param event Specifies the types of notifications.
282 * - WIFI_DIRECT_DISCOVERY_STARTED
283 * - WIFI_DIRECT_ONLY_LISTEN_STARTED
284 * - WIFI_DIRECT_DISCOVERY_FOUND
285 * - WIFI_DIRECT_DISCOVERY_FINISHED
286 * @param error_code In failure case.
287 * @param user_data User can transfer the user specific data in callback.
290 typedef void (*wifi_direct_discovery_state_chagned_cb) (int error_code,
291 wifi_direct_discovery_state_e
296 * Notification callback function type. \n
298 * Activation notifications callback function type.
300 * @param event Specifies the types of notifications.
301 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED
302 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED
303 * @param error_code In failure case.
304 * @param user_data User can transfer the user specific data in callback.
307 typedef void (*wifi_direct_device_state_changed_cb) (int error_code,
308 wifi_direct_device_state_e
313 * connection notification callback function type. \n
315 * @param event Specifies the types of notifications.
316 * - WIFI_DIRECT_CONNECTION_REQ
317 * - WIFI_DIRECT_CONNECTION_WPS_REQ
318 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS
319 * - WIFI_DIRECT_CONNECTION_RSP
320 * - WIFI_DIRECT_DISASSOCIATION_IND
321 * - WIFI_DIRECT_DISCONNECTION_RSP
322 * - WIFI_DIRECT_DISCONNECTION_IND
323 * - WIFI_DIRECT_GROUP_CREATED
324 * - WIFI_DIRECT_GROUP_DESTROYED
326 * @param error_code In failure case.
328 * @param param1 additional data for connection. ex) MAC
329 * @param param2 additional data for connection. ex) SSID
331 * @param user_data User can transfer the user specific data in callback.
334 typedef void (*wifi_direct_connection_state_changed_cb) (int error_code,
335 wifi_direct_connection_state_e
342 /*=============================================================================
343 Wifi Direct Client APIs
344 =============================================================================*/
346 /*****************************************************************************/
347 /* wifi_direct_initialize API function prototype
348 * int wifi_direct_initialize (void);
351 * \brief This API shall register the client application with the Wi-Fi Direct server and initialize the various variables. \n
355 * \post Application is registered.
357 * \see wifi_direct_device_state_changed_cb
358 * \see wifi_direct_discovery_state_chagned_cb
359 * \see wifi_direct_connection_state_changed_cb
361 * \par Sync (or) Async:
362 * This is a Synchronous API.
367 * \return Return Type (int) \n
369 * - WIFI_DIRECT_ERROR_NONE on success \n
370 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
371 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
372 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
373 * - WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for "Too many users" \n
374 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
375 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
377 * \par Prospective Clients:
383 * #include <wifi-direct.h>
390 * result = wifi_direct_initialize();
392 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully connected to the wifi direct server
395 ******************************************************************************/
396 int wifi_direct_initialize(void);
399 /*****************************************************************************************/
400 /* wifi_direct_deinitialize API function prototype
401 * int wifi_direct_deinitialize(void);
405 * \brief This API shall deregister the client application with the Wi-Fi Direct server and releases all resources.
407 * \pre Application must be already registered to the Wi-Fi Direct server.
409 * \post Application is de-registered.
411 * \see wifi_direct_initialize
413 * \par Sync (or) Async:
414 * This is a Synchronous API.
420 * \par Async Response Message:
424 * \return Return Type (int) \n
425 * - WIFI_DIRECT_ERROR_NONE on success \n
426 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
427 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
428 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
429 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
430 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
431 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
433 * \par Prospective Clients:
438 * #include <wifi-direct.h>
445 * result = wifi_direct_deinitialize();
447 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deregister is successful
453 ******************************************************************************/
454 int wifi_direct_deinitialize(void);
457 /*****************************************************************************/
458 /* wifi_direct_set_connection_state_changed_cb API function prototype
459 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_device_state_changed_cb cb, void* user_data)
462 * \brief This API shall register the activation callback function and user data from client. \n
464 * \pre The Client should be initialized.
466 * \see wifi_direct_initialize
467 * \see wifi_direct_device_state_changed_cb
469 * \par Sync (or) Async:
470 * This is a Synchronous API.
475 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
476 * \param[in] user_data user data
478 * \return Return Type (int) \n
480 * - WIFI_DIRECT_ERROR_NONE on success \n
481 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
483 * \par Prospective Clients:
489 * #include <wifi-direct.h>
496 * result = wifi_direct_set_connection_state_changed_cb(_cb_activation, void* user_data);
498 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
501 ******************************************************************************/
502 int wifi_direct_set_device_state_changed_cb(wifi_direct_device_state_changed_cb cb, void *user_data);
505 /*****************************************************************************/
506 /* wifi_direct_unset_connection_state_changed_cb API function prototype
507 * int wifi_direct_unset_connection_state_changed_cb(void)
510 * \brief This API shall deregister the activation callback function and user data from client. \n
512 * \pre The Client should be initialized.
514 * \see wifi_direct_initialize
515 * \see wifi_direct_set_connection_state_changed_cb
517 * \par Sync (or) Async:
518 * This is a Synchronous API.
523 * \return Return Type (int) \n
525 * - WIFI_DIRECT_ERROR_NONE on success \n
526 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
528 * \par Prospective Clients:
534 * #include <wifi-direct.h>
541 * result = wifi_direct_unset_connection_state_changed_cb();
543 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
546 ******************************************************************************/
547 int wifi_direct_unset_device_state_changed_cb(void);
551 /*****************************************************************************/
552 /* wifi_direct_set_discovery_state_changed_cb API function prototype
553 * int wifi_direct_set_discover_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void* user_data)
556 * \brief This API shall register the discover callback function and user data from client. \n
558 * \pre The Client should be initialized.
560 * \see wifi_direct_initialize
561 * \see wifi_direct_discovery_state_chagned_cb
563 * \par Sync (or) Async:
564 * This is a Synchronous API.
569 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
570 * \param[in] user_data user data
572 * \return Return Type (int) \n
574 * - WIFI_DIRECT_ERROR_NONE on success \n
575 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
577 * \par Prospective Clients:
583 * #include <wifi-direct.h>
590 * result = wifi_direct_set_discovery_state_changed_cb(_cb_discover, void* user_data);
592 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
595 ******************************************************************************/
596 int wifi_direct_set_discovery_state_changed_cb(wifi_direct_discovery_state_chagned_cb cb, void *user_data);
599 /*****************************************************************************/
600 /* wifi_direct_unset_discovery_state_changed_cb API function prototype
601 * int wifi_direct_unset_discovery_state_changed_cb(void)
604 * \brief This API shall deregister the discover callback function and user data from client. \n
606 * \pre The Client should be initialized.
608 * \see wifi_direct_initialize
609 * \see wifi_direct_set_discovery_state_changed_cb
611 * \par Sync (or) Async:
612 * This is a Synchronous API.
617 * \return Return Type (int) \n
619 * - WIFI_DIRECT_ERROR_NONE on success \n
620 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
622 * \par Prospective Clients:
628 * #include <wifi-direct.h>
635 * result = wifi_direct_unset_discovery_state_changed_cb();
637 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
640 ******************************************************************************/
641 int wifi_direct_unset_discovery_state_changed_cb(void);
645 /*****************************************************************************/
646 /* wifi_direct_set_connection_state_changed_cb API function prototype
647 * int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void* user_data)
650 * \brief This API shall register the connection callback function and user data from client. \n
652 * \pre The Client should be initialized.
654 * \see wifi_direct_initialize
655 * \see wifi_direct_connection_state_changed_cb
657 * \par Sync (or) Async:
658 * This is a Synchronous API.
663 * \param[in] cb Application Callback function pointer to receive Wi-Fi Direct events
664 * \param[in] user_data user data
666 * \return Return Type (int) \n
668 * - WIFI_DIRECT_ERROR_NONE on success \n
669 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
671 * \par Prospective Clients:
677 * #include <wifi-direct.h>
684 * result = wifi_direct_set_connection_state_changed_cb(_cb_connection, void* user_data);
686 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully registered the callback function
689 ******************************************************************************/
690 int wifi_direct_set_connection_state_changed_cb(wifi_direct_connection_state_changed_cb cb, void *user_data);
693 /*****************************************************************************/
694 /* wifi_direct_unset_connection_state_changed_cb API function prototype
695 * int wifi_direct_unset_connection_state_changed_cb(void)
698 * \brief This API shall deregister the connection callback function and user data from client. \n
700 * \pre The Client should be initialized.
702 * \see wifi_direct_initialize
703 * \see wifi_direct_set_connection_state_changed_cb
705 * \par Sync (or) Async:
706 * This is a Synchronous API.
711 * \return Return Type (int) \n
713 * - WIFI_DIRECT_ERROR_NONE on success \n
714 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
716 * \par Prospective Clients:
722 * #include <wifi-direct.h>
729 * result = wifi_direct_unset_connection_state_changed_cb();
731 * if(result == WIFI_DIRECT_ERROR_NONE).........// Successfully deregistered the callback function
734 ******************************************************************************/
735 int wifi_direct_unset_connection_state_changed_cb(void);
738 /*****************************************************************************************/
739 /* wifi_direct_activate API function prototype
740 * int wifi_direct_activate(void);
744 * \brief This API shall open a wireless adapter device for P2P use.
746 * \pre Application must be already registered to the Wi-Fi Direct server.
748 * \post wireless adapter device will be ready to use.
750 * \see wifi_direct_initialize
752 * \par Sync (or) Async:
753 * This is a Asynchronous API.
759 * \par Async Response Message:
760 * - WIFI_DIRECT_DEVICE_STATE_ACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when activation process is completed. \n
763 * \return Return Type (int*) \n
764 * - WIFI_DIRECT_ERROR_NONE on success \n
765 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
766 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
767 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
768 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
769 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
770 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
771 * - WIFI_DIRECT_ERROR_WIFI_USED for "WiFi is being used" \n
772 * - WIFI_DIRECT_ERROR_MOBILE_AP_USED for "Mobile AP is being used" \n
775 * \par Prospective Clients:
780 * #include <wifi-direct.h>
787 * result = wifi_direct_activate();
789 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activation is successful
795 ******************************************************************************/
796 int wifi_direct_activate(void);
799 /*****************************************************************************************/
800 /* wifi_direct_deactivate API function prototype
801 * int wifi_direct_deactivate(void);
805 * \brief This API shall close a wireless adapter device for P2P use
807 * \pre Wireless adapter device must be already opened.
809 * \post wireless adapter device will be closed.
811 * \see wifi_direct_activate
813 * \par Sync (or) Async:
814 * This is a Asynchronous API.
820 * \par Async Response Message:
821 * - WIFI_DIRECT_DEVICE_STATE_DEACTIVATED : Application will receive this event via wifi_direct_device_state_changed_cb, when deactivation process is completed. \n
823 * \return Return Type (int) \n
824 * - WIFI_DIRECT_ERROR_NONE on success \n
825 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
826 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
827 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
828 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
829 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
830 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
833 * \par Prospective Clients:
838 * #include <wifi-direct.h>
844 * result = wifi_direct_deactivate();
846 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Deactivation is successful
852 ******************************************************************************/
853 int wifi_direct_deactivate(void);
856 /*****************************************************************************************/
857 /* wifi_direct_start_discovery API function prototype
858 * int wifi_direct_start_discovery(bool listen_only, int timeout);
861 * \brief This API shall Start a discovery to find all P2P capable devices. \n
862 * Applications will be notified event via wifi_direct_discovery_state_chagned_cb(). \n
864 * @param listen_only if true, skip the initial 802.11 scan and then enter
865 * Listen state instead of cycling between Search and Listen.
866 * @param timeout Specifies the duration of discovery period, in seconds.
867 * APs. If 0, a default value will be used, which depends on UX guideline.
869 * \pre Wireless adapter device must be already opened.
872 * \see wifi_direct_get_discovery_result
874 * \par Sync (or) Async:
875 * This is a Asynchronous API.
881 * \par Async Response Message:
882 * - WIFI_DIRECT_DISCOVERY_STARTED : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when discover process (80211 Scan) started. \n
883 * - 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
884 * - WIFI_DIRECT_DISCOVERY_FOUND : Application will receive this event via wifi_direct_discovery_state_chagned_cb (), when peer or group is found. \n
885 * - WIFI_DIRECT_DISCOVERY_FINISHED : Once the whole discovery process is completed, applications will receive it via wifi_direct_discovery_state_chagned_cb (). \n
886 * Applications may then call wifi_direct_foreach_discovered_peers() to get the final result. \n
887 * With the intermediate or final list of P2P capable devices, applications can update their UI if needed. \n
888 * It is up to the applications to control how often to update their UI display. \n
891 * \return Return Type (int) \n
892 * - WIFI_DIRECT_ERROR_NONE on success \n
893 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
894 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
895 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
896 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
897 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
898 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
899 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
902 * \par Prospective Clients:
907 * #include <wifi-direct.h>
914 * result = wifi_direct_start_discovery(TRUE, 0);
916 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery request is successful
920 *\remarks If discover is over, peer can not find the device and the device can not find peer, too.
922 ******************************************************************************/
923 int wifi_direct_start_discovery(bool listen_only, int timeout);
926 /*****************************************************************************************/
927 /* wifi_direct_cancel_discovery API function prototype
928 * int wifi_direct_cancel_discovery(void);
931 * \brief This API shall cancel the discovery process started from wifi_direct_start_discovery. \n
933 * \pre discovery process must be started.
935 * \post discovery process stopped.
937 * \see wifi_direct_client_start_discovery
939 * \par Sync (or) Async:
940 * This is a Asynchronous API.
946 * \par Async Response Message:
947 * - WIFI_DIRECT_DISCOVERY_FINISHED : Applications will receive a this event
948 * via callback when the discovery process is cancelled or completed.
951 * \return Return Type (int) \n
952 * - WIFI_DIRECT_ERROR_NONE on success \n
953 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
954 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
955 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
956 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
957 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
958 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
960 * \par Prospective Clients:
965 * #include <wifi-direct.h>
972 * result = wifi_direct_cancel_discovery();
974 * if(result == WIFI_DIRECT_ERROR_NONE)......... // discovery cancel request is successful
980 ******************************************************************************/
981 int wifi_direct_cancel_discovery(void);
985 * discorverd peers notification callback function type. \n
987 * @param peer The discovered peer information.
988 * @param user_data The user data passed from the foreach function.
989 * @return @c true to continue with the next iteration of the loop,
990 * \n @c false to break out of the loop.
992 * @pre wifi_direct_foreach_discovered_peers() will invoke this function.
994 * @see wifi_direct_foreach_discovered_peers()
997 typedef bool(*wifi_direct_discovered_peer_cb) (wifi_direct_discovered_peer_info_s * peer, void *user_data);
1000 /*****************************************************************************************/
1001 /* wifi_direct_foreach_discovered_peers API function prototype
1002 * int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb, void* user_data)
1005 * \brief This API shall get the information of all discovered peers. \n
1007 * @param callback The callback function to invoke.
1008 * @param user_data The user data passed from the foreach function.
1010 * \see wifi_direct_discovered_peer_cb
1012 * \par Sync (or) Async:
1013 * This is a Synchronous API.
1018 * \return Return Type (int) \n
1019 * - WIFI_DIRECT_ERROR_NONE on success \n
1020 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1021 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1022 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1023 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1024 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1025 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1026 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1029 * \par Prospective Clients:
1034 * #include <wifi-direct.h>
1036 * bool _cb_discovered_peers_impl(wifi_direct_discovered_peer_info_s* peer, void* user_data)
1038 * struct appdata* ad = (struct appdata*) user_data;
1042 * if ( ad->peer_count >= MAX_PEER_NUM )
1043 * return false; // break out of the loop
1045 * memcpy(&ad->peer_list[ad->peer_count], peer, sizeof(wifi_direct_discovered_peer_info_s));
1049 * return true; // continue with the next iteration of the loop
1057 * ad->peer_list = NULL;
1058 * ad->peer_count = 0;
1059 * ad ->selected_peer_index = 0;
1060 * result = wifi_direct_foreach_discovered_peers(_cb_discovered_peers_impl, (void*)ad);
1062 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1068 ******************************************************************************/
1069 int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb
1070 callback, void *user_data);
1073 /*****************************************************************************************/
1074 /* wifi_direct_connect API function prototype
1075 * int wifi_direct_connect(const char* mac_address);
1078 * \brief This API shall connect to specified peer by automatically determining whether to perform group \n
1079 * formation, join an existing group, invite, re-invoke a group. The decision is \n
1080 * based on the current state of the peers (i.e. GO, STA, not connected) and the \n
1081 * availability of persistent data. \n
1083 * @param mac_addr Device address of target peer.
1085 * \par Sync (or) Async:
1086 * This is a Asynchronous API.
1092 * \par Async Response Message:
1093 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
1094 * via callback when the connection process is started.
1095 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
1096 * via callback when the connection process is completed or failed.
1098 * \return Return Type (int) \n
1099 * - WIFI_DIRECT_ERROR_NONE on success \n
1100 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1101 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1102 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1103 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1104 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1105 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1106 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
1107 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1108 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1109 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1112 * \par Prospective Clients:
1117 * #include <wifi-direct.h>
1119 * void foo(unsigned char* mac_addr)
1124 * result = wifi_direct_connect(mac_addr);
1126 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
1130 *\remarks This API will try to send provisioning request befre connecting.
1132 ******************************************************************************/
1133 int wifi_direct_connect(const char *mac_address);
1136 /*****************************************************************************************/
1137 /* wifi_direct_disconnect_all API function prototype
1138 * int wifi_direct_disconnect_all(void);
1141 * \brief This API shall tear down all connected links to peers (stop soft AP, and close interface). \n
1143 * \see wifi_direct_connect
1145 * \par Sync (or) Async:
1146 * This is a Asynchronous API.
1152 * \par Async Response Message:
1153 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive this event
1154 * via callback when the disconnection process is completed.
1157 * \return Return Type (int) \n
1158 * - WIFI_DIRECT_ERROR_NONE on success \n
1159 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1160 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1161 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1162 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1163 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1164 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1167 * \par Prospective Clients:
1172 * #include <wifi-direct.h>
1179 * result = wifi_direct_disconnect_all();
1181 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1187 ******************************************************************************/
1188 int wifi_direct_disconnect_all(void);
1192 /*****************************************************************************************/
1193 /* wifi_direct_disconnect API function prototype
1194 * int wifi_direct_disconnect(const char* mac_address);
1197 * \brief This API shall disconnect the specified peer by mac address.
1199 * @param mac_addr Device address of target peer.
1203 * \par Sync (or) Async:
1204 * This is a Asynchronous API.
1210 * \par Async Response Message:
1211 * - WIFI_DIRECT_DISCONNECTION_RSP : Applications will receive a this event
1212 * via callback when a peer is disconnected.
1214 * \return Return Type (int) \n
1215 * - WIFI_DIRECT_ERROR_NONE on success \n
1216 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1217 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1218 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1219 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1220 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1221 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1222 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1225 * \par Prospective Clients:
1230 * #include <wifi-direct.h>
1232 * void foo(unsigned char* mac_addr)
1237 * result = wifi_direct_disconnect(mac_addr);
1239 * if(result == WIFI_DIRECT_ERROR_NONE)......... // disconnect request is successful
1245 ******************************************************************************/
1246 int wifi_direct_disconnect(const char *mac_address);
1251 * connected peers notification callback function type. \n
1253 * @param peer The connected peer information.
1254 * @param user_data The user data passed from the foreach function.
1255 * @return @c true to continue with the next iteration of the loop,
1256 * \n @c false to break out of the loop.
1258 * @pre wifi_direct_foreach_connected_peers() will invoke this function.
1260 * @see wifi_direct_foreach_connected_peers()
1263 typedef bool(*wifi_direct_connected_peer_cb) (wifi_direct_connected_peer_info_s
1264 * peer, void *user_data);
1267 /*****************************************************************************************/
1268 /* wifi_direct_foreach_connected_peers API function prototype
1269 * int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb, void* user_data)
1272 * \brief This API shall get the information of all connected peers. \n
1274 * @param callback The callback function to invoke.
1275 * @param user_data The user data passed from the foreach function.
1277 * \see wifi_direct_connected_peer_cb
1279 * \par Sync (or) Async:
1280 * This is a Synchronous API.
1285 * \return Return Type (int) \n
1286 * - WIFI_DIRECT_ERROR_NONE on success \n
1287 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1288 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1289 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1290 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1291 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1292 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1293 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1295 * \par Prospective Clients:
1300 * #include <wifi-direct.h>
1302 * bool _cb_connected_peers_impl(wifi_direct_connected_peer_info_s* peer, void* user_data)
1305 * struct appdata* ad = (struct appdata*) user_data;
1309 * if ( ad->connected_peer_count >= MAX_PEER_NUM )
1310 * return false; // break out of the loop
1312 * memcpy(&ad->connected_peer_list[ad->connected_peer_count], peer, sizeof(wifi_direct_connected_peer_info_s));
1313 * ad->connected_peer_count++;
1317 * return true; // continue with the next iteration of the loop
1324 * ad->connected_peer_list = NULL;
1325 * ad->connected_peer_count = 0;
1327 * result = wifi_direct_foreach_connected_peers(_cb_connected_peers_impl, (void*)ad);
1329 * if(result == WIFI_DIRECT_ERROR_NONE)......... // get discovery result is successful
1335 ******************************************************************************/
1336 int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb
1337 callback, void *user_data);
1341 /*****************************************************************************************/
1342 /* wifi_direct_create_group API function prototype
1343 * int wifi_direct_create_group();
1346 * \brief This API shall set up device as a Group Owner and wait for clients to connect. \n
1347 * Create a soft AP, start the WPS registrar, start the DHCP server. \n
1349 * \see wifi_direct_destroy_group
1351 * \par Sync (or) Async:
1352 * This is a Asynchronous API.
1358 * \par Async Response Message:
1359 * - WIFI_DIRECT_GROUP_CREATED : Applications will receive this event
1360 * via callback when the group creating request is successful. \n
1361 * Errorcode will be set to the WFD_ERROR_CREATE_LINK_FAIL value. \n
1363 * \return Return Type (int) \n
1364 * - WIFI_DIRECT_ERROR_NONE on success \n
1365 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1366 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1367 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1368 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1369 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1370 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1371 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1372 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1375 * \par Prospective Clients:
1380 * #include <wifi-direct.h>
1387 * result = wifi_direct_create_group();
1389 * if(result == WIFI_DIRECT_ERROR_NONE)......... // create group request is successful
1395 ******************************************************************************/
1396 int wifi_direct_create_group(void);
1400 /*****************************************************************************************/
1401 /* wifi_direct_destroy_group API function prototype
1402 * int wifi_direct_destroy_group();
1405 * \brief This API shall cancel P2P Group create or tear down a P2P Group that we own. \n
1407 * \see wifi_direct_create_group
1409 * \par Sync (or) Async:
1410 * This is a Asynchronous API.
1416 * \par Async Response Message:
1417 * - WIFI_DIRECT_GROUP_DESTROYED : Applications will receive this event via callback when the group is cancelled. \n
1419 * \return Return Type (int) \n
1420 * - WIFI_DIRECT_ERROR_NONE on success \n
1421 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1422 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1423 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1424 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1425 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1426 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1427 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1428 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1431 * \par Prospective Clients:
1436 * #include <wifi-direct.h>
1443 * result = wifi_direct_destroy_group();
1445 * if(result == WIFI_DIRECT_ERROR_NONE)......... // cancel group request is successful
1451 ******************************************************************************/
1452 int wifi_direct_destroy_group(void);
1455 /*****************************************************************************************/
1456 /* wifi_direct_is_group_owner API function prototype
1457 * int wifi_direct_is_group_owner(bool *owner);
1460 * \brief This API shall check whether the currunt client is group owner or not.
1461 * @param owner Memory to store the value of TURE or FALSE. Application must allocate memory.
1463 * \see wifi_direct_create_group
1465 * \par Sync (or) Async:
1466 * This is a Synchronous API.
1471 * \return Return Type (int) \n
1472 * - WIFI_DIRECT_ERROR_NONE on success \n
1473 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1474 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1475 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1476 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1477 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1478 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1479 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1481 * \par Prospective Clients:
1486 * #include <wifi-direct.h>
1494 * result = wifi_direct_is_group_owner(&owner);
1497 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1503 ******************************************************************************/
1504 int wifi_direct_is_group_owner(bool * is_group_owner);
1508 /*****************************************************************************************/
1509 /* wifi_direct_is_autonomous_group API function prototype
1510 * int wifi_direct_is_autonomous_group(bool *autonomous_group);
1513 * \brief This API shall check whether the currunt group is autonomous group or not.
1514 * @param autonomous_group Memory to store the value of TURE or FALSE. Application must allocate memory.
1516 * \see wifi_direct_create_group
1518 * \par Sync (or) Async:
1519 * This is a Synchronous API.
1524 * \return Return Type (int) \n
1525 * - WIFI_DIRECT_ERROR_NONE on success \n
1526 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1527 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1528 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1529 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1530 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1531 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1532 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1534 * \par Prospective Clients:
1539 * #include <wifi-direct.h>
1545 * bool autonomous_group;
1547 * result = wifi_direct_is_autonomous_group(&autonomous_group);
1550 * if(result == WIFI_DIRECT_ERROR_NONE)......... // checking the value is successful
1556 ******************************************************************************/
1557 int wifi_direct_is_autonomous_group(bool * is_autonomous_group);
1562 /*****************************************************************************************/
1563 /* wifi_direct_set_ssid API function prototype
1564 * int wifi_direct_set_ssid(const char* ssid);
1567 * \brief This API shall set or update ssid of local device. \n
1568 * @param ssid new ssid to set. Application must set the new ssid before.
1570 * \see wifi_direct_get_ssid
1572 * \par Sync (or) Async:
1573 * This is a Synchronous API.
1579 * \return Return Type (int) \n
1580 * - WIFI_DIRECT_ERROR_NONE on success \n
1581 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1582 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1583 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1584 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1585 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1586 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1587 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1590 * \par Prospective Clients:
1595 * #include <wifi-direct.h>
1600 * char ssid[11] = {0,};
1602 * memset(pin, 0x00, sizeof(pin));
1603 * printf("Input 8 digit PIN number :\n");
1606 *if( strlen(ssid) > 0 )
1607 * result = wifi_direct_set_ssid(ssid);
1609 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting ssid is successful
1613 *\remarks When the wifi direct is re-activated, ssid will be reset to the device name. \n
1616 ******************************************************************************/
1617 int wifi_direct_set_ssid(const char *ssid);
1620 /*****************************************************************************************/
1621 /* wifi_direct_get_ssid API function prototype
1622 * int wifi_direct_get_ssid(char** ssid)
1625 * \brief This API shall get ssid of local device. \n
1626 * @param ssid Pointer to store ssid. Application must free this memory.
1628 * \par Sync (or) Async:
1629 * This is a Synchronous API.
1635 * \return Return Type (int) \n
1636 * - WIFI_DIRECT_ERROR_NONE on success \n
1637 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1638 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1639 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1640 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1641 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1642 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1643 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1646 * \par Prospective Clients:
1651 * #include <wifi-direct.h>
1656 * char* ssid = NULL;
1658 * result = wifi_direct_get_ssid(&ssid);
1660 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting ssid is successful
1662 * free(ssid); // Application should free the memory.
1669 ******************************************************************************/
1670 int wifi_direct_get_ssid(char **ssid);
1673 /*****************************************************************************************/
1674 /* wifi_direct_get_ip_address API function prototype
1675 * int wifi_direct_get_ip_address(char** ip_address)
1678 * \brief This API shall get IP address of local device interface. \n
1679 * @param ip_addr Pointer to store ip address. Application must free this memory.
1681 * \par Sync (or) Async:
1682 * This is a Synchronous API.
1688 * \return Return Type (int) \n
1689 * - WIFI_DIRECT_ERROR_NONE on success \n
1690 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1691 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1692 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1693 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1694 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1695 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1696 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1699 * \par Prospective Clients:
1704 * #include <wifi-direct.h>
1711 * result = wifi_direct_get_ip_address(&ip);
1713 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting IP is successful
1715 * free(ip); // Application should free the memory.
1721 ******************************************************************************/
1722 int wifi_direct_get_ip_address(char **ip_address);
1725 /*****************************************************************************************/
1726 /* wifi_direct_get_mac_addr API function prototype
1727 * int wifi_direct_get_mac_address(char **mac_address)
1730 * \brief This API shall get device MAC address of local device.\n
1731 * @param mac_addr Pointer to store MAC address. Application must free this memory.
1733 * \par Sync (or) Async:
1734 * This is a Synchronous API.
1740 * \return Return Type (int) \n
1741 * - WIFI_DIRECT_ERROR_NONE on success \n
1742 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1743 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1744 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1745 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1746 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1747 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1748 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1751 * \par Prospective Clients:
1756 * #include <wifi-direct.h>
1761 * char* mac_addr =NULL;
1763 * result = wifi_direct_get_mac_addr(&mac_addr);
1765 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting device MAC is successful
1771 ******************************************************************************/
1772 int wifi_direct_get_mac_address(char **mac_address);
1775 /*****************************************************************************************/
1776 /* wifi_direct_get_state API function prototype
1777 * int wifi_direct_get_state(wifi_direct_state_e * status);
1780 * \brief This API shall get current Wi-Fi direct link status. \n
1781 * @param status Memory to store link status information. Application must allocate memory.
1783 * \see wifi_direct_state_e
1785 * \par Sync (or) Async:
1786 * This is a Synchronous API.
1792 * \return Return Type (int) \n
1793 * - WIFI_DIRECT_ERROR_NONE on success \n
1794 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1795 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1796 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1797 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1798 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1799 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1800 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1803 * \par Prospective Clients:
1808 * #include <wifi-direct.h>
1813 * wifi_direct_state_e status;
1815 * result = wifi_direct_get_state(&status);
1817 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting link status is successful
1823 ******************************************************************************/
1824 int wifi_direct_get_state(wifi_direct_state_e * state);
1827 /*****************************************************************************************/
1828 /* wifi_direct_accept_connection API function prototype
1829 * int wifi_direct_accept_connection(char* mac_address);
1832 * \brief This API shall accept connection request from specified peer. \n
1833 * This API shall be used to respond the connection request event, WIFI_DIRECT_CONNECTION_REQ.
1835 * @param mac_addr Device address of target peer.
1837 * \see wifi_direct_connect
1839 * \par Sync (or) Async:
1840 * This is a Asynchronous API.
1845 * \par Async Response Message:
1846 * - WIFI_DIRECT_CONNECTION_IN_PROGRESS : Applications will receive this event
1847 * via callback when the connection process is started.
1848 * - WIFI_DIRECT_CONNECTION_RSP : Applications will receive this event
1849 * via callback when the connection process is completed or failed.
1851 * \return Return Type (int) \n
1852 * - WIFI_DIRECT_ERROR_NONE on success \n
1853 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1854 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1855 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1856 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1857 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1858 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1859 * - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for "Connection timed out" \n
1860 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1861 * - WIFI_DIRECT_ERROR_CONNECTION_FAILED for "Create Link fail" \n
1862 * - WIFI_DIRECT_ERROR_AUTH_FAILED for "Create Link Auth fail" \n
1865 * \par Prospective Clients:
1870 * #include <wifi-direct.h>
1872 * void foo(unsigned char* mac_addr)
1876 * result = wifi_direct_accept_connection(mac_addr);
1878 * if(result == WIFI_DIRECT_ERROR_NONE)......... // connect request is successful
1882 *\remarks This API will not try to send provisioning request.
1884 ******************************************************************************/
1885 int wifi_direct_accept_connection(char *mac_address);
1888 /*****************************************************************************************/
1889 /* wifi_direct_get_go_intent API function prototype
1890 * int wifi_direct_get_go_intent(int * intent);
1893 * \brief This API shall get GO intent value. \n
1894 * @param * intent variable to store intent value. Application must allocate memory.
1896 * \par Sync (or) Async:
1897 * This is a Synchronous API.
1903 * \return Return Type (int) \n
1904 * - WIFI_DIRECT_ERROR_NONE on success \n
1905 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1906 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1907 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1908 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1909 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1910 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1911 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1913 * \par Prospective Clients:
1918 * #include <wifi-direct.h>
1925 * result = wifi_direct_get_go_intent(&go_intent);
1927 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting GO intent is successful
1933 ******************************************************************************/
1934 int wifi_direct_get_go_intent(int *intent);
1938 /*****************************************************************************************/
1939 /* wifi_direct_set_wpa_passphrase API function prototype
1940 * int wifi_direct_set_wpa_passphrase(char* passphrase)
1943 * \brief This API shall set or update wpa password. If a client create Group (Soft AP), this password will be used. \n
1944 * @param passphrase new wpa password to set. Application must set the new password before.
1947 * \par Sync (or) Async:
1948 * This is a Synchronous API.
1954 * \return Return Type (int) \n
1955 * - WIFI_DIRECT_ERROR_NONE on success \n
1956 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
1957 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
1958 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
1959 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
1960 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
1961 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
1962 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
1964 * \par Prospective Clients:
1969 * #include <wifi-direct.h>
1974 * char new_wpa[64+1] = {0,};
1976 * printf("Input new WPA:\n");
1977 * scanf("%s",new_wpa);
1979 *if( strlen(new_wpa) > 0 )
1980 * result = wifi_direct_set_wpa_passphrase(new_wpa);
1982 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting password is successful
1988 ******************************************************************************/
1989 int wifi_direct_set_wpa_passphrase(char *passphrase);
1992 /*****************************************************************************************/
1993 /* wifi_direct_activate_pushbutton API function prototype
1994 * int wifi_direct_activate_pushbutton(void);
1997 * \brief This API shall start wps PBC.
1999 * \pre Device must support the pbc button mode.
2001 * \see wifi_direct_get_supported_wps_mode
2003 * \par Sync (or) Async:
2004 * This is a Synchronous API.
2009 * \return Return Type (int) \n
2010 * - WIFI_DIRECT_ERROR_NONE on success \n
2011 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2012 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2013 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2014 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2015 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2016 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2018 * \par Prospective Clients:
2023 * #include <wifi-direct.h>
2030 * result = wifi_direct_activate_pushbutton();
2032 * if(result == WIFI_DIRECT_ERROR_NONE)......... // activating push button is successful
2038 ******************************************************************************/
2039 int wifi_direct_activate_pushbutton(void);
2042 /*****************************************************************************************/
2043 /* wifi_direct_set_wps_pin API function prototype
2044 * int wifi_direct_set_wps_pin(char* pin)
2047 * \brief This API shall set or update the WPS PIN number user expects. \n
2048 * @param pin new pin to set. Application must set the new pin number before.
2050 * \see wifi_direct_generate_wps_pin.
2051 * \see wifi_direct_get_wps_pin
2053 * \par Sync (or) Async:
2054 * This is a Synchronous API.
2060 * \return Return Type (int) \n
2061 * - WIFI_DIRECT_ERROR_NONE on success \n
2062 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2063 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2064 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2065 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2066 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2067 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2068 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2071 * \par Prospective Clients:
2076 * #include <wifi-direct.h>
2081 * char pin[WIFI_DIRECT_WPS_PIN_LEN+1]= { 0, };
2083 * memset(pin, 0x00, sizeof(pin));
2084 * printf("Input 8 digit PIN number :\n");
2087 *if( strlen(pin) > 0 )
2088 * result = wifi_direct_set_wps_pin(pin);
2090 * if(result == WIFI_DIRECT_ERROR_NONE)......... // setting wps pin number is successful
2096 ******************************************************************************/
2097 int wifi_direct_set_wps_pin(char *pin);
2100 /*****************************************************************************************/
2101 /* wifi_direct_get_wps_pin API function prototype
2102 * int wifi_direct_get_wps_pin(char** pin)
2105 * \brief This API shall get the WPS PIN number. \n
2106 * @param pin Pointer to store pin number. Application must free this memory.
2108 * \see wifi_direct_set_wps_pin
2110 * \par Sync (or) Async:
2111 * This is a Synchronous API.
2117 * \return Return Type (int) \n
2118 * - WIFI_DIRECT_ERROR_NONE on success \n
2119 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2120 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2121 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2122 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2123 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2124 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2125 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2128 * \par Prospective Clients:
2133 * #include <wifi-direct.h>
2140 * result = wifi_direct_get_wps_pin(&pin);
2142 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting wps pin number is successful
2144 * free(pin); // Application should free the memory.
2150 ******************************************************************************/
2151 int wifi_direct_get_wps_pin(char **pin);
2154 /*****************************************************************************************/
2155 /* wifi_direct_generate_wps_pin API function prototype
2156 * wifi_direct_generate_wps_pin(void);
2159 * \brief This API shall generate the random WPS PIN number.\n
2160 * To get the generated PIN number, use wifi_direct_get_wps_pin() API.
2162 * \see wifi_direct_set_wps_pin
2163 * \see wifi_direct_get_wps_pin
2165 * \par Sync (or) Async:
2166 * This is a Synchronous API.
2172 * \return Return Type (int) \n
2173 * - WIFI_DIRECT_ERROR_NONE on success \n
2174 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2175 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2176 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2177 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2178 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2179 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2182 * \par Prospective Clients:
2187 * #include <wifi-direct.h>
2193 * result = wifi_direct_generate_wps_pin();
2195 * if(result == WIFI_DIRECT_ERROR_NONE)......... // generating wps pin number is successful
2201 ******************************************************************************/
2202 int wifi_direct_generate_wps_pin(void);
2205 /*****************************************************************************************/
2206 /* wifi_direct_get_supported_wps_mode API function prototype
2207 * int wifi_direct_get_supported_wps_mode(int *wps_mode);
2210 * \brief This API shall get the supported wps mode. \n
2211 * The result is bit flag.
2213 * @param wps_mode Memory to store supported wps mode. Application must allocate memory.
2215 * \see wifi_direct_wps_cfg_e
2217 * \par Sync (or) Async:
2218 * This is a Synchronous API.
2224 * \return Return Type (int) \n
2225 * - WIFI_DIRECT_ERROR_NONE on success \n
2226 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2227 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2228 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2229 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2230 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2231 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2232 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2235 * \par Prospective Clients:
2240 * #include <wifi-direct.h>
2245 * int supported_wps_mode = 0;
2247 * result = wifi_direct_get_supported_wps_mode(&supported_wps_mode);
2249 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting supported wps mode is successful
2255 ******************************************************************************/
2256 int wifi_direct_get_supported_wps_mode(int *wps_mode);
2259 /*****************************************************************************************/
2260 /* wifi_direct_get_config_data API function prototype
2261 * int wifi_direct_get_config_data(wifi_direct_config_data_s** config)
2264 * \brief This API shall get Wi-Fi direct configuration data. \n
2265 * @param config Pointer to store configuration information. Application must free this memory.
2267 * \see wifi_direct_set_config_data
2269 * \par Sync (or) Async:
2270 * This is a Synchronous API.
2276 * \return Return Type (int) \n
2277 * - WIFI_DIRECT_ERROR_NONE on success \n
2278 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2279 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2280 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2281 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2282 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2283 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2284 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2287 * \par Prospective Clients:
2292 * #include <wifi-direct.h>
2297 * wifi_direct_config_data_s* config;
2299 * result = wifi_direct_get_config_data(&config);
2301 * if(result == WIFI_DIRECT_ERROR_NONE)......... // getting config data is successful
2307 ******************************************************************************/
2308 int wifi_direct_get_config_data(wifi_direct_config_data_s ** config);
2311 /*****************************************************************************************/
2312 /* wifi_direct_set_config_data API function prototype
2313 * int wifi_direct_set_config_data(wifi_direct_config_data_s* config);
2316 * \brief This API shall set or update Wi-Fi direct configuration data. \n
2317 * @param config Wi-Fi configuration data to be set
2319 * \see wifi_direct_get_config_data
2321 * \par Sync (or) Async:
2322 * This is a Synchronous API.
2327 * \return Return Type (int) \n
2328 * - WIFI_DIRECT_ERROR_NONE on success \n
2329 * - WIFI_DIRECT_ERROR_OPERATION_FAILED for "Unkown error" \n
2330 * - WIFI_DIRECT_ERROR_OUT_OF_MEMORY for "Out of memory" \n
2331 * - WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for "I/O error" \n
2332 * - WIFI_DIRECT_ERROR_NOT_PERMITTED for "Operation not permitted" \n
2333 * - WIFI_DIRECT_ERROR_INVALID_PARAMETER for "Invalid function parameter" \n
2334 * - WIFI_DIRECT_ERROR_RESOURCE_BUSY for "Device or resource busy" \n
2335 * - WIFI_DIRECT_ERROR_STRANGE_CLIENT for "Invalid Client" \n
2338 * \par Prospective Clients:
2343 * #include <wifi-direct.h>
2348 * wifi_direct_config_data_s* config;
2350 * result = wifi_direct_get_config_data(&config);
2352 * if(result != WIFI_DIRECT_ERROR_NONE)......... // Getting configuration data is not successful
2358 * config->group_owner_intent = 8;
2359 * config->wps_config = WIFI_DIRECT_WPS_PUSHBUTTON;
2360 * config->want_persistent_group = false;
2361 * config->hide_SSID = false;
2362 * strncpy(config->ssid, "My WiFi Direct", WIFI_DIRECT_MAX_SSID_LEN);
2364 * result = wifi_direct_set_config_data(config);
2365 * if(result == WIFI_DIRECT_ERROR_NONE)......... // Setting configuration data is successful
2374 ******************************************************************************/
2375 int wifi_direct_set_config_data(wifi_direct_config_data_s * config);
2386 #endif //__WIFI_DIRECT_INTERFACE_H_