關於http://code.google.com/p/android-serialport-api/有個可讀寫串口的API 遇到的問題以及解決辦法

來源:互聯網
上載者:User
參考文章

http://bbs.csdn.net/topics/320267733我試過在串口終端chmod 777 /dev/s3c2410_serial0chmod 777 /dev/s3c2410_serial1chmod 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_serial0chmod 777 /dev/s3c2410_serial1chmod 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。
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.