webo001 / gsmmodem

Automatically exported from code.google.com/p/gsmmodem
1 stars 0 forks source link

发送成功,但是返回出错 #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
读取超时最可能是
public GsmModem(string comPort, int baudRate)
        {
            _com = new MyCom();

            _com.PortName = comPort;          //
            _com.BaudRate = baudRate;
            _com.ReadTimeout = 10000;         //读超时时间 发送短信时间的需要
            _com.RtsEnable = true;            //必须为true 这样串口才能接收到数据

            _com.DataReceived += new EventHandler(sp_DataReceived);
        }
的_com.ReadTimeout = 
10000;不够大;不过10000时间是10s,一条短信发送10s应该够长了
,你可以把他加大点试下15等,看加到多少,可以不再出现超
时

Original issue reported on code.google.com by yaodix...@gmail.com on 24 Jun 2011 at 12:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
if (tmp.Contains("OK"))
                {
                    continue;
                }
这个好像没有什么问题,tmp是发送AT指令 
命令设备发送短信时设备回复的内容,如果包含OK,即发送成
功,继续发送长短信的的下一条

Original comment by xiaoa0...@gmail.com on 26 Jun 2011 at 3:18

GoogleCodeExporter commented 9 years ago
如果不是长短信问题(见下一个Issue),可能是速率设置不对
,这个要看设备的具体要求,如果是115200但设置成9600,就一�
��会超时报错。

Original comment by pinghua....@gmail.com on 7 Sep 2011 at 4:51