package llc.arma.ble.domain.usecase

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 WriteBle @Inject constructor(
    private val bleRepository: BleRepository
) {

    suspend operator fun invoke(
        serial: String,
        request: Ble.Thermometer.WriteRequest
    ): llc.arma.ble.domain.Result<Unit, BleException>{
        return bleRepository.writeBle(serial, request)
    }

    suspend operator fun invoke(
        serial: String,
        request: Ble.Beacon.WriteRequest
    ): llc.arma.ble.domain.Result<Unit, BleException>{
        return bleRepository.writeBle(serial, request)
    }

    suspend operator fun invoke(
        serial: String,
        request: Ble.Host.WriteRequest
    ): llc.arma.ble.domain.Result<Unit, BleException>{
        return bleRepository.writeBle(serial, request)
    }

    suspend operator fun invoke(
        serial: String,
        request: Ble.Accelerometer.WriteRequest
    ): llc.arma.ble.domain.Result<Unit, BleException>{
        return bleRepository.writeBle(serial, request)
    }

}