BluetoothLE

open class BluetoothLE

The class BluetoothLE is the only public interface of the de.testo.testolib.bluetooth package. Use an instance of this class to access the bluetooth functionality.

Constructors

Link copied to clipboard
constructor()
************************************* public c-tor

Functions

Link copied to clipboard
open fun cancelConnect(strDeviceAddress: String)
Cancel a currently running connect process of a ble device Execution type: asynchronous
Link copied to clipboard
open fun connect(strDeviceAddress: String)
Connect to a bluetooth low energy device.
Link copied to clipboard
open fun disconnect(strDeviceAddress: String)
Disconnect from a currently connected ble device Execution type: synchronous
Link copied to clipboard
open fun enableBluetooth()
Enable bluetooth on the device (asynchronous call) Execution type: asynchronous
Link copied to clipboard
open fun eraseFromConnectableDevicesList(strDeviceAddress: String)
Delete a device from the list of discovered devices.
Link copied to clipboard
Get all devices, discovered by the ble scan Execution type: synchronous
Link copied to clipboard
open fun getMtuSize(strDeviceAddress: String): Int
Get mtu size from connected device Execution type: synchronous
Link copied to clipboard
Find out, whether bluetooth is available on the device.
Link copied to clipboard
Find out, whether bluetooth is currently enabled on the device Execution type: synchronous
Link copied to clipboard
open fun isConnected(strDeviceAddress: String): Boolean
Find out, whether a device is connected Execution type: synchronous
Link copied to clipboard
open fun isConnecting(strDeviceAddress: String): Boolean
Find out, whether the connect process for a certain device is still in progress Execution type: synchronous
Link copied to clipboard
open fun onBtScanResult(callbackType: Int, result: ScanResult)
Link copied to clipboard
open fun readDataFromCharacteristic(strDeviceAddress: String, strServiceUuid: String, strCharacteristicUuid: String, nMaxReadSize: Int): Array<Byte>
Read the data from a certain characteristic.
Link copied to clipboard
open fun readNotificationData(strDeviceAddress: String, strCharacteristicUuid: String, nMaxReadSize: Int): Array<Byte>
Read data from the buffer received by notification Execution type: synchronous
Link copied to clipboard
open fun setCharacteristicMode(strDeviceAddress: String, strServiceUuid: String, strCharacteristicUuid: String, nUseNotificationsIndications: Int)
Set notifications for a certain characteristic Execution type: asynchronous
Link copied to clipboard
open fun setMtuSize(strDeviceAddress: String, nMtuSize: Int, bRequest: Boolean)
Set mtu size from connected device Execution type: synchronous
Link copied to clipboard
open fun setOption(strOption: String)
Set a connection option (as a replacement for patches in qt).
Link copied to clipboard
open fun startScan()
Start a bluetooth low energy scan Execution type: asynchronous
Link copied to clipboard
open fun stopScan()
Stop a running bluetooth low energy scan Execution type: asynchronous
Link copied to clipboard
open fun write(strDeviceAddress: String, strServiceUuid: String, strCharacteristicUuid: String, buffer: Array<Byte>, bWriteWithResponse: Boolean)
Write custom data to a device.