How to get event for different baudrate?

人走茶凉 提交于 2020-02-04 22:18:32

问题


I am working on native android application. In this application I am connecting hardware devices using usb cable, for this connection I used below library: https://github.com/felHR85/UsbSerial

  • I have 3 different hardware devices and each device has different baudrate.

  • I have one scan button in app. If user click on it then I need to check which device is connected and print its information.

  • To implement this, I create 3 methods. Each method have same code with different baudrate.
  • When user click on scan button then it will call 1st method and check if the hardware is detected or not. If not detected then check with 2nd method.

Now the issue is, I am not getting any event if attached device is not connected with given baudrate. So I am not sure when I need to call 2nd method.

Note :- I am getting success if attached device baudrate is same as baudrate set in 1st method so its working. I need event like failed case. If I get any event if failed then I can call 2nd method in it but I am not getting any event like failed.

来源:https://stackoverflow.com/questions/59575956/how-to-get-event-for-different-baudrate

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