AT^SYSINFO 和 C++ 终端程序 [英] AT^SYSINFO and a C++ terminal program

查看:17
本文介绍了AT^SYSINFO 和 C++ 终端程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个与 USB 3g 调制解调器串行通信的程序.当我打开端口写AT命令时

I have written a program that comminucates serially with a USB 3g Modem. When I open the port and write the AT command

AT

对于调制解调器,我得到正常的OK"响应并且可以使用串行读取功能读取它.在终端中,当我编写命令时

To the modem, I get the normal "OK" response and can read it using a serial read function. In a terminal, when I write the command

AT^SYSINFO

我收到以下回复:

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

# 是数字.但是,当我尝试使用我的程序连续编写相同的命令时,我只读取了这个响应:

With the #'s being numbers. However, when I attempt to write the same command serially using my program, I read only this reponse:

AT^SYSINFO

然后我尝试读取另一行传入的数据,但没有数据到来.谁能帮我这个?^SYSINFO 消息中有我需要提取的信息.

I try to then read another line of incoming data, but no data comes. Can anyone help me with this? There is information in the ^SYSINFO message that I need to extract.

推荐答案

必须 终止一个 AT 命令行,没有别的(除非你修改了 ATS3,但你不应该)1.引用 V.250 规范:

You MUST terminate an AT command line with and nothing else (unless you have modified ATS3, but you should not)1. To quote the V.250 specification:

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 表示调制解调器.

DCE means modem.

(我删除了上面引用中的 IA5 引用,因为那只会令人困惑)

(I removed the IA5 references in the quote above as that is only confusing)

1 终止通常会起作用,但这只是因为 125 毫秒的中止超时延迟使得额外的 不会中止命令.

1 Terminating with will usually work, but that is only because of the 125ms abort timeout delay that makes the extra not abort the command.

这篇关于AT^SYSINFO 和 C++ 终端程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆