openharmony 鸿蒙 changelogs-usb

2023-02-03 浏览 (746)

USB服务子系统ChangeLog

cl.usb_manager.1 系统接口变更

USB系统API运行时鉴权,异步接口以Promise reject形式抛出错误码。

基于此前版本开发的应用,需修改函数的返回值,否则会影响原有业务逻辑。

关键接口/组件变更

包名旧接口新接口
ohos.usbV9.d.tsfunction setCurrentFunctions(funcs: FunctionType): Promise;function setCurrentFunctions(funcs: FunctionType): Promise;
ohos.usbV9.d.tsfunction setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise;function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise;

cl.usb_manager.2 sdk接口删除

继OpenHarmony 4.0.5.5版本3.30之后,@ohos.usbV9.d.ts文件已删除。

后续需要import @ohos.usbManager才能使用USB服务的接口:

import usbManager from '@ohos.usbManager';

适配指导

请参考各接口的API文档

你可能感兴趣的鸿蒙文章

harmony 鸿蒙web子系统ChangeLog

harmony 鸿蒙元能力子系统ChangeLog

harmony 鸿蒙蓝牙服务子系统ChangeLog

harmony 鸿蒙分布式数据管理子系统JS API变更Changelog

harmony 鸿蒙文件管理子系统ChangeLog

harmony 鸿蒙全球化子系统ChangeLog

harmony 鸿蒙媒体子系统ChangeLog

harmony 鸿蒙测试子系统ChangeLog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/de5435a2d7a4412a924be00110644536