Class ConnectionHandler
-
- All Implemented Interfaces:
public final class ConnectionHandlerConnection handler handles connection states serialization, by using simple state pattern
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumConnectionHandler.ConnectionHandlerStateConnection handler state's
-
Field Summary
Fields Modifier and Type Field Description public final static LongGUARD_TIME_MSpublic final static IntegerPOLAR_PREFERRED_MTUpublic final static IntegerMTU_SKIP_NEGOTIATIONprivate ConnectionHandler.ConnectionHandlerStatestate
-
Constructor Summary
Constructors Constructor Description ConnectionHandler(ConnectionInterface connectionInterface, ScannerInterface scannerInterface, ConnectionHandlerObserver observer, CoroutineScope scope)
-
Method Summary
Modifier and Type Method Description final ConnectionHandler.ConnectionHandlerStategetState()final UnitsetState(ConnectionHandler.ConnectionHandlerState state)final UnitsetAutomaticReconnection(Boolean automaticReconnection)final BooleangetAutomaticReconnection()final Unitcancel()final UnitadvertisementHeadReceived(BDDeviceSessionImpl bleDeviceSession)final UnitconnectDevice(BDDeviceSessionImpl bleDeviceSession, Boolean bluetoothEnabled)final UnitdisconnectDevice(BDDeviceSessionImpl bleDeviceSession)final UnitconnectionInitialized(BDDeviceSessionImpl bleDeviceSession)final UnitphyUpdated(BDDeviceSessionImpl bleDeviceSession)final UnitservicesDiscovered(BDDeviceSessionImpl bleDeviceSession)final UnitmtuUpdated(BDDeviceSessionImpl bleDeviceSession)final UnitdeviceDisconnected(BDDeviceSessionImpl bleDeviceSession)-
-
Constructor Detail
-
ConnectionHandler
ConnectionHandler(ConnectionInterface connectionInterface, ScannerInterface scannerInterface, ConnectionHandlerObserver observer, CoroutineScope scope)
-
-
Method Detail
-
getState
final ConnectionHandler.ConnectionHandlerState getState()
-
setState
final Unit setState(ConnectionHandler.ConnectionHandlerState state)
-
setAutomaticReconnection
final Unit setAutomaticReconnection(Boolean automaticReconnection)
-
getAutomaticReconnection
final Boolean getAutomaticReconnection()
-
advertisementHeadReceived
final Unit advertisementHeadReceived(BDDeviceSessionImpl bleDeviceSession)
-
connectDevice
final Unit connectDevice(BDDeviceSessionImpl bleDeviceSession, Boolean bluetoothEnabled)
-
disconnectDevice
final Unit disconnectDevice(BDDeviceSessionImpl bleDeviceSession)
-
connectionInitialized
final Unit connectionInitialized(BDDeviceSessionImpl bleDeviceSession)
-
phyUpdated
final Unit phyUpdated(BDDeviceSessionImpl bleDeviceSession)
-
servicesDiscovered
final Unit servicesDiscovered(BDDeviceSessionImpl bleDeviceSession)
-
mtuUpdated
final Unit mtuUpdated(BDDeviceSessionImpl bleDeviceSession)
-
deviceDisconnected
final Unit deviceDisconnected(BDDeviceSessionImpl bleDeviceSession)
-
-
-
-