Android访问带有串口的设备;

时间:2013-06-05 13:06:59

标签: android serial-port

我正在尝试使用串口api:

从串口读取数据

http://code.google.com/p/android-serialport-api

但是,从我的Android应用程序访问设备时遇到问题。 当我使用SerialPortFinder时,它是我找到的设备的日志。

02-28 08:56:52.394: I/global(2237): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
02-28 08:56:52.394: D/SerialPort(2237): Found new driver rfcomm on /dev/rfcomm
02-28 08:56:52.399: D/SerialPort(2237): Found new driver usbserial on /dev/ttyUSB
02-28 08:56:52.399: D/SerialPort(2237): Found new driver acm on /dev/ttyACM
02-28 08:56:52.399: D/SerialPort(2237): Found new driver ttySAC on /dev/s3c2410_serial
02-28 08:56:52.399: D/SerialPort(2237): Found new driver serial on /dev/ttyS
02-28 08:56:53.074: D/SerialPort(2237): Found new device: /dev/s3c2410_serial3
02-28 08:56:53.074: D/SerialPort(2237): Found new device: /dev/s3c2410_serial2
02-28 08:56:53.074: D/SerialPort(2237): Found new device: /dev/s3c2410_serial1
02-28 08:56:53.074: D/SerialPort(2237): Found new device: /dev/s3c2410_serial0
02-28 08:56:53.204: D/SerialPort(2237): Found new device: /dev/ttyS3
02-28 08:56:53.204: D/SerialPort(2237): Found new device: /dev/ttyS2
02-28 08:56:53.204: D/SerialPort(2237): Found new device: /dev/ttyS1
02-28 08:56:53.204: D/SerialPort(2237): Found new device: /dev/ttyS0

我的android(2.1)设备有一个rs232端口,波特率为2400;。

当我使用“new SerialPort(new File(deviceName),baudrate,0);”

我可以访问的唯一门是“/ dev / s3c2410_serial0”。

但是,这扇门与我的设备无关。

任何人都知道如何找到正确的端口,或者我做错了什么?

1 个答案:

答案 0 :(得分:0)

我的问题在于权限,只需在android上解锁我的root用户,它就可以了!

相关问题