STWBluetoothManager

open class STWBluetoothManager

STWBluetoothManager

Description :

This class represent the API for all actions/event related to Bluetooth.


Example of use :

  • Implementation :
    
    STWBluetoothManager.getInstance().registerForBluetoothManagerEvents(context,
    private BluetoothManagerListener mBluetoothManagerListener = new BluetoothManagerListener() {
    
    public void onBluetoothAudioScoStateChanged() {
    
    //code
    
    }
    public void onBluetoothConnexionStatusChanged(boolean isConnected) {
    
    // code
    
    }
    public void onCheckExistConnectedDevice() {
    
    // if you use our module "swhardware" you can call the public method
    //  STWBLEManager.getInstance().checkConnectedDevices(context);
    
    }
    public BluetoothDevice getCurrentBluetoothDeviceConnected(){
    
    // if you use our module "swhardware" you can call the public method
    // return STWBluetoothClassicManager.getInstance().getCurrentBluetoothDeviceConnected(address)
    
    }
    });
    
  • Unregister :
    
            STWBluetoothManager.getInstance().unregisterForBluetoothManagerEvents(mBluetoothManagerListener);
            

Functions

Link copied to clipboard
open fun getInstance(): STWBluetoothManager
Get or create the single instance of STWBluetoothManager.
Link copied to clipboard
open fun registerForBluetoothManagerEvents(@NonNull bluetoothManagerListener: BluetoothManagerListener)
Register the specified listener to be notified by any Bluetooth event
Link copied to clipboard
open fun unregisterForBluetoothManagerEvents(@NonNull bluetoothManagerListener: BluetoothManagerListener)
Unregister the specified listener to not receive any Bluetooth events