merge with master
[framework/osp/net.git] / inc / FNetWifiWifiDirectDevice.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FNetWifiWifiDirectDevice.h
19  * @brief       This is the header file for the %WifiDirectDevice class.
20  *
21  * This header file contains the declarations of the %WifiDirectDevice class.
22  */
23 #ifndef _FNET_WIFI_WIFI_DIRECT_DEVICE_H_
24 #define _FNET_WIFI_WIFI_DIRECT_DEVICE_H_
25
26 #include <FBaseObject.h>
27 #include <FNetWifiWifiTypes.h>
28
29
30 namespace Tizen { namespace Base { namespace Collection
31 {
32 class IList;
33 }}}
34
35 namespace Tizen { namespace Net { namespace Wifi
36 {
37 class _WifiDirectDeviceImpl;
38 class IWifiDirectDeviceListener;
39 class IWifiDirectGroupOwnerListener;
40 class IWifiDirectGroupClientListener;
41 class WifiDirectGroupInfo;
42 class WifiDirectDeviceInfo;
43 class WifiDirectGroupMember;
44
45 /**
46  * @class   WifiDirectDevice
47  * @brief   This class provides methods for the Wi-Fi Direct device.
48  *
49  * @since   2.0
50  *
51  * The %WifiDirectDevice class provides methods to manage the Wi-Fi Direct device, create a Wi-Fi Direct group,
52  * scan Wi-Fi Direct devices, associate a Wi-Fi Direct group owner, create a WifiDirectGroupMember instance,
53  * and allow the listener to get events related to a Wi-Fi Direct device and group.
54  *
55  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/wi-fi_direct_connectivity.htm">Wi-Fi Direct Connectivity</a>.
56  */
57
58 class _OSP_EXPORT_ WifiDirectDevice
59         : public Tizen::Base::Object
60 {
61 public:
62     /**
63      *
64      * This destructor overrides Tizen::Base::Object::~Object().
65      *
66      * @since   2.0
67      */
68     virtual ~WifiDirectDevice(void);
69
70     /**
71      * Adds a listener for Wi-Fi Direct device.
72      *
73      * @since   2.0
74      *
75      * @return      An error code
76      * @param[in]   listener        A reference to the listener instance
77      * @exception   E_SUCCESS       The method is successful.
78      * @exception   E_SYSTEM        A system error has occurred.
79      * @exception   E_OUT_OF_MEMORY The memory is insufficient.
80      * @exception   E_OBJ_ALREADY_EXIST The listener is already added.
81      */
82     result AddWifiDirectDeviceListener(IWifiDirectDeviceListener& listener);
83
84     /**
85      * @if OSPDEPREC
86      * Adds a listener for the Wi-Fi Direct group owner.
87      *
88      * @brief   <i> [Deprecated] </i>
89      * @deprecated  %WifiDirectGroupOwner class is deprecated, therefore, this method also is deprecated. @n
90          *       Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group owner, group client, and so on) and so it was necessary to use these APIs. @n
91          * Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
92
93      *
94      * @since 2.0
95      *
96      * @return      An error code
97      * @param[in]   listener        A reference to the IWifiDirectGroupOwnerListener instance
98      * @exception   E_SUCCESS       The method is successful.
99      * @exception   E_SYSTEM        A system error has occurred.
100      * @exception   E_OUT_OF_MEMORY The memory is insufficient.
101      * @exception   E_OBJ_ALREADY_EXIST The listener is already added.
102      * @endif
103      */
104     result AddWifiDirectGroupOwnerListener(IWifiDirectGroupOwnerListener& listener);
105
106     /**
107      * @if OSPDEPREC
108      * Adds a listener for the Wi-Fi Direct group client.
109      *
110      * @brief   <i> [Deprecated] </i>
111      * @deprecated  %WifiDirectGroupClient class is deprecated, therefore, this method also is deprecated. @n
112          * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group owner, group client, and so on) and so it was necessary to use these APIs. @n
113          * Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
114      *
115      * @since 2.0
116      *
117      * @return      An error code
118      * @param[in]   listener        A reference to the IWifiDirectGroupClientListener instance
119      * @exception   E_SUCCESS       The method is successful.
120      * @exception   E_SYSTEM        A system error has occurred.
121      * @exception   E_OUT_OF_MEMORY The memory is insufficient.
122      * @exception   E_OBJ_ALREADY_EXIST The listener is already added.
123      * @endif
124      */
125     result AddWifiDirectGroupClientListener(IWifiDirectGroupClientListener& listener);
126
127     /**
128      * Removes a listener for the Wi-Fi Direct device.
129      *
130      * @since 2.0
131      *
132      * @return      An error code
133      * @param[in]   listener        A reference to the IWifiDirectDeviceListener instance
134      * @exception   E_SUCCESS       The method is successful.
135      * @exception   E_SYSTEM        A system error has occurred.
136      * @exception   E_OBJ_NOT_FOUND The specified object is not found within the indicated range.
137      */
138     result RemoveWifiDirectDeviceListener(IWifiDirectDeviceListener& listener);
139
140     /**
141      * @if OSPDEPREC
142      * Removes a listener for the Wi-Fi Direct group owner.
143      *
144      * @brief   <i> [Deprecated] </i>
145      * @deprecated  %WifiDirectGroupOwner class is deprecated, therefore, this method also is deprecated. @n
146      *               Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group owner, group client, and so on) and so it was necessary to use these APIs. @n
147          * Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
148      * @since 2.0
149      *
150      * @return      An error code
151      * @param[in]   listener        A reference to the IWifiDirectGroupOwnerListener instance
152      * @exception   E_SUCCESS       The method is successful.
153      * @exception   E_SYSTEM        A system error has occurred.
154      * @exception   E_OBJ_NOT_FOUND The specified object is not found within the indicated range.
155      * @endif
156      */
157     result RemoveWifiDirectGroupOwnerListener(IWifiDirectGroupOwnerListener& listener);
158
159     /**
160      * @if OSPDEPREC
161      * Removes a listener for the Wi-Fi Direct group client.
162      *
163      * @brief   <i> [Deprecated] </i>
164      * @deprecated  %WifiDirectGroupClient class is deprecated, therefore, this method also is deprecated. @n
165      * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group owner, group client, and so on) and so it was necessary to use these APIs. @n
166          * Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
167      *
168          * @since 2.0
169      *
170      * @return      An error code
171      * @param[in]   listener        A reference to the IWifiDirectGroupClientListener instance
172      * @exception   E_SUCCESS       The method is successful.
173      * @exception   E_SYSTEM        A system error has occurred.
174      * @exception   E_OBJ_NOT_FOUND The specified object is not found within the indicated range.
175      * @endif
176      */
177     result RemoveWifiDirectGroupClientListener(IWifiDirectGroupClientListener& listener);
178
179     /**
180      * Activates the local Wi-Fi device by using the Wi-Fi Direct enabled.
181      *
182      * @since   2.0
183      * @privlevel   public
184      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
185      *
186      * @return  An error code
187      * @exception   E_SUCCESS           The activation is successful.
188      * @exception   E_SYSTEM            A system error has occurred.
189      * @exception   E_IN_PROGRESS       The activate process is in progress.
190      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
191      *                                  For example, the Wi-Fi Direct device is already activated.
192      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
193      * @see IWifiDirectDeviceListener::OnWifiDirectDeviceActivated()
194      */
195     result Activate(void);
196
197     /**
198      * Checks whether the local device is activated.
199      *
200      * @since 2.0
201      *
202      * @return  @c true if the local device is activated, @n
203      *          else @c false
204      * @exception   E_SUCCESS       The hidden mode is set successfully.
205      * @exception   E_SYSTEM        A system error has occurred.
206      */
207     bool IsActivated(void) const;
208
209     /**
210      * Deactivates the local Wi-Fi device.
211      *
212      * @since 2.0
213      * @privlevel   public
214      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
215      *
216      * @return  An error code
217      * @exception   E_SUCCESS           The deactivation is successful.
218      * @exception   E_SYSTEM            A system error has occurred.
219      * @exception   E_IN_PROGRESS       The deactivate process is in progress.
220      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
221      *                                  For example, the Wi-Fi Direct device is already deactivated.
222      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
223      *
224      * @see IWifiDirectDeviceListener::OnWifiDirectDeviceDeactivated()
225      */
226     result Deactivate(void);
227
228     /**
229      * Gets the current setting information of a Wi-Fi Direct group.
230      *
231      * @since 2.0
232      *
233      * @return      The Wi-Fi Direct group information if successful, @n
234      *              else @c null
235      * @exception   E_SUCCESS           The method is successful.
236      * @exception   E_SYSTEM            A system error has occurred.
237      * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
238      * @remarks     The specific error code can be accessed using the GetLastResult() method.
239      */
240     WifiDirectGroupInfo* GetGroupSettingInfoN(void) const;
241
242     /**
243      * Gets the current setting information of a Wi-Fi Direct device.
244      *
245      * @since 2.0
246      *
247      * @return      The Wi-Fi Direct device information if successful, @n
248      *              else @c null
249      * @exception   E_SUCCESS       The method is successful.
250      * @exception   E_SYSTEM        A system error has occurred.
251      * @exception   E_OUT_OF_MEMORY The memory is insufficient.
252      * @remarks     The specific error code can be accessed using the GetLastResult() method.
253      */
254     WifiDirectDeviceInfo* GetLocalDeviceInfoN(void) const;
255
256     /**
257      * Gets the preferred method for the Wi-Fi Protected Setup (WPS) configuration.
258      *
259      * @since 2.0
260      *
261      * @return      The preferred configuration mode for WPS
262      * @exception   E_SUCCESS       The method is successful.
263      * @exception   E_SYSTEM        A system error has occurred.
264      * @remarks     The specific error code can be accessed using the GetLastResult() method.
265      *              @c WIFI_WPS_CONFIG_MODE_NONE will be returned in case of the E_SYSTEM exception.
266      */
267     WifiWpsConfigurationMode GetWpsConfigurationModePreference(void) const;
268
269     /**
270      * Sets the name of a local device.
271      *
272      * @since 2.0
273      *
274      * @return      An error code
275      * @param[in]   name                The name for a local device
276      * @exception   E_SUCCESS           The method is successful.
277      * @exception   E_SYSTEM            A system error has occurred.
278      * @exception   E_INVALID_ARG       The specified device name is an empty string.
279      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
280      *                                  For example, the Wi-Fi Direct device is already activated.
281      * @remarks     This method does not affect the system setting and the device name is only valid during the
282      *              group lifetime. @n
283      *              When an application in the deactivated state calls this method, the peer devices
284      *              detect the device specified in the @c name parameter.
285      *              For example, use this method before using Activate(). @n
286      *              The specified device name is automatically truncated if its size is greater than @c 64 bytes.
287      */
288     result SetLocalDeviceName(const Tizen::Base::String& name);
289
290     /**
291     * Sets the preferred method for the WPS configuration.
292     *
293     * @since 2.0
294     *
295     * @return           An error code
296     * @param[in] mode   The preferred mode for the WPS configuration
297     * @exception E_SUCCESS              The method is successful.
298     * @exception E_SYSTEM               A system error has occurred.
299     * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
300     *                                For example, the Wi-Fi Direct device is a group member.
301     * @remarks   The preferred configuration mode of the system is the PIN-DISPLAY method. @n
302     *            This method can change the preferred configuration method for the WPS procedure.
303     *            If the remote device does not support the specified configuration method,
304     *            the common configuration method is selected between the two devices automatically.
305     *            Therefore, this method does not guarantee the use of specified WPS configuration method. @n
306     *            Before calling Connect() method, the user preferred WPS configuration mode should be specified using the SetWpsConfigurationModePreference() method.
307     */
308     result SetWpsConfigurationModePreference(WifiWpsConfigurationMode mode);
309
310     /**
311      * @if OSPDEPREC
312      * Creates a Wi-Fi Direct group by negotiating with the specified Wi-Fi Direct device for the group owner.
313      *
314      * @brief   <i> [Deprecated] </i>
315      * @deprecated  This method is deprecated because the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role (for example, group owner, group client, and so on). @n
316      * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs.
317      *              Instead of using this API, use Connect() or CreateAutonomousGroup() API.
318      *
319      * @since 2.0
320      * @privlevel   public
321      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
322      *
323      * @return      An error code
324      * @param[in]   pWifiDirectGroupInfo        The pointer of a WiFiDirectGroupInfo
325      * @param[in]   pWifiDirectRemoteDeviceInfo The pointer of a WiFiDirectDeviceInfo
326      * @exception   E_SUCCESS           The method is successful.
327      * @exception   E_SYSTEM            A system error has occurred.
328      * @exception   E_IN_PROGRESS       A previous request is in progress.
329      * @exception   E_INVALID_ARG       The specified @c pWifiDirectRemoteDeviceInfo contains an invalid argument.
330      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
331      *                                  For example, the Wi-Fi Direct group is already created.
332      * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
333      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
334      * @remarks It is not mandatory for this method to contain values in both the parameters. @n
335      * If @c pWifiDirectGroupInfo is specified and the group is created with the specified group configuration information,
336      * this group configuration information is valid until the group is destroyed.
337      * If @c pWifiDirectGroupInfo is not specified, the Wi-Fi Direct group is created as per the default system configuration settings. @n
338      * If @c pWifiDirectRemoteDeviceInfo is not specified, the Wi-Fi Direct group is created with the
339      * first found device having the same local device name.
340      * Use SetLocalDeviceName() method to set the device name before activation. @n
341      * To obtain a list of Wi-Fi Direct devices which can be candidates for the @c pWifiDirectRemoteDeviceInfo
342      * parameter, use the Scan() method prior using this method.
343      * To connect a specified Wi-Fi Direct group owner directly, the Scan() and Associate() methods can be used. @n
344      * Before this method is called, the event listeners should be added in order to ensure the completion of
345      * group creation and to process the request as a group owner or client. @n
346      * If the autonomous group owner mode is set to @c true in the specified @c pWifiDirectGroupInfo parameter,
347      * @c pWifiDirectRemoteDeviceInfo should be set to @c null and IWifiDirectGroupClientListener would not be required.
348      * @see IWifiDirectDeviceListener::OnWifiDirectGroupCreatedN()
349      * @endif
350      */
351     result CreateGroup(const WifiDirectGroupInfo* pWifiDirectGroupInfo = null, const WifiDirectDeviceInfo* pWifiDirectRemoteDeviceInfo = null);
352
353     /**
354      * @if OSPDEPREC
355      * Cancels Wi-Fi Direct group creation.
356      *
357      * @brief   <i> [Deprecated] </i>
358      * @deprecated  This method is deprecated because the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role (for example, group owner, group client, and so on). @n
359      * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs. @n
360      *              Instead of using this API, use CancelConnect() API
361      *
362      * @since 2.0
363      * @privlevel   public
364      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
365      *
366      * @return      An error code
367      * @exception   E_SUCCESS           The method is successful.
368      * @exception   E_SYSTEM            A system error has occurred.
369      * @exception   E_IN_PROGRESS       A previous request is in progress.
370      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
371      *                                  For example, when there is no group being created.
372      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
373      * @see     CreateGroup()
374          * @see IWifiDirectDeviceListener::OnWifiDirectGroupCreatedN()
375          * @endif
376      */
377     result CancelGroupCreation(void);
378
379     /**
380      * Scans Wi-Fi Direct Devices which are in the specified type.
381      *
382      * @since 2.0
383      * @privlevel   public
384      * @privilege   http://tizen.org/privilege/wifi.wifidirect.read
385      *
386      * @return      An error code
387      * @exception   E_SUCCESS           The method is successful.
388      * @exception   E_SYSTEM            A system error has occurred.
389      * @exception   E_IN_PROGRESS       A previous request is in progress.
390      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
391      *                                  For example, the Wi-Fi Direct device is deactivated.
392      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
393      * @remarks     This operation does not work while the Wi-Fi connection to the AP is in progress or established.
394      * @see         IWifiDirectDeviceListener::OnWifiDirectScanCompletedN()
395      */
396     result Scan(void);
397
398     /**
399      * Cancels the Wi-Fi Direct previous scan operation.
400      *
401      * @since 2.0
402      * @privlevel   public
403      * @privilege   http://tizen.org/privilege/wifi.wifidirect.read
404      *
405      * @return      An error code
406      * @exception   E_SUCCESS           The method is successful.
407      * @exception   E_SYSTEM            A system error has occurred.
408      * @exception   E_IN_PROGRESS       A previous request is in progress.
409      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
410      *                                  For example, the scan operation is not in process.
411      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
412      * @see         IWifiDirectDeviceListener::OnWifiDirectScanCompletedN()
413      */
414     result CancelScan(void);
415
416     /**
417      * @if OSPDEPREC
418      * Establishes a connection with a specific group owner.
419      *
420      * @brief   <i> [Deprecated] </i>
421      * @deprecated  This method is deprecated because the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role (for example, group owner, group client, and so on). @n
422      * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs. @n
423      *              Instead of using this API, use Connect() API
424      *
425      * @since 2.0
426      * @privlevel    public
427      * @privilege    http://tizen.org/privilege/wifi.wifidirect.admin
428      *
429      * @return       An error code
430      * @param[in]    wifiDirectGroupOwnerDeviceInfo     The WifiDirectDeviceInfo value of a group owner
431      * @exception    E_SUCCESS           The method is successful.
432      * @exception    E_SYSTEM            A system error has occurred.
433      * @exception    E_IN_PROGRESS       A previous request or group creation is in progress.
434      * @exception    E_INVALID_ARG       The specified @c wifiDirectGroupOwnerDeviceInfo contains an invalid argument.
435      * @exception    E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
436      *                                   For example, the member type of a device is already a group owner or client.
437      * @exception    E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
438      * @remarks      If a connection is already established with other device, the previous connection should be disconnected
439      *               before using this method.
440      * @see          IWifiDirectDeviceListener::OnWifiDirectAssociationCompleted()
441      * @endif
442      */
443     result Associate(const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo);
444
445     /**
446      * @if OSPDEPREC
447      * Gets the Wi-Fi Direct member instance.
448      *
449      * @brief   <i> [Deprecated] </i>
450      * @deprecated  This method is deprecated because the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role (for example, group owner, group client, and so on). @n
451      * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs.
452      *
453      * @since 2.0
454      *
455      * @return      The Wi-Fi Direct member instance if successful, @n
456      *              else @c null if the status of device is @c WIFI_DIRECT_GROUP_MEMBER_TYPE_NONE
457      * @exception   E_SUCCESS           The method is successful.
458      * @exception   E_SYSTEM            A system error has occurred.
459      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
460      *                                  For example, the member type of a device is not a group owner or client.
461      * @exception   E_OUT_OF_MEMORY     The memory is insufficient.
462      * @remarks     The specific error code can be accessed using the GetLastResult() method.
463      * @endif
464      */
465     WifiDirectGroupMember* GetWifiDirectMemberN(void) const;
466
467     /**
468      * Checks whether the local Wi-Fi Direct device is currently discoverable.
469      *
470      * @since 2.0
471      *
472      * @return      @c true if the local Wi-Fi Direct device is currently discoverable, @n
473      *              else @c false
474      * @remarks     At times, even though the Wi-Fi Direct device is activated the device cannot be discovered due to the visibility
475      *                          setting, or if the device is performing some operation, such as Wi-Fi scanning.
476      */
477     bool IsDiscoverable(void) const;
478
479     /**
480      * Connects to the Wi-Fi Direct connection with the specified peer device.
481      *
482      * @since 2.0
483      * @privlevel   public
484      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
485      *
486      * @return  An error code
487      * @param[in]   remoteDeviceInfo  The remote peer device to connect.
488      * @exception   E_SUCCESS               The method is successful.
489      * @exception   E_SYSTEM                A system error has occurred.
490      * @exception   E_IN_PROGRESS           The previous request is in progress.
491      * @exception   E_INVALID_ARG           The specified @c remoteDeviceInfo is invalid.
492      * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of this operation. @n
493      *                                      For example, the local device is already connected except in the case of group owner.
494      * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
495      *
496      * @remarks   If the local device does not belong to a group owner or client, a group negotiation request is sent to the remote device and the configured group information is used at this time. @n
497      *            If the local device is a group owner, a request to join the group is sent to the remote device.
498      *
499      * @see IWifiDirectDeviceListener::OnWifiDirectConnected()
500      * @see SetGroupSettingInfo()
501      * @see SetWpsConfigurationModePreference()
502      */
503     result Connect(const WifiDirectDeviceInfo& remoteDeviceInfo);
504
505     /**
506      * Cancels the request for Wi-Fi Direct connection.
507      *
508      * @since 2.0
509      * @privlevel   public
510      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
511      *
512      * @return  An error code
513      * @exception   E_SUCCESS               The method is successful.
514      * @exception   E_SYSTEM                A system error has occurred.
515      * @exception   E_IN_PROGRESS           The previous request is in progress.
516      * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of this operation. @n
517      *                                      For example, the local device is not connecting.
518      * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
519      *
520      * @see IWifiDirectDeviceListener::OnWifiDirectConnected()
521      */
522     result CancelConnect(void);
523
524     /**
525      * Creates a Wi-Fi Direct group as the group owner.
526      *
527      * @since 2.0
528      * @privlevel   public
529      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
530      *
531      * @return  An error code
532      * @exception   E_SUCCESS               The method is successful.
533      * @exception   E_SYSTEM                A system error has occurred.
534      * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of this operation. @n
535      *                                 For example, the local device is already deactivated or connected.
536      * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
537      *
538      * @see IWifiDirectDeviceListener::OnWifiDirectAutonomousGroupCreated()
539      *
540      */
541     result CreateAutonomousGroup(void);
542
543     /**
544      * Sets the configuration information of a Wi-Fi Direct group.
545      *
546      * @since 2.0
547      * @privlevel   public
548      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
549      *
550      * @return  An error code
551      * @param[in]   groupSettingInfo   The group setting information
552      * @exception   E_SUCCESS               The method is successful.
553      * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of this operation. @n
554      *                                      For example, the local device is already deactivated or connected.
555      * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
556      *
557      * @remarks This method should be called before using Connect() to configure the group information.
558      */
559     result SetGroupSettingInfo(const WifiDirectGroupInfo& groupSettingInfo);
560
561     /**
562      * Disconnects the specified peer device.
563      *
564      * @since 2.0
565      * @privlevel   public
566      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
567      *
568      * @return  An error code
569      * @param[in]   peerDeviceInfo      The peer device to disconnect
570      * @exception   E_SUCCESS           The method is successful.
571      * @exception   E_SYSTEM            A system error has occurred.
572      * @exception   E_IN_PROGRESS       The previous request is in progress.
573      * @exception   E_INVALID_ARG       The specified @c remoteDeviceInfo is invalid.
574      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
575      *                                  For example, the local device is not connected.
576      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
577      *
578      * @see IWifiDirectDeviceListener::OnWifiDirectDisconnected()
579      */
580     result Disconnect(const WifiDirectDeviceInfo& peerDeviceInfo);
581
582     /**
583      * Leaves the currently participating Wi-Fi Direct group.
584      *
585      * @since 2.0
586      * @privlevel   public
587      * @privilege   http://tizen.org/privilege/wifi.wifidirect.admin
588      *
589      * @return  An error code
590      * @exception   E_SUCCESS           The method is successful.
591      * @exception   E_SYSTEM            A system error has occurred.
592      * @exception   E_IN_PROGRESS       The previous request is in progress.
593      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
594      *                                  For example, the local device is not a group owner or client.
595      * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
596      *
597      * @see IWifiDirectDeviceListener::OnWifiDirectGroupLeft()
598      * @remarks If the local device belongs to a group owner, the group will be destroyed and the IWifiDirectDeviceListener::OnWifiDirectDisconnected() event method will not occur for each client connection.
599      */
600     result LeaveGroup(void);
601
602
603     /**
604      * Gets information of the group owner of a Wi-Fi Direct group.
605      *
606      * @since 2.0
607      *
608      * @return    The Wi-Fi Direct group owner information if successful, @n
609      *           else null
610      * @exception E_SUCCESS           The method is successful.
611      * @exception E_SYSTEM            A system error has occurred.
612      * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
613      *                                For example, the local device is not connected.
614      * @remarks The specific error code can be accessed using the GetLastResult() method
615      */
616     WifiDirectDeviceInfo* GetGroupOwnerInfoN(void) const;
617
618     /**
619      * Gets the list of the Wi-Fi Direct group clients.
620      *
621      * @since 2.0
622      *
623      * @return   A pointer to the list that contains the WifiDirectDeviceInfo instances of the group clients if successful, @n
624      *           else @c null
625      * @exception   E_SUCCESS           The method is successful.
626      * @exception   E_SYSTEM            A system error has occurred.
627      * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
628      *                                  For example, the local device is not a group owner.
629      */
630     Tizen::Base::Collection::IList* GetGroupClientInfoListN(void) const;
631
632     /**
633      * Gets the index of a currently working channel.
634      *
635      * @since 2.0
636      *
637      * @return  The Wi-Fi radio channel
638      *
639      * @remarks If the member type of the local device is not a group owner or client, the channel does not contain valid information.
640      */
641     WifiRadioChannel GetOperatingChannel(void) const;
642
643 private:
644     /**
645      *
646      * This default constructor is intentionally declared as private so that only the platform can create an instance.
647      * @remarks     After creating an instance of this class, the Construct() method must be called explicitly
648      *              to initialize this instance.
649      * @see         Construct()
650      */
651     WifiDirectDevice(void);
652
653     /**
654      * This copy constructor is intentionally declared as private to prohibit copying of objects by users.
655      *
656      * @param[in]   value   An instance of %WifiDirectDevice
657      */
658     WifiDirectDevice(const WifiDirectDevice& value);
659
660     /**
661      * Initializes this instance of %WifiDirectDevice.
662      *
663      * @return      An error code
664      * @param[in]   localDeviceId   An ID for a Wi-Fi Direct device
665      *
666      * @exception   E_SUCCESS       The method is successful.
667      * @exception   E_SYSTEM        A system error has occurred.
668      * @exception   E_OUT_OF_MEMORY The memory is insufficient.
669      * @exception   E_INVALID_ARG   The specified @c localDeviceId is invalid.
670      */
671     result Construct(WifiDirectDeviceId localDeviceId);
672
673     /**
674      * The implementation of this copy assignment operator is intentionally blank and declared as private to
675      * prohibit copying of objects.
676      *
677      * @param[in]   rhs An instance of %WifiDirectDevice
678      */
679     WifiDirectDevice& operator =(const WifiDirectDevice& rhs);
680
681 private:
682     _WifiDirectDeviceImpl* __pWifiDirectDeviceImpl;
683
684     friend class _WifiDirectDeviceImpl;
685 }; // WifiDirectDevice
686
687 } } } // Tizen::Net::Wifi
688 #endif // _FNET_WIFI_WIFI_DIRECT_DEVICE_H_