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 <a href="../org.tizen.native.appprogramming/html/guide/net/wi-fi_direct_connectivity.htm">Wi-Fi Direct Connectivity</a>.
51 class _OSP_EXPORT_ IWifiDirectDeviceListener
52 : virtual public Tizen::Base::Runtime::IEventListener
56 * This polymorphic destructor should be overridden if required. This way,
57 * the destructors of the derived classes are called when the destructor of this interface is called.
61 virtual ~IWifiDirectDeviceListener(void) {}
64 * Called to notify the application that the local Wi-Fi Direct mode is enabled.
68 * @param[in] localDeviceId The ID of the Wi-Fi Direct device
69 * @param[in] r An error code
70 * @exception E_SUCCESS The activation is successful.
71 * @exception E_SYSTEM A system error has occurred.
72 * @see WifiDirectDevice::Activate()
74 virtual void OnWifiDirectDeviceActivated(WifiDirectDeviceId localDeviceId, result r) = 0;
77 * Called to notify the application that the local Wi-Fi Direct mode is disabled.
81 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
82 * @param[in] r An error code
83 * @exception E_SUCCESS The deactivation is successful.
84 * @exception E_SYSTEM A system error has occurred.
85 * @see WifiDirectDevice::Deactivate()
87 virtual void OnWifiDirectDeviceDeactivated(WifiDirectDeviceId localDeviceId, result r) = 0;
90 * Called to notify the application when a Wi-Fi Direct connection is established with a remote device.
94 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
95 * @param[in] remoteDeviceInfo The remote device
96 * @param[in] r An error code
98 * @exception E_SUCCESS The Wi-Fi Direct group has been created successfully.
99 * @exception E_SYSTEM A system error has occurred.
100 * @exception E_OPERATION_CANCELED The operation has been cancelled explicitly.
101 * @exception E_AUTHENTICATION The authentication has failed during the Wi-Fi connection process.
102 * @exception E_NOT_RESPONDING The remote device is not responding.
103 * @see WifiDirectDevice::Connect()
104 * @see WifiDirectDevice::CancelConnect()
106 virtual void OnWifiDirectConnected(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo, result r) = 0;
109 * Called to notify the application when the Wi-Fi Direct connection is disconnected with a peer device.
113 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
114 * @param[in] peerMacAddress The mac address of the peer device
115 * @param[in] r An error code
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_SYSTEM A system error has occurred.
118 * @see WifiDirectDevice::Disconnect()
120 virtual void OnWifiDirectDisconnected(WifiDirectDeviceId localDeviceId, const Tizen::Base::String& peerMacAddress, result r) = 0;
123 * Called to notify the application when an autonomous group is created.
127 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
128 * @param[in] r An error code
129 * @exception E_SUCCESS The method is successful.
130 * @exception E_SYSTEM A system error has occurred.
131 * @see WifiDirectDevice::CreateAutonomousGroup()
133 virtual void OnWifiDirectAutonomousGroupCreated(WifiDirectDeviceId localDeviceId, result r) = 0;
136 * Called to notify the application when a local device leaves the group.
140 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
141 * @param[in] r An error code
142 * @exception E_SUCCESS The method is successful.
143 * @exception E_SYSTEM A system error has occurred.
144 * @see WifiDirectDevice::LeaveGroup()
146 virtual void OnWifiDirectGroupLeft(WifiDirectDeviceId localDeviceId, result r) = 0;
150 * Called to notify the application about the result and related information when a group is created or when a request to create a group is cancelled.
153 * @brief <i> [Deprecated] </i>
154 * @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
155 * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs. @n
156 * Instead of using this method, use OnWifiDirectConnected() or OnWifiDirectAutonomousGroupCreated() method.
160 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
161 * @param[in] wifiDirectGroupInfo The WifiDirectGroupInfo instance set by the winning group owner after negotiation
162 * @param[in] wifiDirectGroupOwnerDeviceInfo The WifiDirectDeviceInfo instance of the group owner
163 * @param[in] pWifiDirectMember The WifiDirectGroupMember instance that is casted to the instance of
164 * WifiDirectGroupOwner or WifiDirectGroupClient as a result of negotiation
165 * after the creation of a group
166 * @param[in] r An error code
167 * @exception E_SUCCESS The Wi-Fi Direct group creation is successful.
168 * @exception E_SYSTEM A system error has occurred.
169 * @exception E_OPERATION_CANCELED The operation has been cancelled explicitly.
170 * @exception E_AUTHENTICATION The authentication has failed during the Wi-Fi connection process.
171 * @exception E_DHCP The DHCP operation has failed.
172 * @exception E_NOT_RESPONDING The target is not responding.
173 * @exception E_REJECTED The connection request has been rejected.
174 * @exception E_REMOTE_DEVICE_NOT_FOUND The Wi-Fi Direct device has not been found.
175 * @remarks If a device becomes a group client, then the WifiDirectGroupInfo::GetGroupOwnerIntent() and WifiDirectGroupInfo::GetMaxNumberOfClients() methods will not contain valid information.
176 * @see WifiDirectDevice::CreateGroup()
177 * @see WifiDirectDevice::CancelGroupCreation()
180 virtual void OnWifiDirectGroupCreatedN(WifiDirectDeviceId localDeviceId, const WifiDirectGroupInfo& wifiDirectGroupInfo, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, WifiDirectGroupMember* pWifiDirectMember, result r) { delete pWifiDirectMember; }
183 * Called to notify the application when the scan is completed.
187 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
188 * @param[in] pWifiDirectDeviceInfoList The WifiDirectDeviceInfo information list representing the
189 * Wi-Fi Direct devices discovered by scan
190 * @param[in] r An error code
191 * @exception E_SUCCESS The scan is successful.
192 * @exception E_SYSTEM A system error has occurred.
193 * @exception E_OPERATION_CANCELED The operation has been cancelled explicitly.
194 * @see WifiDirectDevice::Scan()
195 * @see WifiDirectDevice::CancelScan()
197 virtual void OnWifiDirectScanCompletedN(WifiDirectDeviceId localDeviceId, Tizen::Base::Collection::IList* pWifiDirectDeviceInfoList, result r) = 0;
201 * Called to notify the application when the connection to a Wi-Fi Direct group owner is completely established.
203 * @brief <i> [Deprecated] </i>
204 * @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
205 * Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs. @n
206 * Instead of using this method, use OnWifiDirectConnected() method.
210 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
211 * @param[in] wifiDirectGroupOwnerDeviceInfo The WifiDirectDeviceInfo of the connected Wi-Fi Direct group
213 * @param[in] r An error code
214 * @exception E_SUCCESS The association is successful.
215 * @exception E_SYSTEM A system error has occurred.
216 * @exception E_AUTHENTICATION The authentication has failed during the Wi-Fi connection process.
217 * @exception E_DHCP The DHCP operation has failed.
218 * @exception E_NOT_RESPONDING The target is not responding.
219 * @exception E_REJECTED The connection request has been rejected.
220 * @exception E_REMOTE_DEVICE_NOT_FOUND The Wi-Fi Direct device has not been found.
221 * @see WifiDirectDevice::Associate()
224 virtual void OnWifiDirectAssociationCompleted(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, result r) {}
227 * Called to notify the application when a remote device is found during the Wi-Fi Direct scan process.
231 * @param[in] localDeviceId An ID for a Wi-Fi Direct device
232 * @param[in] remoteDeviceInfo The remote device that is found
233 * @see WifiDirectDevice::Scan()
235 virtual void OnWifiDirectRemoteDeviceFound(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo) {}
239 // This method is for internal use only. Using this method can cause behavioral, security-related,
240 // and consistency-related issues in the application.
242 // This method is reserved and may change its name at any time without prior notice.
246 virtual void OnWifiDirectDeviceListener_Reserved1(void) {}
249 // This method is for internal use only. Using this method can cause behavioral, security-related,
250 // and consistency-related issues in the application.
252 // This method is reserved and may change its name at any time without prior notice.
256 virtual void OnWifiDirectDeviceListener_Reserved2(void) {}
259 // This method is for internal use only. Using this method can cause behavioral, security-related,
260 // and consistency-related issues in the application.
262 // This method is reserved and may change its name at any time without prior notice.
266 virtual void OnWifiDirectDeviceListener_Reserved3(void) {}
269 // This method is for internal use only. Using this method can cause behavioral, security-related,
270 // and consistency-related issues in the application.
272 // This method is reserved and may change its name at any time without prior notice.
276 virtual void OnWifiDirectDeviceListener_Reserved4(void) {}
278 }; // IWifiDirectDeviceListener
280 } } } //Tizen::Net::Wifi
281 #endif // _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_