ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Bluetooth
  • Special cases
  • Limitations
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
BTListDevice (Function)
In french: BTListePériphérique
Returns the list of accessible Bluetooth devices.
Example
sChaîneTmp is string
sListePériphs is string
// Liste les périphériques
HourGlass(True)
sListePériphs = BTListDevice()
HourGlass(False)
// Vide le champ Table où sont listés les périphériques
TableDeleteAll(TABLE_Appareils)
// Remplit le champ Table
IF sListePériphs <> "" THEN
	FOR EACH STRING sChaîneTmp OF sListePériphs SEPARATED BY CR
		TableAdd(TABLE_Appareils, sChaîneTmp)
	END
ELSE
	Info(ErrorInfo(errFullDetails)) 
END
Syntax
<Result> = BTListDevice([<Level of details> [, <Type of elements to list> [, <Timeout> [, <Radio identifier>]]]])
<Result>: Character string
  • List of available Bluetooth devices,
  • Empty string ("") if an error occurred. ErrorInfo returns more details about the problem.
This list has the following format:
  • in simple mode:
    <Device Identifier 1> + TAB + <MAC Address 1> + TAB + <Name 1> + CR + ...
    + CR + <Device Identifier N> + TAB + <MAC Address N> + TAB + <Name N>
  • in detailed mode:
    <Device Identifier 1> + TAB + <MAC Address 1> + TAB + <Name 1> + TAB +
    <Class 1 Identifier> + TAB + <Connected 1> + TAB + <Stored 1> + TAB +
    <Authenticated 1> + TAB + <View Date 1> + TAB + <Used Date 1> + CR + ... + CR +
    <Device N Identifier> + TAB + <MAC Address N> + TAB + <Name N> + TAB +
    <Class N Identifier> + TAB + <Connected N> + TAB + <Stored N> + TAB +
    <Authenticated N> + TAB + <View Date N> + TAB + <Date Used N>
The following information is returned:
  • <Identifiant Périphérique> Device identifier, to be used in Bluetooth functions handling devices.
  • <Adresse Mac> Physical address of the device.
  • <Nom>: Name returned by the device (can be an empty string).
  • <Identifiant Classe> Device class (integer out of 32 to obtain information on device type). This class can correspond to one of the following constants:
    • btCoD_NetworkAccess
    • btCoD_AudioVideo
    • btCoD_pers
    • btCoD_Imaging
    • btCoD_Unknown
    • btCoD_Toy
    • btCoD_Computer
    • btCoD_Device
    • btCoD_Phone
    • btCoD_Wearable
  • <Connecté>: 1 if the device is currently "connected" to the current station, 0 otherwise..
  • <Mémorisé>: 1 if the device is currently "memorized" by the Bluetooth manager of the current station, 0 otherwise..
  • <Authentifié>: 1 if the device is currently authenticated to the current workstation, 0 otherwise..
  • <Date vue> Date and time when the device was last seen by the current workstation. This date is in DDMMYYYYHHMMSS format. This information is supplied for the remembered devices only.
  • <Date utilisé> Date and time the device was last used. This date is in DDMMYYYYHHMMSS format. This information is supplied for the remembered devices only.
<Level of details>: Optional Integer constant
Level of result details:
btDetailedList<Result> contains the list of devices in detailed mode.
btSimpleList
(Default value)
<Result> contains the list of devices in simple mode.
<Type of elements to list>: Optional Integer constant (or combination of constants)
Status of the devices to select:
btStatusAll
(Default value)
Proposes all the devices.
btStatusAuthenticatedProposes the authenticated devices.
btStatusConnectedProposes the connected devices.
btStatusRememberedProposes the remembered devices.
btStatusUnknownProposes the unknown devices.
<Timeout>: Optional integer
Timeout in seconds (between 1 and 60) when searching for devices.
This parameter is set to 10 by default.
<Radio identifier>: Optional integer
Identifier of Bluetooth radio to use. This identifier is returned by BTListRadio.
Remarks

Special cases

  • An authenticated device is necessarily remembered (and not the other way around).
  • The devices are listed by interrogating the environment until the <Timeout> of the function. In this interval of time, the devices may not have sufficient time to communicate their identity. Then, all you have to do is use BTInfoDevice to get the missing information.

Limitations

  • Windows This version only supports Microsoft, Bluesoleil and Broadcom (Widcomm) bluetooth stacks. Broadcom (Widcomm) stacks are not available in 64-bit mode.
  • To know the stack used, call BTStack.
  • 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: 03/25/2025

Send a report | Local help