View Single Post
Old 04-11-2010, 11:19   #39 (permalink)
YuMERA
Freak Poster
 
YuMERA's Avatar
 
Join Date: Feb 2004
Location: Serbia
Posts: 233
Member: 55980
Status: Offline
Thanks Meter: 78
Quote:
Originally Posted by josedavido View Post
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
  Reply With Quote
The Following User Says Thank You to YuMERA For This Useful Post:
 
Page generated in 0.08002 seconds with 7 queries