Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Connect ttyS0? #4

Open
linwea opened this issue Nov 15, 2014 · 2 comments
Open

How to Connect ttyS0? #4

linwea opened this issue Nov 15, 2014 · 2 comments

Comments

@linwea
Copy link

linwea commented Nov 15, 2014

Hi,
my android device has RS232 com port(not USB to RS232),and Android-serialport-api can work in my deivce,I compile the source success,but the GNUIOtest.apk Always display "Can't find USB Serial Port",
How do I Modify the source to Connect ttyS0?
and in the source "CommPortIdentifier.getPortIdentifiers();" is return new CommPortEnumerator() ,the result is portIdentifiers always have not any Elements;the app can not find any port?
thank you very much!

@linwea linwea changed the title How can Connect ttyS0? How to Connect ttyS0? Nov 15, 2014
@huijizyf
Copy link

huijizyf commented Jun 2, 2016

I compile this code success ,and my android device has an RS232 port, it works on my device.you can set the SerialPortId as "/dev/ttyS0" to connect ttyS0,As the result of "Can't find USB Serial Port" I Think you haven't create the properties file named gnu.io.rxtx.properties in /system/etc/ directory. The properties file has to contain the following text.

gnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB3:/dev/ttyUSB4

That is import to make sure your program has the permission to read and write the directory of "/data/local/".

@tomato0127
Copy link

I compile this code success ,and my android device has an RS232 port, it works on my device.you can set the SerialPortId as "/dev/ttyS0" to connect ttyS0,As the result of "Can't find USB Serial Port" I Think you haven't create the properties file named gnu.io.rxtx.properties in /system/etc/ directory. The properties file has to contain the following text.

gnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyUSB3:/dev/ttyUSB4

That is import to make sure your program has the permission to read and write the directory of "/data/local/".
大神您好,请问这个您有不带日志输出的so库吗?这个死循环打印日志太恐怖了,我尝试下载源代码但是编译失败了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants