在^sysinfo和C 终端程序

AT^SYSINFO and a C++ terminal program

本文关键字:终端 程序 sysinfo      更新时间:2023-10-16

我编写了一个与USB 3G调制解调器串行的程序。当我打开端口并写下at命令

AT

在调制解调器上,我得到了正常的"确定"响应,并可以使用串行读取功能读取它。在终端中,当我编写命令

AT^SYSINFO

我得到以下响应:

^SYSINFO:#,#,#,#,#,#

#的数字。但是,当我尝试使用程序串行编写相同的命令时,我仅阅读此响应:

AT^SYSINFO

我尝试读取另一行传入数据,但没有数据。谁能帮我这个?^sysinfo消息中有我需要提取的信息。

you 必须r终止命令行,没有其他(除非您已经修改过ATS3,否。引用V.250规范:

5.2.1   Command line general format
A command line is made up of three elements: the prefix, the body, and
the termination character. The command line prefix consists of the
characters "AT" or "at", or, to repeat the execution of the previous
command line, the characters "A/" or "a/". The body is made up of
individual commands as specified later in this Recommendation. Space
characters are ignored and may be used freely for formatting purposes,
unless they are embedded in numeric or string constants (see 5.4.2.1
or 5.4.2.2). The termination character may not appear in the body. The
DCE shall be capable of accepting at least 40 characters in the body.
The termination character may be selected by a user option (parameter S3),
the default being CR (ASCII value 13).

dce表示调制解调器。

(我删除了上面引用中的IA5参考文献,因为这只是令人困惑)


1 rn终止通常会起作用,但这仅仅是因为125ms中止超时延迟,这使得额外的n不中止命令。