Wednesday, April 16, 2008

Reading SMS from GSM Modem:

Dim comSerial As New System.IO.Ports.SerialPort Dim atcCommand As String Dim sphnPhoneNo As String Dim cescQuote As Char Dim s As String With comSerial .PortName = "COM1" .BaudRate = "9600" .StopBits = IO.Ports.StopBits.One .DataBits = 8 .Parity = IO.Ports.Parity.None .ReadBufferSize = 10000 .ReadTimeout = 1000 .WriteBufferSize = 10000 .WriteTimeout = 10000 .RtsEnable = True .Open() .DiscardOutBuffer() 'for reading sms 'atcCommand = "AT+CMGR=10" 'to read from inbox '.Write(atcCommand + vbCrLf) 'execute command on buffer 'TextBox1.Text = .ReadExisting()

No comments: