IBleEventCallBack

interface IBleEventCallBack

IBleEventCallBack

Description :

This interface represent the API for all event related to the BLE(Bluetooth Low Energy), it offers needed callback to handle BLE events.

Example of use :

  • Implementation :
    
    
                IBleEventCallBack mBleEventCallBack = new IBleEventCallBack() {
    public boolean shouldHandleActions() {
    // boolean : true : handle any received event
    //             false : abort received event
    }
    
    public void onButtonPressed() {
    //code ...
    }
    
    public void onButtonReleased() {
    //code ...
    }
    
    public void onPressPTT1() {
    //code ...
    }
    
    public void onReleasePTT1() {
    //code ...
    }
    
    public void onPressPTT2() {
    //code ...
    }
    
    public void onReleasePTT2() {
    //code ...
    }
    
    public void onSwitchNext() {
    //code ...
    }
    
    public void onSwitchPrevious() {
    //code ...
    }
    
    public void onPressMBF() {
    //code ...
    }
    
    public void onLongClickMBF() {
    //code ...
    }
    
    public void onPressSOS() {
    //code ...
    }
    
    public void onReleaseSOS() {
    //code ...
    }
    
    public void onPressStopSOS() {
    //code ...
    }
    
    public void onReleaseStopSOS() {
    //code ...
    }
    }
                
  • Registration:
    to register your callback you must call :
    
    
    
     STWBLEManager.getInstance().registerBleEventChanged(mBleEventCallBack);
    
    
  • Unregister:
    to unregister your callback you must call :
    
    
    
     STWBLEManager.getInstance().unregisterBleEventChanged(mBleEventCallBack);
    
     

Functions

Link copied to clipboard
abstract fun onLongClickMBF()
Callback triggered when receiving a Long Press MULTI_FUNCTION_BUTTON event.
Link copied to clipboard
abstract fun onPressMBF()
Callback triggered when receiving a Press MULTI_FUNCTION_BUTTON event.
Link copied to clipboard
abstract fun onPressPTT()
Callback triggered when receiving a PTT Press event.
Link copied to clipboard
abstract fun onPressPTT1()
Callback triggered when receiving a PTT 1 Press event.
Link copied to clipboard
abstract fun onPressPTT2()
Callback triggered when receiving a PTT 2 Press event.
Link copied to clipboard
abstract fun onPressSOS()
Callback triggered when receiving a Press Sos event.
Link copied to clipboard
abstract fun onPressStopSOS()
Callback triggered when receiving a Press STOP SOS event.
Link copied to clipboard
abstract fun onReleasePTT()
Callback triggered when receiving a PTT Press event.
Link copied to clipboard
abstract fun onReleasePTT1()
Callback triggered when receiving a PTT 1 Release event.
Link copied to clipboard
abstract fun onReleasePTT2()
Callback triggered when receiving a PTT 1 Release event.
Link copied to clipboard
abstract fun onReleaseSOS()
Callback triggered when receiving a Release Sos event.
Link copied to clipboard
abstract fun onReleaseStopSOS()
Callback triggered when receiving a Release STOP SOS event.
Link copied to clipboard
abstract fun onSwitchNext()
Callback triggered when receiving a Switch next event.
Link copied to clipboard
abstract fun onSwitchPrevious()
Callback triggered when receiving a Switch previous event.
Link copied to clipboard
abstract fun shouldHandleActions(): Boolean
Called every time receiving an event to check if we should handle event.