|
|
|
|
|
BTLEConnectionStatus (Function) In french: BTLEEtatConnexion Returns the current status of the connection to a Bluetooth Low Energy device or asks to be notified when the connection status changes. Note: Bluetooth functions are not available in the Android emulator.
monPériph is btleDevice
BTLEConnect(monPériph)
...
SWITCH BTLEConnectionStatus(monPériph)
CASE btleStatusConnected
OTHER CASE
...
END
Syntax
Finding out the current connection status Hide the details
<Result> = BTLEConnectionStatus(<Device>)
<Result>: Integer constant Status of the connection: | | btleStatusConnected | The device is connected to the specified Bluetooth device. | btleStatusDisconnected | The device is not connected to the specified Bluetooth device. |
<Device>: btleDevice variable Name of the btleDevice variable corresponding to the device to use.
Enabling the notification whenever Bluetooth activation changes Hide the details
BTLEConnectionStatus(<WLanguage procedure>)
<WLanguage procedure>: Procedure name Name of WLanguage procedure (called "callback") called when Bluetooth connection status changes on the device. This procedure has the following format: PROCEDURE <Procedure name> (<Device>, <Status>) where: - <Device> is a btleDevice variable corresponding to the Bluetooth device whose status is retrieved.
- <Status> is an integer corresponding to the status of Bluetooth connection on the device:
| | btleStatusConnected | The device is connected to the specified Bluetooth device. | btleStatusDisconnected | The device is not connected to the specified Bluetooth device. |
There is no need to pass parameters to this procedure. Indeed, these parameters are automatically filled during each call. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|