关于http //code google com/p/android-serialport-api/有个可读写串口的AP

               
参考帖子
我试过在串口终端
chmod 777 /dev/s3c2410_serial0
chmod 777 /dev/s3c2410_serial1
chmod 777 /dev/s3c2410_serial2——Sate210 调试串口,也可以当做普通串口用
chmod 777 /dev/s3c2410_serial3
这样 http://code.google.com/p/android-serialport-api/有个可读写串口的API
编译出的串口apk 就可以使用,不会提示 you do not hava read/write permission to the serial port
了!
不过重启后,又会提示 you do not hava read/write permission to the serial port
只能重新再在串口终端逐一输入
chmod 777 /dev/s3c2410_serial0
chmod 777 /dev/s3c2410_serial1
chmod 777 /dev/s3c2410_serial2——Sate210 调试串口,也可以当做普通串口用
chmod 777 /dev/s3c2410_serial3
不过也有解决办法,就是修改内核在
1·要重新编APK文件      

工程copy到NDK的samples中, 修改jni下的SerialPort.c文件

其中一行改为open(path_utf,O_RDWR | O_SYNC); 去掉中间选项

重新编译生成 ***.apk文件, 装载就行啦!

2·要更改权限

在根目录下init.rc文件的最后添加命令,修改serail_uart0 读写权限。保存,重启reboot。
           

猜你喜欢

转载自blog.csdn.net/qq_44884287/article/details/89294981