IBluetoothLEConnectionStatusChanged

interface IBluetoothLEConnectionStatusChanged

IBluetoothLEConnectionStatusChanged

Description :

This interface represent the API for all actions/event related to Bluetooth LE. This interface is used with the STWBLEManager in order to delegate event linked to bluetooth LE.

Example of use :

  • Implementation :
    
    IBluetoothLEConnectionStatusChanged mBluetoothLeConnectionStatusChanged = new IBluetoothLEConnectionStatusChanged() {
    
    public void onConnectionStatusChanged(int connectionStatus) {
    // code ...
    }
    
    public void onBLEConnectionStopped() {
    // code ...
    }
    
    public void onBLEConnectionSuccess(BluetoothDevice bluetoothDevice) {
    // code ...
    }
    }
    
  • Registration :
    
            STWBLEManager.getInstance().registerBluetoothConnexionStatusChanged(context, mBluetoothLeConnectionStatusChanged);
            
  • Unregister :
    
            STWBLEManager.getInstance().unregisterBluetoothLEStatusChanged( mBluetoothLeConnectionStatusChanged);
            

Functions

Link copied to clipboard
abstract fun notifyBLEDisconnected()
Callback triggered when ble device is disconnect
Link copied to clipboard
abstract fun onBLEConnectionStopped()
Callback triggered when connection is Stopped
Link copied to clipboard
abstract fun onBLEConnectionSuccess(@Nullable bluetoothDevice: BluetoothDevice)
Callback triggered when connection is Established.
Link copied to clipboard
abstract fun onConnectionStatusChanged(connectionStatus: Int)
Callback triggered when Bluetooth connection status is changed Connection status can be :