From a5920fb8e92361f34c10f6d950c78f770890fd00 Mon Sep 17 00:00:00 2001 From: Anduin1109 Date: Thu, 28 Aug 2025 17:06:25 +0800 Subject: [PATCH] add usb authorize HDI interface Signed-off-by: Anduin1109 --- usb/v2_0/IUsbDeviceInterface.idl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/usb/v2_0/IUsbDeviceInterface.idl b/usb/v2_0/IUsbDeviceInterface.idl index 1b3c9244..09ebc69f 100644 --- a/usb/v2_0/IUsbDeviceInterface.idl +++ b/usb/v2_0/IUsbDeviceInterface.idl @@ -30,6 +30,7 @@ package ohos.hdi.usb.v2_0; +import ohos.hdi.usb.v2_0.UsbTypes; import ohos.hdi.usb.v2_0.IUsbdSubscriber; interface IUsbDeviceInterface { @@ -108,4 +109,32 @@ interface IUsbDeviceInterface { * @version 1.0 */ UnbindUsbdDeviceSubscriber([in] IUsbdSubscriber subscriber); + + /* * + * @brief Manage the authorization of the USB device. + * + * @param devNum Indicates the bus number of the USB device. + * @param devAddr Indicates the USB device address. + * @param authorized Indicates whether to authorize the USB device. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 6.0 + * @version 1.0 + */ + UsbDeviceAuthorize([in] unsigned char busNum, [in] unsigned char devAddr, [in] boolean authorized); + + /* * + * @brief Manage the authorization of the interface of the USB device. + * + * @param dev Indicates the USB device. + * @param configId Indicates the config ID of the target interface. + * @param interfaceId Indicates the ID of the target interface. + * @param authorized Indicates whether to authorize the interface. + * + * @return Returns 0 if the operation is successful; returns a non-0 value if the operation fails. + * @since 6.0 + * @version 1.0 + */ + UsbInterfaceAuthorize([in] struct UsbDev dev, [in] unsigned char configId, [in] unsigned char interfaceId, [in] boolean authorized); + } \ No newline at end of file -- Gitee