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_NEGOTIATIONpublic final static LongCONNECTION_WATCHDOG_TIMEOUT_MSprivate ConnectionHandler.ConnectionHandlerStatestate
-
Constructor Summary
Constructors Constructor Description ConnectionHandler(ConnectionInterface connectionInterface, ScannerInterface scannerInterface, ConnectionHandlerObserver observer, CoroutineScope scope)
-
Method Summary
-
-
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)
-
connectDeviceDirect
final Unit connectDeviceDirect(BDDeviceSessionImpl bleDeviceSession, Boolean bluetoothEnabled)
Initiate a GATT connection directly by MAC address, bypassing the advertisement-connectable guard. Call this when the peripheral is known to be reachable (e.g. via CompanionDeviceManager) but has stopped advertising.
-
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)
-
-
-
-