PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Special cases
  • Limitations
  • Required permissions
  • Threads and hourglass
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
BTListDevice (Function)
In French: BTListePériphérique
Returns the list of accessible Bluetooth devices.
Versions 16 and later
Android This function is now available for the Android applications.
Android Widget Caution:
  • The Bluetooth functions are not available in the Android emulator.
  • The management of Bluetooth is available from Android 2.0.
New in version 16
Android This function is now available for the Android applications.
Android Widget Caution:
  • The Bluetooth functions are not available in the Android emulator.
  • The management of Bluetooth is available from Android 2.0.
Android This function is now available for the Android applications.
Android Widget Caution:
  • The Bluetooth functions are not available in the Android emulator.
  • The management of Bluetooth is available from Android 2.0.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Example
sTmpString is string
sListDevices is string
// Returns the list of devices
HourGlass(True)
sListDevices = BTListDevice()
HourGlass(False)
// Clear the Table control where the devices are listed
TableDeleteAll(TABLE_Devices)
// Fills the Table control
IF sListDevices <> "" THEN
FOR EACH STRING sTmpString OF sListDevices SEPARATED BY CR
TableAdd(TABLE_Devices, sTmpString)
END
ELSE
Info(ErrorInfo(errFullDetails))
END
Syntax
<Result> = BTListDevice([<Level of Details> [, <Type of Elements to List> [, <Time-out> [, <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 + <Date Used 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:
  • <Device Identifier>: Identifier of the device, will be used in the Bluetooth functions that handle devices.
  • <MAC Address>: Physical address of the device.
  • <Name>: Name returned by the device (can be an empty string).
  • <Class Identifier>: Class of the device (32-bit integer used to get information about the type of device). 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
  • <Connected>: 1 if the device is currently "connected" to the current computer, 0 otherwise.
    AndroidAndroid Widget This information is not supported and it will always correspond to 0.
  • <Stored>: 1 if the device is currently "remembered" by the Bluetooth device of the current computer, 0 otherwise.
    AndroidAndroid Widget This information is not supported and it will always correspond to 0.
  • <Authenticated>: 1 if the device is currently authenticated beside the current computer, 0 otherwise.
  • <View Date>: Date and time when the device was viewed for the last time by the current computer. This date is in DDMMYYYYHHMMSS format. This information is supplied for the remembered devices only.
    AndroidAndroid Widget This information is not supported and it will always correspond to an empty string ("").
  • <Date Used>: Date and time when the device was last used for the last time. This date is in DDMMYYYYHHMMSS format. This information is supplied for the remembered devices only.
    AndroidAndroid Widget This information is not supported and it will always correspond to an empty string ("").
<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:
btStatusAuthenticatedProposes the authenticated devices.
btStatusConnectedProposes the connected devices.
AndroidAndroid Widget This constant is not available.
btStatusUnknownProposes the unknown devices.
btStatusRememberedProposes the remembered devices.
AndroidAndroid Widget This constant is not available.
btStatusAll
(Default value)
Proposes all the devices.
<Time-out>: Optional integer
Time-out 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.
Windows Mobile This parameter must not be specified. Indeed, a single Bluetooth radio is available for the mobile devices.
AndroidAndroid Widget This parameter is not supported and it will be ignored if it is specified.
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 <Time-out> 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 Only the Microsoft, Bluesoleil and Broadcom (Widcomm) bluetooth stacks are supported by this version. The Broadcom (Widcomm) stacks are not available in 64 bits.
  • Windows Mobile Only the Microsoft bluetooth stacks are supported by this function. In most cases, the Broadcom stacks (Widcomm) are not supported (except for some rare cases).
  • To find out the stack used, call BTStack.
  • See Which stacks to use? for more details
Versions 16 and later
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permissions :
  • BLUETOOTH: this permission allows the applications to connect to the Bluetooth services.
  • BLUETOOTH_ADMIN: this permission allows the applications to discover and connect the Bluetooth services.
New in version 16
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permissions :
  • BLUETOOTH: this permission allows the applications to connect to the Bluetooth services.
  • BLUETOOTH_ADMIN: this permission allows the applications to discover and connect the Bluetooth services.
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permissions :
  • BLUETOOTH: this permission allows the applications to connect to the Bluetooth services.
  • BLUETOOTH_ADMIN: this permission allows the applications to discover and connect the Bluetooth services.
Versions 16 and later
AndroidAndroid Widget

Threads and hourglass

If the function is run by the main thread of the application, an hourglass (infinite progress bar) will be displayed during the detection of bluetooth devices.
To specify the message that will be displayed in the hourglass, use NextTitle just before the call to BTListDevice.
New in version 16
AndroidAndroid Widget

Threads and hourglass

If the function is run by the main thread of the application, an hourglass (infinite progress bar) will be displayed during the detection of bluetooth devices.
To specify the message that will be displayed in the hourglass, use NextTitle just before the call to BTListDevice.
AndroidAndroid Widget

Threads and hourglass

If the function is run by the main thread of the application, an hourglass (infinite progress bar) will be displayed during the detection of bluetooth devices.
To specify the message that will be displayed in the hourglass, use NextTitle just before the call to BTListDevice.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Android wd230android.jar
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment