ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / BTLE functions
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the current Bluetooth activation status on the device or asks to be notified when the activation status changes.
Remarks:
  • To enable or disable the Bluetooth on the device, use BTActivate.
  • Bluetooth functions are not available in the Android emulator.
  • In Windows, use BTStatus to get the Bluetooth status.
Example
StatusBTLE is int
StatusBTLE = BTLEStatus()
SWITCH StatusBTLE
CASE btEnabled
// Process
OTHER CASE
...
END
Syntax

Finding out the current activation status of Bluetooth on the device Hide the details

<Result> = BTLEStatus()
<Result>: Integer constant
Bluetooth LE activation status:
btActivationInProgressThe Bluetooth is being enabled on the device.
btDeactivationInProgressThe Bluetooth is being disabled on the device.
btDisabledThe Bluetooth is disabled on the device.
btEnabledThe Bluetooth is enabled on the device.
btErrorThe Bluetooth activation status could not be retrieved.
btNotInitializedThe initialization of Bluetooth Low Energy was not performed.

Enabling the notification whenever Bluetooth activation changes Hide the details

BTLEStatus(<WLanguage procedure>)
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback" procedure) that will be called when the Bluetooth activation status changes on the device. For more details on this procedure, see Parameters of the procedure used by BTLEStatus.
If this parameter corresponds to an empty string (""), the notifications will not be sent anymore when the status changes. The function has no effect if no notification request was performed.
Remarks
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.
Related Examples:
WM Bluetooth 4 Cross-platform examples (WINDEV Mobile): WM Bluetooth 4
[ + ] This example explains how to use the Bluetooth Low Energy functions (Bluetooth LE): BTLExxx.

It is an application allowing you to find the nearby BTLE devices, to connect to them and to interact with the proposed services.
Component: wd290android.aar
Minimum version required
  • Version 21
Comments
Click [Add] to post a comment

Last update: 06/27/2023

Send a report | Local help