WiFi Framework C++ Edition
Public Member Functions | Protected Member Functions | List of all members
CwclWiFiDirectAdvertiser Class Reference

The class allows to publish WiFi Direct advertisements. More...

#include <wclWiFi.h>

Inheritance diagram for CwclWiFiDirectAdvertiser:
CwclWiFiDirectConnectionComponent CwclCustomWiFiDirectComponent

Public Member Functions

 CwclWiFiDirectAdvertiser ()
 Creates a new WiFi Direct Advertiser component.
 
virtual ~CwclWiFiDirectAdvertiser ()
 Frees the WiFi Direct Advertiser component.
 
int Start ()
 Starts the WiFi Direct Advertisement.
 
int Stop ()
 Stops the WiFi Direct Advertisement.
 
bool GetActive () const
 Gets the WiFi Direct Advertiser state.
 
 __declspec (property(get=GetActive)) bool Active
 Gets the WiFi Direct Advertiser state.
 
size_t GetCount () const
 Gets connected devices number.
 
 __declspec (property(get=GetCount)) size_t Count
 Gets connected devices number.
 
CwclWiFiDirectDeviceGetDevices (const size_t Index) const
 Gets connected device.
 
 __declspec (property(get=GetDevices)) CwclWiFiDirectDevice *Devices[]
 Gets connected device.
 
bool GetAutonomousGroupOwnerEnabled () const
 Gets the autonomous group owner state.
 
void SetAutonomousGroupOwnerEnabled (const bool value)
 Sets the autonomous group owner state.
 
 __declspec (property(get=GetAutonomousGroupOwnerEnabled, put=SetAutonomousGroupOwnerEnabled)) bool AutonomousGroupOwnerEnabled
 Gets and sets the autonomous group owner state.
 
wclWiFiDirectAdvertisementDiscoverability GetDiscoverability () const
 Gets the listen state and whether the WiFi Direct device is discoverable.
 
void SetDiscoverability (const wclWiFiDirectAdvertisementDiscoverability value)
 Sets the listen state and whether the WiFi Direct device is discoverable.
 
 __declspec (property(get=GetDiscoverability, put=SetDiscoverability)) wclWiFiDirectAdvertisementDiscoverability Discoverability
 Gets and sets the listen state and whether the WiFi Direct device is discoverable.
 
bool GetLegacy () const
 Gets the WiFi Direct Advertiser legacy node state.
 
void SetLegacy (const bool value)
 Sets the WiFi Direct Advertiser legacy node state.
 
 __declspec (property(get=GetLegacy, put=SetLegacy)) bool Legacy
 Gets and sets the WiFi Direct Advertiser legacy node state.
 
bool GetOpenAuth () const
 Gets the Open Network flag.
 
void SetOpenAuth (const bool value)
 Sets the Open Network flag.
 
 __declspec (property(get=GetOpenAuth, put=SetOpenAuth)) bool OpenAuth
 Gets and sets the Open Network flag.
 
tstring GetPassphrase () const
 Gets the pass phrase for Legacy mode.
 
void SetPassphrase (const tstring &value)
 Sets the pass phrase for Legacy mode.
 
 __declspec (property(get=GetPassphrase, put=SetPassphrase)) tstring Passphrase
 Gets and sets the pass phrase for Legacy mode.
 
tstring GetSsid () const
 Gets the Service Set Identifier (SSID).
 
void SetSsid (const tstring &value)
 Sets the Service Set Identifier (SSID).
 
 __declspec (property(get=GetSsid, put=SetSsid)) tstring Ssid
 Gets and sets the Service Set Identifier (SSID).
 
__event void OnAcceptDevice (void *Sender, CwclWiFiDirectDevice *const Device, bool &Accept)
 The event fires when a remote WiFi enable device connects to the WiFi Direct Advertiser and an application must accept or reject the connection request.
 
__event void OnStarted (void *Sender)
 The event fires when the WiFi Direct Advertiser has been started with success.
 
__event void OnStopped (void *Sender)
 The event fires when the WiFi Direct Advertiser has been stopped.
 
- Public Member Functions inherited from CwclWiFiDirectConnectionComponent
 CwclWiFiDirectConnectionComponent ()
 Creates a new WiFi Direct Advertiser component.
 
__event void OnDeviceConnected (void *Sender, CwclWiFiDirectDevice *const Device, const int Error)
 The event fires when a remote WiFi enabled device has been connected to the WiFi Direct Advertiser.
 
__event void OnDeviceDisconnected (void *Sender, CwclWiFiDirectDevice *const Device, const int Reason)
 The event fires when the remote WiFi enabled device has been disconnected from the WiFi Direct Advertiser.
 
__event void OnPairCompleted (void *Sender, CwclWiFiDirectDevice *const Device, const int Result)
 The event fires when pairing with a remote WiFi enabled device has been completed (with or without success).
 
__event void OnPairConfirm (void *Sender, CwclWiFiDirectDevice *const Device, bool &Confirm)
 The event fires when a remote WiFi enabled device requests simple pairing confirmation.
 
__event void OnPairDisplayPin (void *Sender, CwclWiFiDirectDevice *const Device, const tstring &Pin)
 The event fires when a remote WiFi enabled device requests the Display Pin pairing procedure. An application must show the Pin received from the event.
 
__event void OnPairGetParams (void *Sender, CwclWiFiDirectDevice *const Device, short &GroupOwnerIntent, wclWiFiDirectConfigurationMethods &ConfigurationMethods, wclWiFiDirectPairingProcedure &PairingProcedure)
 The event fires when pairing parameters need to be set.
 
__event void OnPairProvidePin (void *Sender, CwclWiFiDirectDevice *const Device, tstring &Pin)
 The event fires when a remote WiFi enabled device requests Pin for pairing. An application must provide Pin.
 
- Public Member Functions inherited from CwclCustomWiFiDirectComponent
 CwclCustomWiFiDirectComponent ()
 Creates a new WiFi Direct Advertiser component.
 
virtual ~CwclCustomWiFiDirectComponent ()
 Frees the WiFi Direct Advertiser component.
 

Protected Member Functions

virtual void HardwareRemoved () override
 The method called when WiFi hardware has been switched off or removed.
 
virtual CwclWiFiDirectDeviceFindDevice (const tstring &Id) const override
 Gets device object by its ID.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The method called when a new notification message received.
 
virtual void DoAcceptDevice (CwclWiFiDirectDevice *const Device, bool &Accept)
 Fires the OnAcceptDevice event.
 
virtual void DoDeviceConnected (CwclWiFiDirectDevice *const Device, const int Error) override
 Fires the OnDeviceConnected event.
 
virtual void DoDeviceDisconnected (CwclWiFiDirectDevice *const Device, const int Reason) override
 Fires the OnDeviceDisconnected event.
 
virtual void DoStarted ()
 Fires the OnStarted event.
 
virtual void DoStopped ()
 Fires the OnStopped event.
 
- Protected Member Functions inherited from CwclWiFiDirectConnectionComponent
virtual CwclWiFiDirectDeviceFindDevice (const tstring &Id) const =0
 Gets device object by its ID.
 
virtual void MessageReceived (const CwclMessage *const Message) override
 The method called when a new notification message received.
 
virtual void DoDeviceConnected (CwclWiFiDirectDevice *const Device, const int Error)
 Fires the OnDeviceConnected event.
 
virtual void DoDeviceDisconnected (CwclWiFiDirectDevice *const Device, const int Reason)
 Fires the OnDeviceDisconnected event.
 
virtual void DoPairCompleted (CwclWiFiDirectDevice *const Device, const int Result)
 Fires the OnPairComplete event.
 
virtual void DoPairConfirm (CwclWiFiDirectDevice *const Device, bool &Confirm)
 Fires the OnPairConfirm event.
 
virtual void DoPairDisplayPin (CwclWiFiDirectDevice *const Device, const tstring &Pin)
 Fires the OnPairDisplayPin event.
 
virtual void DoPairGetParams (CwclWiFiDirectDevice *const Device, short &GroupOwnerIntent, wclWiFiDirectConfigurationMethods &ConfigurationMethods, wclWiFiDirectPairingProcedure &PairingProcedure)
 Fires the OnPairGetParams event.
 
virtual void DoPairProvidePin (CwclWiFiDirectDevice *const Device, tstring &Pin)
 Fires the OnPairProvidePin event.
 
- Protected Member Functions inherited from CwclCustomWiFiDirectComponent
virtual void HardwareRemoved ()
 The method called when WiFi hardware has been switched off or removed.
 
int InitWlan ()
 Initializes native WLAN subsystem.
 
void UninitWlan ()
 Uninitializes native WLAN subsystem.
 
virtual void MessageReceived (const CwclMessage *const Message)
 The method called when a new notification message received.
 
bool GetHardwareAvailable () const
 Gets the Hardware Available flag.
 
 __declspec (property(get=GetHardwareAvailable)) bool HardwareAvailable
 Gets the Hardware Available flag.
 
CwclMessageReceiverGetReceiver () const
 Gets the message receiver object.
 
 __declspec (property(get=GetReceiver)) CwclMessageReceiver *Receiver
 Gets the message receiver object.
 

Detailed Description

The class allows to publish WiFi Direct advertisements.

Windows 10, version 1607, supports Mobile HotSpot, an enhanced version of the mobile broadband tethering feature. If Mobile HotSpot is running, the functionality of this class is not supported. It is likely to stop working.

The Mobile HotSpot and WiFi Direct technology cannot run at the same time. Mobile HotSpot takes precedence over all WiFi Direct scenarios.

See also
CwclWiFiDirectConnectionComponent