BluetoothSocketConnectionListener

interface BluetoothSocketConnectionListener

BluetoothSocketConnectionListener

Description :

This class represent the API for all actions/event related to Classic bluetooth. This interface is used with the STWBluetoothClassicManager in order to delegate event linked to classic bluetooth.

*

Example of use :

  • Implementation :
    
    BluetoothSocketConnectionListener mBluetoothSocketConnectionListener = new BluetoothSocketConnectionListener() {
    
    public String getLastConnectedBluetoothDeviceAddress() {
    //code ...
    }
    
    public void onSocketConnected() {
    //code ...
    }
    
    public void onSocketClosed() {
    //code ...
    }
    }
    
  • Registration :
    
     STWBluetoothClassicManager.getInstance.registerBluetoothSocketConnectionListenerCallback(mBluetoothSocketConnectionListener)
    
  • UnRegister :
    
     STWBluetoothClassicManager.getInstance.unregisterBluetoothSocketConnectionListener(mBluetoothSocketConnectionListener)
    

Functions

Link copied to clipboard
abstract fun getLastConnectedBluetoothDeviceAddress(): String
Called to get the connected device address
Link copied to clipboard
abstract fun onSocketClosed()
Callback triggered Socket is Disconnected.
Link copied to clipboard
abstract fun onSocketConnected()
Callback triggered when socket is Connected.