Quote:
Originally Posted by josedavido I already Made the calculation software for Huawei, ZTE, LG KG110. and want to enter the generated code directly to te Huawei modem. I'd Never work whit comm port communication. I am Working on Visual Basic 6. Just have the commands for open port, send info, close port
But Still not have the source for send and recive AT commands, not have info, not have tutorials.
I'll be really thanks full if you help me in some way.
BR,
Josedavido |
Google write the "AT commands in VB6" and you will get many useful links. Here you can not just get everything on the plate.
example with MSComm control:
Code:
'Get manufacturer information: +CGMI
'------------------------------------------------
Dim pMan As Variant
MSComm1.Output = "AT+CGMI" + Chr(13)
Sleep (50)
inBuff$ = MSComm1.Input
pMan = Split(inBuff$, Chr(10))
ListBox1.AddItem " Manufacturer: " & Replace(pMan(1), Chr(13), "")
'Get Model +CGMR
'------------------------------------------------
MSComm1.Output = "AT+CGMM" + Chr(13)
Sleep (50)
inBuff$ = MSComm1.Input
pMan = Split(inBuff$, Chr(10))
ListBox1.AddItem " Model: " & Replace(pMan(1), Chr(13), "")
.
.
.
'Enter NCK code from calculated code...
'------------------------------------------------
unlCode = hNck ' hNck is huawei calculated code from NCK calculator
MSComm1.Output = "AT^CARDLOCK=" & unlCode + Chr(13)
Sleep (100)
inBuff$ = MSComm1.Input
If InStr(1, inBuff$, "ERROR") Then
ListBox1.AddItem = " Unlock: FAIL!"
Else
ListBox1.AddItem = " Unlock: SUCCESS!"
End If
"Sleep" is API function and you need declaration in Module or General declaration
Code:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Best of luck!
YuMERA