— 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
2
3
4
5
6
7
8
9
10
11

①一般跳线开发都是这个,否则vga转usb就是:ttySAC(ttySAC1,ttySAC2,ttySAC3)。 我们当前是使用虚拟机。

### 2. 虚拟串口驱动

[Configure Virtual Serial Port Driver](https://lautung.com/archives/%E8%99%9A%E6%8B%9F%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8)

### 3. 模拟串口开发板系统的启动

```bash
PS C:\Users\lautung> D:\Android\Sdk\emulator\emulator.exe -avd Pixel_XL_API_22 -qemu -serial COM2



注意,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