STWSupportedDeviceManager

open class STWSupportedDeviceManager

STWSupportedDeviceManager

Description :

Public Class which handles hardware buttons actions for rugged devices using broadcast receivers. List of device that can be supported by the hardware module is :

  • CROSSCALL ACTION X3
  • CROSSCALL CORE X3
  • CROSSCALL TREKKER X4
  • RUGGEAR RG740B
  • RUGGEAR RG655
  • RUGGEAR RG760
  • RUGGEAR RG720
  • RUGGEAR RG725
  • KYOCERA
  • TELO TE590
  • TELO M5
  • SONIM XP8800
  • SONIM XP7700
  • ATEX PTE300
  • ATEX PTE500
  • BITTIUM
  • CYRUS
  • CYBERTEL
  • CAT
See : SupportedDeviceName.

Example of use

  • To add the Support of SWhardware module to your project, include the following line in the dependencies block of your build.gradle file:
     
    
     dependencies {
          implementation project(':swhardware')
     }
    
  • 
    Set<Integer> supportedDeviceNameSet = STWSupportedDeviceManager.getInstance().getAllSupportedDevices();
    STWSupportedDeviceManager.getInstance().registerForSupportedDevicesCallback(getContext(), supportedDeviceNameSet, new IDeviceEventCallback() {
    
         public boolean shouldHandleActions() {
    //Code... (return true or false to block/unblock reception of callbacks)
             return true;
         }
    
         public void onPttButtonPressed() {
    //Code...
         }
    
         public void onPttButtonReleased() {
    //Code...
         }
    
         public void onSosButtonPressed() {
    //Code...
         }
    
         public void onSosButtonReleased() {
    //Code...
         }
    
         public void onPressNextSwitch() {
    //Code...
         }
    
         public void onPressPreviousSwitch() {
    //Code...
         }
    
         });
    
  • 
            STWSupportedDeviceManager.getInstance().unregisterForSupportedDevices(getContext());
    

Functions

Link copied to clipboard
open fun getAllSupportedDevices(): Set<Integer>
list of supported device names that can be registered for click on buttons events callback
Link copied to clipboard
open fun getDeviceConfiguration(): STWDeviceConfiguration
get the current device configuration
Link copied to clipboard
open fun getInstance(): STWSupportedDeviceManager
Link copied to clipboard
open fun onPttButtonPressed()
Link copied to clipboard
open fun onPttButtonReleased()
Link copied to clipboard
open fun onSosButtonPressed()
Link copied to clipboard
open fun onSosButtonReleased()
Link copied to clipboard
open fun onSwitchNext()
Link copied to clipboard
open fun onSwitchPrevious()
Link copied to clipboard
open fun registerForSupportedDevicesCallback(    @NonNull context: Context,     @Nullable supportedHardwareList: Set<Integer>,     @Nullable iHardwareActionCallback: IDeviceEventCallback)
Call this method to register for events related to click on supported devices buttons
Link copied to clipboard
open fun setAutoSupportDeviceConfiguration(    @NonNull context: Context,     @NonNull packageName: String,     @NonNull deviceJsonContent: String,     @NonNull configurationJsonContent: String,     @NonNull hardwareEventListener: HardwareEventListener)
Call this method to register for events related to click auto support devices buttons
open fun unregisterForAutoSupportDeviceConfiguration(@NonNull context: Context)
Call this method to unregister from events related to click on auto support devices buttons and configuration
Link copied to clipboard
open fun unregisterForSupportedDevices(@NonNull context: Context)
Call this method to unregister from events related to click on supported devices buttons