c++ - Qt : send AT command to GPRS modem

标签 c++ qt modem gprs qtserialport

我有一 block 带有 GPRS 扩展板的 Arduino 开发板。我可以使用 Arduino 的 IDE 发送和接收 SMS,但我现在要使用 Wavecom GPRS 调制解调器。

我可以将字符串从 Qt 连接并发送到 Arduino 板,这样当 Arduino 从 Qt 收到一个特殊字符串时,它会发送一条短信。请参阅下面的代码。

但现在,我被卡住了...不知道如何直接从 Qt 发送 AT 命令,而不仅仅是发送 Arduino 等待发送 SMS 的字符串...

现在有人可以从 Qt 向 GPRS 调制解调器发送 AT 命令吗?

Arduino 代码:

void  loop()
{
    //Check if available
    if (Serial.available())
    {
        // read the incoming byte:
        incomingByte = Serial.read();

       //Just to show how it works
       if(incomingByte == 'X')
       {
        AT commands to send an sms
        }    
   }
    else
        delay(5); // there is nothing to read, so wait a few msec's
}

最佳答案

AT 命令通常通过串行端口发送,由 GPRS 调制解调器上的 Controller 软件处理。因此,您只需要在 Qt 应用程序中处理发送端。

因此,您只需通过 QtSerialPort 模块使用 QIODevice::write() 接口(interface):

mySerialPort->write("My AT command");

关于c++ - Qt : send AT command to GPRS modem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24534511/

相关文章:

c# - AT命令注册到网络

at-command - 当 SIM 卡没有 PIN 时,如何使用 AT 命令更改/创建 SIM PIN?

c++ - “_FCbuild”不能用作函数 - C/C++ 代码错误

java - C++ 等价于使用 <T extends Class> 作为 java 参数/返回类型

c++ - Linux:使用管道标准输入/标准输出执行子进程

c++ - 在 rapidjson 中使用 AddMember 获取空值

c++ - 使用 C++ 将 QML 元素动态添加/插入到 QML View 中

qt - 使用 QtWebKit 1.0 Webview 不可滚动

Java 短信 USB 调制解调器

javascript - 使用 qml 键盘处理网页的文本元素