android adb 指令串口相关

1、查看 串口波特率

busybox stty -F  /dev/ttyS0

 

stty - 改变并打印终端行设置
  总览
  stty [-F device] [--file=device] [SETTING]...
  stty [-F device] [--file=device] [-a|--all]
  stty [-F device] [--file=device] [-g|--save]
  描述
  quot; Add any additional description here
  打印或改变终端属性.
  -a, --all
  以可读的格式打印当前的所有设置
  -g, --save
  以终端可读的格式打印当前的所有设置
  -F, --file
  打开指定的设备,并用此设备作为输入来代替标准输入
  --help
  显示帮助并退出
  --version

2、设置串口波特率

  方法1、stty 命令设置tty波特率:

busybox stty -F /dev/ttyS0 raw speed 115200min 0 time 2

 

方法2、busybox microcom -t 5000 -s 115200 /dev/ttyS0

 

mircocom -h
microcom: invalid option – ‘h’
BusyBox v1.22.1 (2015-07-31 13:40:35 CST) multi-call binary.
Usage: microcom [-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY
Copy bytes for stdin to TTY and from TTY to stdout
-d Wait up to DELAY ms for TTY output before sending every next byte to it
-s Set serial line to SPEED
-X Disable special meaning of NUL and Ctrl-X from stdin

 

串口输出:

echo aaaaaa > /dev/ttyS3

串口读取:

cat /dev/ttyS3

写之后读:

echo 0 > /dev/ttyUSB0 | cat /dev/ttyS3

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值