智能家居与串口编程.md
— root root 2021-07-14 06:00 driver
-r–r–r– root root 0 2021-07-14 06:00 drivers 【此文件就是 串口的配置清单】
dr-xr-xr-x root root 2021-07-14 06:00 ldisc
-r–r–r– root root 0 2021-07-14 06:00 ldiscs
root@generic_x86:/proc/tty # cat drivers 【cat清单】
/dev/tty /dev/tty 5 0 system:/dev/tty
/dev/console /dev/console 5 1 system:console
/dev/ptmx /dev/ptmx 5 2 system
/dev/vc/0 /dev/vc/0 4 0 system:vtmaster
serial /dev/ttyS 4 64-67 serial 【①】
pty_slave /dev/pts 136 0-1048575 pty:slave
pty_master /dev/ptm 128 0-1048575 pty:master
unknown /dev/tty 4 1-63 console
root@generic_x86:/proc/tty # cd /dev/ 【切换目录】
root@generic_x86:/dev # ls | grep ttyS 【找到ttyS相关文件】
ttyS0
ttyS1
ttyS2
ttyS3
1 |
|
注意,Android虚拟机的系统需要ROOT权限,我使用的是Android 5.0
。如果版本太高,配置ROOT权限有些麻烦。
4. 调试助手工具集
5. 使用APP串口通信
串口APP代码
https://github.com/lautung/android-serialport-api
https://github.com/lautung/my-android-serial-port