Private Sub Form_Load()
MSComm1.CommPort = 3
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLen = 0
' Open the port.
MSComm1.PortOpen = True
' Send the attention command to the modem.
MSComm1.Output = "ATZ" & Chr$(13) ' Ensure that
' the modem responds with "OK".
' Wait for data to come back to the serial port.
Do
DoEvents
Buffer$ = Buffer$ & MSComm1.Input
Loop Until InStr(Buffer$, "OK" & vbCrLf)
' Read the "OK" response data in the serial port.
' Close the serial port.
MSComm1.Output = "AT+VCID=1" & Chr$(13) ' Ensure that
End Sub
Private Sub MSComm1_OnComm()
Dim InString As String
' Retrieve all available data.
MSComm1.InputLen = 0
'Text1.Text = Text1.Text & "Dropped Phone" & vbCrLf
' Check for data.
If MSComm1.InBufferCount Then
' Read data.
ww = MSComm1.Input
Text1.Text = Text1.Text & ww
If ww Like "*NAME*" Then
pos = InStr(1, ww, "Time=", vbTextCompare)
List1.AddItem Mid(ww, pos + 5, 11)
pos = InStr(1, ww, "Nmbr=", vbTextCompare)
List1.AddItem Mid(ww, pos + 5, 10)
pos = InStr(1, ww, "Name=", vbTextCompare)
List1.AddItem Mid(ww, pos + 5)
End If
End If
End Sub