TwclWiFiClient.Connect(TGUID,TwclWiFiConnectionMode,string,string,TwclWiFiBssType,TwclWiFiConnectFlags,string) Method
The method attempts to connect to a specific network.
public function Connect(const IfaceId: TGUID; const Mode: TwclWiFiConnectionMode; const Profile: string; const Ssid: string; const BssType: TwclWiFiBssType; const Flags: TwclWiFiConnectFlags; const Bss: string): Integer; overload;
Parameters
- IfaceId
- Type: TGUID
The ID of the interface to use for the connection.
- Mode
- Type: TwclWiFiConnectionMode
A value that specifies the mode of connection.
- Profile
- Type: string
Specifies the profile being used for the connection.
If
Mode
is set tocmProfile
, thenProfile
specifies the name of the profile used for the connection.If
Mode
is set tocmTemporaryProfile
, thenProfile
specifies the XML representation of the profile used for the connection.If
Mode
is set tocmDiscoverySecure
orcmDiscoveryUnsecure
, thenProfile
should be set to an empty string. - Ssid
- Type: string
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 tocmDiscoverySecure
orcmDiscoveryUnsecure
. - BssType
- Type: TwclWiFiBssType
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.
- Flags
- Type: TwclWiFiConnectFlags
The flags used to specify the connection parameters.
- Bss
- Type: string
The basic service set (BSS) identifier (MAC) desired for the connection.
Return Value
If the function succeeds, the return value is wclErrors.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
TwclWiFiEvents component.