Getting USB Serial Port Parameters

别来无恙 提交于 2020-01-06 15:18:35

问题


I am trying to read the output stream from a GPS chip, attached to my computer via a USB cable, using the RXTX API.

My Java reads

sp.setSerialPortParams(4800, SerialPort.DATABITS_8,SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

My app currently outputs Scanning port /dev/tty.Bluetooth-Incoming-Port

So I believe my Bluetooth port is number 4800?

Running ls /dev/tty.*gives /dev/tty.usbserial only when the GPS is plugged in, so this is my device. I also see the Bluetooth device.

So I think I need to change the number in my Java code - how do I get the usbserial device number?

来源:https://stackoverflow.com/questions/21457448/getting-usb-serial-port-parameters

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