Dear all,
Hello,My development board is equipped with Android system,I write a serial test apk,this app can set the serial parameters like baudrate,but when I write or read data from the serial port I set ,
There was an error message:You do not have read/write permission to the serial port. How to solve the problem?Thank you !
The most likely cause of the issue is that the serial port hardware and corresponding I/O signals have not been properly initialized at the boot-up time. What exactly serial port are you trying to use? Please specify.
Have a great day,
Artur
I've tried many different ways according to some bbs suggestion such as modfying init.rc ,but the problem can't be solved.
the seria port what I used is the ttymxc2.If there are problem about initialization,therefore how to initialize at the boot-up time for the I/O singals .And the app can find the ttymxc2 and configure it .my system is android 4.3.
Hello Xingwei,
There are 2 ways to realize what you want , see following , please !
1. Operating Serial port on android application
The way is just like what you are using, but you should change the permission of read/write by console or add command in init.rc
2. Regular operation on android platform
On android platform, from JAVA application to hardware, the loading proceduer is JAVA--->JNI---->C/C++ lib---->hardware, so the better way for your application is to write a operational lib based on C/C++ to operate serial port , then convert the c/c++ lib to JAVA lib through NDK tool, after these jobs are done, your application can load JAVA lib for serial operation.
Hope above suggestions can help you !
If above suggestions can solve your problems, click "correct botton" or "Helpful button" to close the ticket !
Regards,
Weidong
this is the part of SerialPort.java.
When I operate the app on a button ,
there was an error message:You do not have read/write permission to the serial port.and the eclipse logcat show:
then ,I scan the system file ,find there is no the su file at /system/bin or /system/xbin. for this problem ,how to solve this problem.
Thanks for your reply,my android app of serial has already add the jni,after being compiled ,generated the .so file:libserial_port.so, so the application has had the c/c++ lib.