Connecting to a Usb peripheral

最后都变了- 提交于 2020-01-03 13:16:29

问题


It looks like the UsbManager is gone in the build. How do we communicate with usb peripherals now?

Things like usb->serial etc using https://github.com/mik3y/usb-serial-for-android


回答1:


Currently the Peripheral HAL doesn't recognize usbserial based UART peripherals.

But if your usbserial device (ex: Arduino) exposes individual UART TX RX pins, you can communicate with it using the UART Peripheral API.

Caveat:

  • Don't forget to cross TX and RX when connecting the peripheral to the UART board of your development board
  • On Raspberry Pi 3, the console needs to be disabled, see: UART peripherals on Android Things for Raspberry Pi 3



回答2:


It is stated on the known issues part of the release notes that USB support is disabled on the developer preview 1.

However I did a quick test on the Pi3 and high level peripherals such a keyboard work and send the correct events to the app. It is just the low level access what is disabled.




回答3:


As @devunwired commented in the Google's IoT Developers Community: USB accessory support is not currently enabled is the RC1 preview.



来源:https://stackoverflow.com/questions/41151610/connecting-to-a-usb-peripheral

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!