Posted by Henrik Danielsson, henrik.danielsson@exsero.se
on April 26, 2002 at 12:20
Hi folks!
I'm developing an app using NCP2.0 and eVB. Right now I can send AT commands, but I cannot get any response. I've seen in earlier threads that you should make assignmant as CommPort = "COM4:", but I cannot do that because CommPort must be assigned an integer. Can please anyone who solved this problem give me an answer.
Posted by Todd Main, todd_main@hotmail.com
on April 30, 2002 at 19:11
Try something like this:
With mscomNokiaPhone
.InputLen = 0
.InputMode = comInputModeText
.Settings = "9600,N,8,1"
.CommPort = 4
.PortOpen = True
.Output = "AT" & vbCrLf
Do
DoEvents
Loop Until .InBufferCount >= 2
.Output = "AT+CMGF=1" & vbCrLf
Do
DoEvents
Loop Until .InBufferCount >= 2
.Output = "AT+CSCA=" & Chr(34) & txtMsgCenter.Text & Chr(34) & vbCrLf
Do
DoEvents
Loop Until .InBufferCount >= 2
.Output = "AT+CMGS=" & Chr(34) & cmbSendTo.Text & Chr(34) & vbCrLf
Do
DoEvents
Loop Until .InBufferCount >= 2
.Output = txtMsg.Text & Chr$(26) & vbCrLf
End With
'Where:
'mscomNokiaPhone = you MSComm32 control
'txtMsgCenter.Text = your services message center number
'cmbSendTo.Text = the number you want to send to
'txtMsg.Text = the text you want to send
Be sure to close down the com port with .PortOpen = False when you need to close it down
Note to leave the waiting for your "OK" via:
Do
DoEvents
Loop Until .InBufferCount >= 2
Because .Output doesn't work properly with the MSComm32 control.