harmony 鸿蒙USB Subsystem API Changelog

  • 2023-02-03
  • 浏览 (562)

USB Subsystem API Changelog

cl.usb_manager.1 System API Change

Runtime authentication is performed for system APIs of the USB manager. An asynchronous API throws an error code via Promise.reject.

If your application is developed based on earlier versions, modify the return values of functions. Otherwise, the original service logic will be affected.

Key API/Component Changes

Bundle Name Original API New API
ohos.usbV9.d.ts function setCurrentFunctions(funcs: FunctionType): Promise; function setCurrentFunctions(funcs: FunctionType): Promise;
ohos.usbV9.d.ts function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise;

cl.usb_manager.2 SDK API Deletion

The @ohos.usbV9.d.ts file was deleted in OpenHarmony 4.0.5.5.

You need to import @ohos.usbManager to use USB service APIs.

  import usbManager from '@ohos.usbManager';

Adaptation Guide

For details about usage of each API, see the API Reference.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Web Subsystem ChangeLog

harmony 鸿蒙Ability Subsystem ChangeLog

harmony 鸿蒙Bluetooth Subsystem ChangeLog

harmony 鸿蒙Distributed Data Management Subsystem JS API Changelog

harmony 鸿蒙File Management Subsystem ChangeLog

harmony 鸿蒙Globalization Subsystem ChangeLog

harmony 鸿蒙Media Subsystem ChangeLog

harmony 鸿蒙Test Subsystem ChangeLog

0  赞