package llc.arma.ble.domain.usecase

import kotlinx.coroutines.flow.Flow
import llc.arma.ble.domain.Result
import llc.arma.ble.domain.common.BleException
import llc.arma.ble.domain.model.Ble
import llc.arma.ble.domain.repository.BleRepository
import javax.inject.Inject

class GetBleBySerial @Inject constructor(
    private val bleRepository: BleRepository
) {

    suspend operator fun invoke(serial: String): Result<Flow<Ble>, BleException> =
        bleRepository.getBleBySerial(serial)

    sealed class GetBleException {

        object TimeOut : GetBleException()

        object BlePermissionDenied : GetBleException()

    }

}