[問題] serial port 或 讀取USB資料(已解決)

看板AndroidDev作者 (懶人)時間13年前 (2012/03/28 00:56), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
想請問版上的大家 現在我想從一台 sensor 讀取資料 android 裝置為 USB host 那這台 sensor 會利用 USB 把資料傳送到電腦 (host) 那請問要怎利用 USB 去讀取/接收 sensor 的數據呢? 有 code 可以設計嗎? 或是版上有人知道要參考哪方面呢? google 提供的 serial port api 好像不行..... 平台是 TF101G android 3.0 or 4.0 謝謝回答 ----------------------------------- 自問自答 XD 如果要接 USB 從sensor讀取資料 與android溝通 我所查到的方式 1.android 裝置當 USB host 、 sensor 當 USB device 條件: (1)sensor 需是透過 USB 和 android裝置 溝通 (ex:arduino board:http://ppt.cc/Dovg) (2)android不用root,但需 android 3.0 以上版本 (3)程式碼易讀,簡單,需買 arduino 開發板 2.使用google提供的serial port api: 條件 (1)sensor 需是透過 serial port 和 android裝置 溝通 (ex:http://ppt.cc/xq43) (2)android需root,並且改kernal權限 chmod 777 ttyUSBX (TF101 為 ttyUSB6) (3)程式碼多,複雜,並要改kernal 3.IOIO (這個爬文應該可以了解) 以上 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.66.168.5

03/29 15:55, , 1F
應該可以用adb shell去撈資料
03/29 15:55, 1F
哈~感謝您囉~以自己找到解決方法了~~ 分享在板上 供有同樣問題的人 ※ 編輯: lazior 來自: 210.66.168.14 (03/29 16:20)
文章代碼(AID): #1FSV4Wyf (AndroidDev)