Detect response from Modem?

Posted by GoodBoyNYC on Stack Overflow See other posts from Stack Overflow or by GoodBoyNYC
Published on 2012-11-02T16:58:08Z Indexed on 2012/11/02 17:01 UTC
Read the original article Hit count: 144

Filed under:
|
|

I'm working with a Teltonika G10 GSM modem and wrote up a basic program to send out SMS. I put a 1.5 second timer between each AT command to allow the modem to simulate the wait for the "OK" from the modem. This works for now but I'd rather use a branching statement wait for an actual response such as "OK" or "ERROR" rather than using a timer.

        SerialPort1.Write("AT+CMGD=1,4" & vbCrLf)
        Thread.Sleep(1250)
        SerialPort1.Write("AT+CMGF=1" & vbCrLf)
        Thread.Sleep(1250)
        SerialPort1.Write("AT+CMGS=" & Chr(34) & "3475558223" & Chr(34) & vbCrLf)
        Thread.Sleep(1250)
        SerialPort1.Write(":|" & Chr(26))

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about sms