2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FNetWifiIWifiDirectDeviceListener.h
19 * @brief This is the header file for the %IWifiDirectDeviceListener interface.
21 * This header file contains the declarations of the %IWifiDirectDeviceListener interface.
23 #ifndef _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_
24 #define _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_
26 #include <FBaseRtIEventListener.h>
27 #include <FNetWifiWifiTypes.h>
28 #include <FNetWifiWifiDirectGroupMember.h>
30 namespace Tizen { namespace Base { namespace Collection
33 } } } // Tizen::Base::Collection
35 namespace Tizen { namespace Net { namespace Wifi
37 class WifiDirectGroupInfo;
38 class WifiDirectDeviceInfo;
41 * @interface IWifiDirectDeviceListener
42 * @brief This interface implements listeners for the WifiDirectDevice events.
46 * The %IWifiDirectDeviceListener interface represents a listener to get the Wi-Fi Direct device status or information.
48 * For more information on the class features, see
49 * <a href="../org.tizen.native.appprogramming/html/guide/net/wi-fi_direct_connectivity.htm">Wi-Fi Direct Connectivity</a>.
52 class _OSP_EXPORT_ IWifiDirectDeviceListener
53 : virtual public Tizen::Base::Runtime::IEventListener
57 * This polymorphic destructor should be overridden if required. This way,
58 * the destructors of the derived classes are called when the destructor of this interface is called.
62 virtual ~IWifiDirectDeviceListener(void) {}
65 * Called to notify the application that the local Wi-Fi Direct mode is enabled.
69 * @param[in] localDeviceId The ID of the Wi-Fi Direct device
70 * @param[in] r An error code
71 * @exception E_SUCCESS The activation is successful.
72 * @exception E_SYSTEM A system error has occurred.
73 * @see WifiDirectDevice::Activate()
75 virtual void OnWifiDirectDeviceActivated(WifiDirectDeviceId localDeviceId, result r) = 0;
78 * Called to notify the application that the local Wi-Fi Direct mode is disabled.
82 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
83 * @param[in] r An error code
84 * @exception E_SUCCESS The deactivation is successful.
85 * @exception E_SYSTEM A system error has occurred.
86 * @see WifiDirectDevice::Deactivate()
88 virtual void OnWifiDirectDeviceDeactivated(WifiDirectDeviceId localDeviceId, result r) = 0;
91 * Called to notify the application when a Wi-Fi Direct connection is established with a remote device.
95 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
96 * @param[in] remoteDeviceInfo The remote device
97 * @param[in] r An error code
99 * @exception E_SUCCESS The Wi-Fi Direct group has been created successfully.
100 * @exception E_SYSTEM A system error has occurred.
101 * @exception E_OPERATION_CANCELED The operation has been cancelled explicitly.
102 * @exception E_AUTHENTICATION The authentication has failed during the Wi-Fi connection process.
103 * @exception E_NOT_RESPONDING The remote device is not responding.
104 * @see WifiDirectDevice::Connect()
105 * @see WifiDirectDevice::CancelConnect()
107 virtual void OnWifiDirectConnected(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo,
111 * Called to notify the application when the Wi-Fi Direct connection is disconnected with a peer device.
115 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
116 * @param[in] peerMacAddress The mac address of the peer device
117 * @param[in] r An error code
118 * @exception E_SUCCESS The method is successful.
119 * @exception E_SYSTEM A system error has occurred.
120 * @see WifiDirectDevice::Disconnect()
122 virtual void OnWifiDirectDisconnected(WifiDirectDeviceId localDeviceId, const Tizen::Base::String& peerMacAddress,
126 * Called to notify the application when an autonomous group is created.
130 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
131 * @param[in] r An error code
132 * @exception E_SUCCESS The method is successful.
133 * @exception E_SYSTEM A system error has occurred.
134 * @see WifiDirectDevice::CreateAutonomousGroup()
136 virtual void OnWifiDirectAutonomousGroupCreated(WifiDirectDeviceId localDeviceId, result r) = 0;
139 * Called to notify the application when a local device leaves the group.
143 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
144 * @param[in] r An error code
145 * @exception E_SUCCESS The method is successful.
146 * @exception E_SYSTEM A system error has occurred.
147 * @see WifiDirectDevice::LeaveGroup()
149 virtual void OnWifiDirectGroupLeft(WifiDirectDeviceId localDeviceId, result r) = 0;
153 * Called to notify the application about the result and related information when a group is created or when a
154 * request to create a group is cancelled.
156 * @brief <i> [Deprecated] </i>
157 * @deprecated This method is deprecated because the Wi-Fi direct APIs have been revised to allow the use of APIs
158 * with ease irrespective of the role (for example, group owner, group client, and so on). @n
159 * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary
160 * to use these APIs. @n
161 * Instead of using this method, use OnWifiDirectConnected() or OnWifiDirectAutonomousGroupCreated()
166 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
167 * @param[in] wifiDirectGroupInfo The WifiDirectGroupInfo instance set by the winning group owner after
169 * @param[in] wifiDirectGroupOwnerDeviceInfo The WifiDirectDeviceInfo instance of the group owner
170 * @param[in] pWifiDirectMember The WifiDirectGroupMember instance that is casted to the instance of
171 * WifiDirectGroupOwner or WifiDirectGroupClient as a result of negotiation
172 * after the creation of a group
173 * @param[in] r An error code
174 * @exception E_SUCCESS The Wi-Fi Direct group creation is successful.
175 * @exception E_SYSTEM A system error has occurred.
176 * @exception E_OPERATION_CANCELED The operation has been cancelled explicitly.
177 * @exception E_AUTHENTICATION The authentication has failed during the Wi-Fi connection process.
178 * @exception E_DHCP The DHCP operation has failed.
179 * @exception E_NOT_RESPONDING The target is not responding.
180 * @exception E_REJECTED The connection request has been rejected.
181 * @exception E_REMOTE_DEVICE_NOT_FOUND The Wi-Fi Direct device has not been found.
182 * @remarks If a device becomes a group client, then the WifiDirectGroupInfo::GetGroupOwnerIntent() and
183 * WifiDirectGroupInfo::GetMaxNumberOfClients() methods will not contain valid information.
184 * @see WifiDirectDevice::CreateGroup()
185 * @see WifiDirectDevice::CancelGroupCreation()
188 virtual void OnWifiDirectGroupCreatedN(WifiDirectDeviceId localDeviceId, const WifiDirectGroupInfo& wifiDirectGroupInfo,
189 const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, WifiDirectGroupMember* pWifiDirectMember, result r)
190 { delete pWifiDirectMember; }
193 * Called to notify the application when the scan is completed.
197 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
198 * @param[in] pWifiDirectDeviceInfoList The WifiDirectDeviceInfo information list representing the
199 * Wi-Fi Direct devices discovered by scan
200 * @param[in] r An error code
201 * @exception E_SUCCESS The scan is successful.
202 * @exception E_SYSTEM A system error has occurred.
203 * @exception E_OPERATION_CANCELED The operation has been cancelled explicitly.
204 * @see WifiDirectDevice::Scan()
205 * @see WifiDirectDevice::CancelScan()
207 virtual void OnWifiDirectScanCompletedN(WifiDirectDeviceId localDeviceId,
208 Tizen::Base::Collection::IList* pWifiDirectDeviceInfoList, result r) = 0;
212 * Called to notify the application when the connection to a Wi-Fi Direct group owner is completely established.
214 * @brief <i> [Deprecated] </i>
215 * @deprecated This method is deprecated because the Wi-Fi direct APIs have been revised to allow the use of APIs
216 * with ease irrespective of the role (for example, group owner, group client, and so on). @n
217 * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary
218 * to use these APIs. @n
219 * Instead of using this method, use OnWifiDirectConnected() method.
223 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
224 * @param[in] wifiDirectGroupOwnerDeviceInfo The WifiDirectDeviceInfo of the connected Wi-Fi Direct group
226 * @param[in] r An error code
227 * @exception E_SUCCESS The association is successful.
228 * @exception E_SYSTEM A system error has occurred.
229 * @exception E_AUTHENTICATION The authentication has failed during the Wi-Fi connection process.
230 * @exception E_DHCP The DHCP operation has failed.
231 * @exception E_NOT_RESPONDING The target is not responding.
232 * @exception E_REJECTED The connection request has been rejected.
233 * @exception E_REMOTE_DEVICE_NOT_FOUND The Wi-Fi Direct device has not been found.
234 * @see WifiDirectDevice::Associate()
237 virtual void OnWifiDirectAssociationCompleted(WifiDirectDeviceId localDeviceId,
238 const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, result r) {}
241 * Called to notify the application when a remote device is found during the Wi-Fi Direct scan process.
245 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
246 * @param[in] remoteDeviceInfo The remote device that is found
247 * @see WifiDirectDevice::Scan()
249 virtual void OnWifiDirectRemoteDeviceFound(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo) {}
253 // This method is for internal use only. Using this method can cause behavioral, security-related,
254 // and consistency-related issues in the application.
256 // This method is reserved and may change its name at any time without prior notice.
260 virtual void OnWifiDirectDeviceListener_Reserved1(void) {}
263 // This method is for internal use only. Using this method can cause behavioral, security-related,
264 // and consistency-related issues in the application.
266 // This method is reserved and may change its name at any time without prior notice.
270 virtual void OnWifiDirectDeviceListener_Reserved2(void) {}
273 // This method is for internal use only. Using this method can cause behavioral, security-related,
274 // and consistency-related issues in the application.
276 // This method is reserved and may change its name at any time without prior notice.
280 virtual void OnWifiDirectDeviceListener_Reserved3(void) {}
283 // This method is for internal use only. Using this method can cause behavioral, security-related,
284 // and consistency-related issues in the application.
286 // This method is reserved and may change its name at any time without prior notice.
290 virtual void OnWifiDirectDeviceListener_Reserved4(void) {}
292 }; // IWifiDirectDeviceListener
294 } } } //Tizen::Net::Wifi
295 #endif // _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_