ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Bluetooth
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
BTConnectDevice (Function)
In french: BTConnectePériphérique
Allows you to be authenticated toward a Bluetooth device.
Example
// Bluetooth connection with code 123
// COL_ID is the Table control column used to list the devices
IF BTConnectDevice(COL_ID, "123") = True THEN
	// OBEX connection to the device according to the MAC address of the device
	nIDOBEXConnection = OBEXConnect(obexBluetooth, COL_MACAddress)
	...
	// OBEX disconnection
	OBEXDisconnect(nIDOBEXConnection)
	// Bluetooth disconnection
	BTDisconnectDevice(COL_ID)
ELSE
	// The Bluetooth connection failed
	Error("Unable to connect to the Bluetooth device", ErrorInfo(errFullDetails))
END
Syntax
<Result> = BTConnectDevice(<Device identifier> , <Password> [, <Radio identifier>])
<Result>: Boolean
  • True if the authentication was successful,
  • False otherwise. ErrorInfo returns more information on the error.
<Device identifier>: Integer
Identifier of the Bluetooth device to use. This identifier is returned by BTListDevice.
<Password>: Character string or Secret string
Password used for authentication. This password must be identical to the one entered on the Bluetooth device.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
<Radio identifier>: Optional integer
Identifier of Bluetooth radio to use. This identifier is returned by BTListRadio. If this parameter is not specified, the choice of radio is automatically performed.
Remarks
This version only supports Microsoft, Bluesoleil and Broadcom (Widcomm) bluetooth stacks. To know the stack used, call BTStack.
Broadcom (Widcomm) stacks are not available in 64-bit mode.
For more details, see Which stacks to use?
Component: wd300com.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/14/2025

Send a report | Local help