BluetoothInterface

class BluetoothInterface @AssistedInject constructor(context: Application, bluetoothRepository: BluetoothRepository, service: RadioInterfaceService, analytics: PlatformAnalytics, @Assisted val address: String) : IRadioInterface(source)

Handles the bluetooth link with a mesh radio device. Does not cache any device state, just does bluetooth comms etc...

This service is not exposed outside of this process.

Note - this class intentionally dumb. It doesn't understand protobuf framing etc... It is designed to be simple so it can be stubbed out with a simulated version as needed.

Constructors

Link copied to clipboard
@AssistedInject
constructor(context: Application, bluetoothRepository: BluetoothRepository, service: RadioInterfaceService, analytics: PlatformAnalytics, @Assisted address: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun handleSendToRadio(p: ByteArray)
Link copied to clipboard
open override fun keepAlive()

If we think we are connected, but we don't hear anything from the device, we might be in a zombie state. This function forces a read of a characteristic to see if we are really connected.