WiFi Framework
ContentsIndexHome
PreviousUpNext
CwclWiFiClient::Connect Method

The method attempts to connect to a specific network.

Syntax
C++
int Connect(GUID IfaceId, wclWiFiConnectionMode Mode, tstring Profile, tstring Ssid, wclWiFiBssType BssType, wclWiFiConnectFlags Flags, tstring Bss = tstring(_T("")));
Parameters 
Description 
GUID IfaceId 
The ID of the interface to use for the connection.  
wclWiFiConnectionMode Mode 
A value that specifies the mode of connection.  
tstring Profile 
Specifies the profile being used for the connection.
If Mode is set to cmProfile, then Profile specifies the name of the profile used for the connection.
If Mode is set to cmTemporaryProfile, then Profile specifies the XML representation of the profile used for the connection.
If Mode is set to cmDiscoverySecure or cmDiscoveryUnsecure, then Profile should be set to an empty string.
 
tstring Ssid 
Specifies the SSID of the network to connect to. This parameter is optional. When set to and empty string, all SSIDs in the profile will be tried. This parameter must not be an empty string if Mode is set to cmDiscoverySecure or cmDiscoveryUnsecure.  
wclWiFiBssType BssType 
Indicates the BSS type of the network. If a profile is provided, this BSS type must be the same as the one in the profile.  
wclWiFiConnectFlags Flags 
The flags used to specify the connection parameters.  
tstring Bss = tstring(_T("")) 
The basic service set (BSS) identifiers (MACs) desired for the connection.  

If the function succeeds, the return value is wclCommon::WCL_E_SUCCESS.  

If the function fails, the return value may be one of the WCL return codes.  

 

The Connect method returns immediately. To be notified when a connection is established or when no further connections will be attempted, a client must use the CwclWiFiEvents component.  

 

Copyright (c) 2006-2019. All rights reserved.