potetojb
Member level 3
- Joined
- Feb 25, 2006
- Messages
- 63
- Helped
- 1
- Reputation
- 2
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Johor,Malaysia
- Activity points
- 1,931
i use sony ericsson T610. i want read the msg using vb
i try to send the at command using vb.. that my program.
but i have problem i dont know why the msg cant display in text.. i thing have some problem.
this program dont error bit just not display the output
can u check the program for me.
i realy new in vb6
Private Sub Command1_Click()
Dim sms As String
Dim buffer$
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.Handshaking = comNone
MSComm1.PortOpen = True
'echo off
MSComm1.Output = "ATE0" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK")
buffer$ = ""
'Report Mobile Equipment Error ( enable )
MSComm1.Output = "AT+CMEE=1" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK")
buffer$ = ""
'Received read message
MSComm1.Output = "AT+CMGR=1" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "+CMGR: 1,,159")
buffer$ = ""
sms = MSComm1.Input
Text1.Text = sms
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK")
MSComm1.PortOpen = False
End Sub
if i use hyperterminal the output like this
'if use hyperterminal the command output like below
'AT CMGR = 1
'+CMGR: 1,,159
'07910621000010F5240B910621671663F1000060104222334423A0C2E030088232834E19C8049A06
'9BC2AAF3B87482905569D5E8CC06750A625A0F0AB7C32037B90E62D7D761103B3C4F83C46190B8EE '9E87D7207A1A5E9683CEE97619E41E8741F2F43A4D0785C5F3FA18949E97C96190FBBC0E83DCE230
'485C77CFCB20F739CC9E97C9A0B0FB3C07A5C5F575BB0C729FCB6A50985E6783D2F3B03B0D72A75D
'E8301A1446875D
thank
sorry for my bad ingglis
i try to send the at command using vb.. that my program.
but i have problem i dont know why the msg cant display in text.. i thing have some problem.
this program dont error bit just not display the output
can u check the program for me.
i realy new in vb6
Private Sub Command1_Click()
Dim sms As String
Dim buffer$
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.Handshaking = comNone
MSComm1.PortOpen = True
'echo off
MSComm1.Output = "ATE0" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK")
buffer$ = ""
'Report Mobile Equipment Error ( enable )
MSComm1.Output = "AT+CMEE=1" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK")
buffer$ = ""
'Received read message
MSComm1.Output = "AT+CMGR=1" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "+CMGR: 1,,159")
buffer$ = ""
sms = MSComm1.Input
Text1.Text = sms
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
Loop Until InStr(buffer$, "OK")
MSComm1.PortOpen = False
End Sub
if i use hyperterminal the output like this
'if use hyperterminal the command output like below
'AT CMGR = 1
'+CMGR: 1,,159
'07910621000010F5240B910621671663F1000060104222334423A0C2E030088232834E19C8049A06
'9BC2AAF3B87482905569D5E8CC06750A625A0F0AB7C32037B90E62D7D761103B3C4F83C46190B8EE '9E87D7207A1A5E9683CEE97619E41E8741F2F43A4D0785C5F3FA18949E97C96190FBBC0E83DCE230
'485C77CFCB20F739CC9E97C9A0B0FB3C07A5C5F575BB0C729FCB6A50985E6783D2F3B03B0D72A75D
'E8301A1446875D
thank
sorry for my bad ingglis