这里http://code.google.com/p/android-serialport-api/有个可读写串口的API。 我下下来在模拟器上试了一下,一直出现这样的错误:“you do not hava read/write permission to the serial port”.谁知道什么原因吗?为啥没权限,代码里面已经有: "chmod 666 " + device.getAbsolutePath() + "\n"这句了。
这里http://code.google.com/p/android-serialport-api/有个可读写串口的API。 我下下来在模拟器上试了一下,一直出现这样的错误:“you do not hava read/write permission to the serial port”.谁知道什么原因吗?为啥没权限,代码里面已经有: "chmod 666 " + device.getAbsolutePath() + "\n"这句了。
我在手机上试了下,开始提示you do not hava read/write permission to the serial port,chmod 777 后可以执行
你是在用gsm modern 吗?
我下下来在模拟器上试了一下,一直出现这样的错误:“you do not hava read/write permission to the serial port”.谁知道什么原因吗?为啥没权限,代码里面已经有: "chmod 666 " + device.getAbsolutePath() + "\n"这句了。
我下下来在模拟器上试了一下,一直出现这样的错误:“you do not hava read/write permission to the serial port”.谁知道什么原因吗?为啥没权限,代码里面已经有: "chmod 666 " + device.getAbsolutePath() + "\n"这句了。
我在手机上试了下,开始提示you do not hava read/write permission to the serial port,chmod 777 后可以执行
请问您在哪修改呀,我是修改了这句代码:
String cmd = "chmod 777 " + device.getAbsolutePath() + "\n"
+ "exit\n";
依然是没有读写权限,难道是模拟器上不支持?
String cmd = "chmod 777 " + device.getAbsolutePath() + "\n"+ "exit\n";
请问你是如何把它的整个文件下下来的额。
谢谢!
2、修改init.rc 这个文件。。希有人能把这个文件修改的方法贴出来。帮大家解决这个问题。
我只能下载apk文件
请问你的第一点有什么作用呢?
第二点你是如何通过修改init.rc来修改权限了,在实体机上这个只读文件很困难。
请问你能不能专门说明下
比如我的android应用通过NDK+JNI方式去给串口发AT指令
if (mInputStream == null)
return;
// InputStreamReader ipsr = new InputStreamReader(mInputStream);
// BufferedReader br = new BufferedReader(ipsr);
// String[] str = new String[10];
// int i = 0;
// while (i < 10){
// Log.e("port_TAG", "-->"+i);
// str[i] = br.readLine();
// i++;
// if (i == 10)
// System.out.println("Enough now");
// }
// Log.e("port_TAG", "-->"+str.toString());
// Log.e("port_TAG", "--------------------");
size = mInputStream.read(buffer);
Log.e("port_TAG", "SIZE:" + size);执行到mInputStream.read(buffer)就不继续往下执行了呢?
然后chomd -777 ttys2
在模拟器中就可以对ttys2进行读写了,但是现在遇到问题就是如何与模拟器的串口进行通信呢?
再点第二个button “Console” 就出现异常,程序挂了。如图:
再点第二个button “Console” 就出现异常,程序挂了。
求高手指点