BluetoothRepository

@Singleton
class BluetoothRepository @Inject constructor(application: Application, bluetoothAdapterLazy: Lazy<BluetoothAdapter?>, bluetoothBroadcastReceiverLazy: Lazy<BluetoothBroadcastReceiver>, dispatchers: CoroutineDispatchers, processLifecycle: Lifecycle) : Logging

Repository responsible for maintaining and updating the state of Bluetooth availability.

Constructors

Link copied to clipboard
@Inject
constructor(application: Application, bluetoothAdapterLazy: Lazy<BluetoothAdapter?>, bluetoothBroadcastReceiverLazy: Lazy<BluetoothBroadcastReceiver>, dispatchers: CoroutineDispatchers, processLifecycle: Lifecycle)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val state: StateFlow<BluetoothState>

Functions

Link copied to clipboard
@RequiresPermission(value = "android.permission.BLUETOOTH_CONNECT")
fun createBond(device: BluetoothDevice): Flow<Int>
Link copied to clipboard
Link copied to clipboard
fun isValid(bleAddress: String): Boolean
Link copied to clipboard
Link copied to clipboard
fun scan(): Flow<ScanResult>