Qt:发送AT命令到GPRS调制解调器

Qt : send AT command to GPRS modem

本文关键字:GPRS 调制解调器 命令 AT 发送 Qt      更新时间:2023-10-16

我有一个带有GPRS屏蔽的Arduino板。我可以用Arduino的IDE发送和接收短信,但我现在要使用Wavecom GPRS调制解调器。

我可以连接和发送字符串从Qt到Arduino板,这样当Arduino收到一个特殊的字符串从Qt,它发送短信。

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

现在有人如果有可能从Qt发送AT命令到GPRS调制解调器?

Arduino code:
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调制解调器上的控制器软件进行处理。因此,您只需要关心Qt应用程序中的发送端。

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

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