package com.adealink.weparty.hardware

import com.adealink.frame.base.Rlt

interface IHardwareManager {

    /**
     * 硬件资源是否可用(无占用)
     */
    fun checkHardwareAvailable(vararg hardwareList: Hardware): Rlt<Any>

    /**
     * 申请硬件资源并占用
     */
    fun requestHardware(
        client: HardwareClient,
        priority: HardwarePriority,
        hardware: Hardware,
        callback: HardwareRequestCallback?,
    )

    /**
     * 申请硬件资源并占用
     */
    suspend fun requestHardware(
        client: HardwareClient,
        priority: HardwarePriority,
        vararg hardwareList: Hardware,
    ): Rlt<Any>

    /**
     * 释放clientId持有的指定硬件
     */
    fun release(clientId: String, vararg hardwareList: Hardware)

    /**
     * 释放clientId持有的全部硬件资源
     */
    fun releaseAll(clientId: String)
}