1 简介
2 原则
3 工具
4 应用
4.1 在 4G/5G 拨号中的应用
1 简介
AT 命令是 TE (Terminal Equipment)(如 PC 等用户终端)和 MT(Mobile Terminal)(如移动台等移动终端)之间的通信命令协议
如图:
「AT 命令有的区分大小写,有的不区分」
2 原则
AT 命令是以 AT
作首, 字符结束的
字符串
❝对字符串的定义:由双引号包括起来的,不含引号或逗号的字节流
❞
每个接口功能内聚
数据包大小有限制:发送不大于
2+260
个,上报不大于688
个每一行只包含一条命令或者响应
不要有多余的冗余的空格
第一条命令发送后必须等到响应才能发第二条命令,否则第二条命令将不被执行
耗时较长的命令采用异步方式
要能处理字符
@
3 工具
「microcom」
一般嵌入式系统中会自带 microcom
,可以用来操作 AT 串口,用法如下:
~ # microcom -h
microcom: invalid option -- 'h'
BusyBox v1.26.2 (2019-12-24 10:35:33 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
-t Exit if both stdin and TTY are silent for TIMEOUT ms
-s Set serial line to SPEED
-X Disable special meaning of NUL and Ctrl-X from stdin
~