讨论广场 问答详情
鸿蒙4.0:插入usb指纹仪,底层驱动能识别,但是ohos.usbManager.getDevices无法获取到该设备
respect_for_linus 2024-10-18 18:13:09
114 评论 分享

lsusb 能正常获取到该usb设备的pid  vid,但是ohos.usbManager.getDevices无法获取到该设备。

后面换了其他usb设备插入,例如usb摄像头,ohos.usbManager.getDevices能正常获取

 

并且指纹插入时,我看到hilog有很多报错,截取部分片段如下:完整部分在附件

08-05 17:43:22.936   483   586 I C02500/USB_RAW_API_LIBRARY: RawInit: created default context
08-05 17:43:22.936   483   586 E C02500/USB_INTERFACE_POOL: IfFindInterfacePool:348 interface pool list is empty
08-05 17:43:22.937   483   586 E C02500/USB_RAW_API_LIBRARY: RawUsbMemFree:1604 mem is null.
08-05 17:43:22.938   483   586 E C02500/USB_RAW_API_LIBRARY: RawGetConfigDescriptor:<private> invalid param
08-05 17:43:22.939   483   586 E C02500/USB_INTERFACE_POOL: IfGetInterfacePool:760 UsbProtocalParseDescriptor failed, ret = <private>
08-05 17:43:22.939   483   586 E C02500/USB_INTERFACE_POOL: ClaimInterface:993 interfacePool or interfacePool->device is null
08-05 17:43:22.939   483   586 E C02500/Usbd: GetUsbInterfaceById: UsbClaimInterface failed
08-05 17:43:22.939   483   586 E C02500/Usbd: UsbdClaimInterfaces:GetUsbInterfaceById nullptr
08-05 17:43:22.939   483   586 E C02500/Usbd: UsbdInit:UsbdClaimInterfaces failed ret:-1
08-05 17:43:22.939   483   586 E C02500/Usbd: FunAttachDevice:UsbInit failed ret:-1
08-05 17:43:22.939   483   586 E C02500/Usbd: UsbdBulkASyncListReleasePort: port or port->bulkASyncList is nullptr
08-05 17:43:22.939   483   586 I C02500/Usbd: ReportUsbdSysEvent: UsbdDeviceCreateAndAttach failed
08-05 17:43:22.943   483   586 E C02500/usb_interface_stub: UsbInterfaceStubOpenDevice_ failed, error code is -202
08-05 17:43:22.944   707   707 E C01510/BinderInvoker: 124: SendRequest: handle=2 result = -202
08-05 17:43:22.944   707   707 E C02500/usb_interface_proxy: OpenDevice_ failed, error code is -202
08-05 17:43:22.944   707   707 E C02904/UsbService: [usb_service.cpp] GetDeviceInfo# OpenDevice failed ret=-202
08-05 17:43:22.944   707   707 I C02904/UsbService: [usb_service.cpp] AddDevice# GetDeviceInfo ret=-202
08-05 17:43:22.944   707   707 W C02904/UsbService: [usb_service.cpp] UnLoadSelf# not need unload
08-05 17:43:22.945   254   698 I C02d10/HiView-SysEventSource: Parser: parser result domain_=HDF_USB eventName_=RECOGNITION_FAIL
08-05 17:43:22.945   483   586 I C02500/USB_RAW_API_LIBRARY: RawInit: created default context
08-05 17:43:22.945   483   586 E C02500/USB_INTERFACE_POOL: IfFindInterfacePool:348 interface pool list is empty
08-05 17:43:22.946   483   586 E C02500/USB_RAW_API_LIBRARY: RawUsbMemFree:1604 mem is null.
08-05 17:43:22.947   483   586 E C02500/USB_RAW_API_LIBRARY: RawGetConfigDescriptor:<private> invalid param
08-05 17:43:22.947   483   586 E C02500/USB_INTERFACE_POOL: IfGetInterfacePool:760 UsbProtocalParseDescriptor failed, ret = <private>
08-05 17:43:22.948   254   698 I C02d10/HiView-SysEventSource: Parser: parser result domain_=HDF_USB eventName_=RECOGNITION_FAIL_STATISTICS
08-05 17:43:22.949   254   698 I C02d10/HiView-SysEventSource: CheckValidSysEvent: HandleEventJson fail
08-05 17:43:22.949   483   586 E C02500/USB_INTERFACE_POOL: ClaimInterface:993 interfacePool or interfacePool->device is null
08-05 17:43:22.950   483   586 E C02500/Usbd: GetUsbInterfaceById: UsbClaimInterface failed
08-05 17:43:22.950   483   586 E C02500/Usbd: UsbdClaimInterfaces:GetUsbInterfaceById nullptr
08-05 17:43:22.950   483   586 E C02500/Usbd: UsbdInit:UsbdClaimInterfaces failed ret:-1

  麻烦大佬们分析一下

 

114 评论 分享
相关文件下载
usb_hilog_err.rar
1.45 KB
下载
写回答
全部评论(10)

已经解决了。是oh 底层没有默认把cdc驱动编j'q

2024-10-23 14:59:26
2024-11-23 15:57:15
我遇到了你同样的报错打印,不过我的是CD-ROM设备,底层也能识别出CD-ROM,就是ohos.usbManager.getDevices无法获取到该设备,请问你是在哪里修改启动cdc驱动的呀
2024-11-23 15:57:15
2024-10-24 10:42:09
好的 感谢回复
2024-10-24 10:42:09

后面调用了libusb,编了个Linux  demo程序出来测试,结果如下图:

2024-10-21 15:15:23
2 楼

只有指纹仪会出现这种情况吗?

2024-10-21 11:34:07
2024-10-22 20:52:30
引用:“像usb摄像头、usb打印机都可以,u盘也出现这个情况”
你传的log怎么像是audio的传错了吧
2024-10-22 20:52:30
2024-10-22 15:58:08
引用:“像usb摄像头、usb打印机都可以,u盘也出现这个情况”
可能和这些error有关
2024-10-22 15:58:08
2024-10-21 15:09:41
像usb摄像头、usb打印机都可以,u盘也出现这个情况
2024-10-21 15:09:41

指纹仪对应的USB驱动适配吗

2024-10-21 11:23:48
2024-10-21 15:18:54
问了厂商,是免驱的
2024-10-21 15:18:54