PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Various
  • Required permissions
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
Used to connect to a Bluetooth Low Energy device.
Two syntaxes are available:
  • Syntax 1: Locking connection.
  • Syntax 2: Non-locking connection. This syntax is used to connect to a Bluetooth device from its physical address. You can for example connect the application to a device whose physical address was stored during a previous detection (with BTLEListDevice) as soon as this device is switched on and/or enters in the detection area of device.
Example
myDevice is BTLEDevice
BTLEConnect(myDevice)
Syntax

Connecting to a Bluetooth Low Energy device (locking connection) Hide the details

<Result> = BTLEConnect(<Device> [, <Time-out>])
<Result>: Boolean
  • True if the connection was established,
  • False otherwise. ErrorInfo returns more details about the problem.
<Device>: btleDevice variable
Name of btleDevice variable representing the Bluetooth Low Energy device with which the connection will be established. This device was detected by BTLEListDevice.
<Time-out>: Optional integer or optional Duration
Connection time-out (in milliseconds). If the connection was not established during this time-out, <Result> is set to False.
If this parameter is not specified, the default connection time-out is set to 5 seconds.
This parameter can correspond to:
  • an integer corresponding to the number of milliseconds,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).

Connecting to a Bluetooth Low Energy device (non-locking connection) Hide the details

BTLEConnect(<Device> , <WLanguage Procedure>)
<Device>: btleDevice variable or character string
  • Name of btleDevice variable representing the Bluetooth Low Energy device with which the connection will be established.
  • Identifier of Bluetooth Low Energy device with which the connection will be established (..Identifier property of btleDevice type).
    iPhone/iPad Caution: The device must have been identified by BTLEListDevice since the start of application.
There is no need for the device to be accessible during the call: the connection will be established as soon as the device is accessible. The procedure will be called whenever the device is switched on and/or whenever it enters in the detection area of device.
<WLanguage Procedure>: Character string (with or without quotes)
Name of the WLanguage procedure ("callback" procedure) that will be called when connecting to the Bluetooth Low Energy device.
This procedure has the following format:
PROCEDURE <Procedure Name> (<Device>, <Result>)
where:
  • <Device> is a btleDevice variable corresponding to the connected Bluetooth device.
  • <Result> is a boolean variable:
    • True if the connection was established,
    • False otherwise. ErrorInfo returns more details about the problem.
Remarks

Various

  • Android The WLanguage Bluetooth Low Energy functions are available for the devices running an Android version greater than or equal to version 4.3 (api level 18).
    • A fatal error will occur if the function is used with an earlier system version.
    • To find out the version of Android system on which the application is run, use SysAndroidVersion.
  • iPhone/iPad The WLanguage Bluetooth Low Energy functions are available from iOS 9.
Android

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: BLUETOOTH.
This permission allows the applications to connect to the Bluetooth services.
Components
Android wd230android.jar
Minimum required version
  • Version 21
Comments
Click [Add] to post a comment