- Required versions
- Required permissions
In french: BTLEListePériphérique
Returns the list of accessible Bluetooth Low Energy devices.
INTERNAL PROCÉDURE ProcDetectDevice(ADevice)
// Process ADevice
BTLEListDevice(<WLanguage procedure> [, <Timeout>])
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called to list the devices. This procedure is used to get information about the devices found.
This procedure has the following format:
PROCEDURE <Procedure name> (<Device>, <Signal intensity>)
If the procedure returns False, the analysis of accessible devices will be immediately stopped.
- <Device> is a btleDevice variable corresponding to the connected device.
- <Signal intensity> is an integer corresponding to the intensity of signal expressed in decibel per meter.
<Timeout>: Optional integer or optional Duration
Timeout for the search (in seconds). This parameter can correspond to:
If this parameter is not specified, the default timeout is set to 10 seconds.
- an integer corresponding to the number of seconds,
- a Duration variable,
- the duration in a readable format (e.g., 1 s).
If BTLEListDevice is called when an analysis is in progress, the previous analysis will be stopped and a new analysis will be started.
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.
- ACCESS_COARSE_LOCATION: this permission allows an application to access an undefined location (Cell-ID, WiFi).
Android 11 specific case:
This function requires the ACCESS_BACKGROUND_LOCATION permission to access the device's location.
This permission allows using the function when the application is in the background.
If the application needs to use background location:
A window allows users to:
- Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
- Explicitly request background location permission with PermissionRequest. For example:
INTERNAL PROCEDURE Callback(p is Permission)
IF p.Granted THEN
// Functions that require background location access can be used
- allow access to the device location while the application is in the background,
- allow access to the location only while the application is in use,
- deny access to the location. The user can also change these permissions at any time in the Android settings.
- Follow Google's guidelines for applications that require background location access. For more details, see https://support.google.com/googleplay/android-developer/answer/9799150. If these conditions are not met (especially user information requirements), applications may not be accepted for publication on Google Play.
- The background location permission should only be requested if the location permission has been granted. Otherwise, PermissionRequest will fail.
- If the option chosen by the user for the background location access request is more restrictive than the option chosen for the location access request, the application will be automatically restarted.
- On devices running Android 10 or earlier, if location permission has been granted to the application, the background location permission will be granted without displaying a window.
Business / UI classification: Business Logic
This page is also available for…