dreamdelerium
Active member
- Joined
- Mar 7, 2008
- Messages
- 36
- Programming Experience
- 1-3
hi all,
im trying to read from a gsm modem's inbox using AT commands. when i run this code, the only response i get is "OK" but i should be getting the message from the inbox. my code is bellow:
my only guess would be that its only writting out the last part of the string. if so, how would i concat all the string parts into one? if thats not the problem, what is?
im trying to read from a gsm modem's inbox using AT commands. when i run this code, the only response i get is "OK" but i should be getting the message from the inbox. my code is bellow:
VB.NET:
Private Sub viewInBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim comSerial As New System.IO.Ports.SerialPort
Try
With comSerial
.PortName = "COM5"
.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
.DtrEnable = True
.Write("AT" + vbCr) 'execute command on buffer
.Write("AT+CMGF=1" + vbCr)
.Write("AT+CMGL=ALL" + vbCr)
Dim Incoming As String = .ReadExisting()
MsgBox(Incoming)
.Close()
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
my only guess would be that its only writting out the last part of the string. if so, how would i concat all the string parts into one? if thats not the problem, what is?