IDeviceEventCallback

interface IDeviceEventCallback

IDeviceEventCallback

Description :

This interface represent the API for all event related to Device event(Hardware button).

Example of use :

  • Implementation :
    
    
    
    IDeviceEventCallback mDeviceEventCallback = new IDeviceEventCallback() {
    
    public boolean shouldHandleActions() {
    //code ...
    }
    
    public void onPttButtonPressed() {
    //code ...
    }
    
    public void onPttButtonReleased() {
    //code ...
    }
    
    public void onSosButtonPressed() {
    //code ...
    }
    
    public void onSosButtonReleased() {
    //code ...
    }
    
    public void onPressNextSwitch() {
    //code ...
    }
    
    public void onPressPreviousSwitch() {
    //code ...
    }
    }
                
  • Registration:
    to register your callback you must call :
    
    
    
        STWSupportedDeviceManager.getInstance().registerForSupportedDevicesCallback(context, supportedHardwareList, mBleEventCallBack);
    
  • Unregister:
    to unregister your callback you must call :
    
    
    
        STWSupportedDeviceManager.getInstance().unregisterForSupportedDevices(context);
    

Functions

Link copied to clipboard
abstract fun onPressNextSwitch()
Callback triggered when switch next with device button
Link copied to clipboard
abstract fun onPressPreviousSwitch()
Callback triggered when switch previous with device button
Link copied to clipboard
abstract fun onPttButtonPressed()
Callback triggered when click (action down) on PTT device button
Link copied to clipboard
abstract fun onPttButtonReleased()
Callback triggered when click (action up) on PTT device button
Link copied to clipboard
abstract fun onSosButtonPressed()
Callback triggered when click (action down) on SOS device button
Link copied to clipboard
abstract fun onSosButtonReleased()
Callback triggered when click (action up) on SOS device button
Link copied to clipboard
abstract fun shouldHandleActions(): Boolean
Called every time receiving an event to check if we should handle event.