Solved

"AT" command help

Posted on 2006-11-29
10
357 Views
Last Modified: 2012-06-27
Hi
i have written a code on vc++ for connection of pc and mobile with function
openport()  : with createfile()
configureport()
and functions for timeout settings
all functions r working properly

but how can i get a notification that a mobile is connected or not
and how can i use  AT command in my vc++ program.

Thanks in Advance
0
Comment
Question by:ddipro
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 16

Expert Comment

by:AlexNek
ID: 18035702
here is some descrition for ATc ommand
http://www.modem.com/general/extendat.html
send the symbols in file and read symbols from file.
0
 

Author Comment

by:ddipro
ID: 18035745
your answer does not match to my requirment.
please help in some relevent way so that i could be able to get it
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 18036078
I think it is all what you need
>but how can i get a notification that a mobile is connected
Command Acknowledgment
The modem will acknowledge most commands almost immediately. As soon as you type in a command ending with the carriage return character your modem will respond with OK.
http://www.modem.com/glossary/extend1c.html
>and how can i use  AT command in my vc++ program
if you could write more code snipset then we wite you more concrete too.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:taycuong76
ID: 18036120
These may be useful for you:
http://www.codeproject.com/ce/irdamobile.asp
http://www.gnokii.org
Great sample http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=51424&lngWId=1 (in VB)
AT command list: http://www.gotocm.com/PDF/JYSJATMLJS.pdf (note that they are not the same for each phone's kind)
According to GSM 07.07 and standard ATA commands the following is the case:

AT+CGMI:    Manufacture Identification
AT+CGMM:  Model Identification
AT+CGMR:   Software Revision Identification
AT+CGSN:    Serial Number Identification (IMEI)

To know when a mobile is connected or not to PC, you have to keep an eye on the port (pooling-port) with a loop sending AT commands and wait for device to answer by "OK", next step is to use AT command to know what kind it is and also wait for the reply.
0
 
LVL 3

Accepted Solution

by:
taycuong76 earned 500 total points
ID: 18036146
0
 
LVL 3

Expert Comment

by:taycuong76
ID: 18036151
0
 
LVL 4

Expert Comment

by:HKComputer
ID: 18037298
Here's a few popular commands I use. Make sure you send a Carriage Return after each command. Also read the other information at the bottom of this post.

AT    (Initializes communication with the modem, not required to communicate with it though)
ATZ  (Sets the modem back to default settings)
ATI3  (Queries the modem for Manufacturer Information)
ATI4  (Also queries the modem for Manufacturer Information)
AT+GMM  (Queries modem for video capabilities)
AT+VCID=1  (Turns on CallerID functionality (with formatting), some modems)
AT#CID=1   (Turns on CallerID Functionality (with formatting), some other modems, (some modems respond to both))
AT#CID? or AT+VCID? (Queries the modem to check the current CallerID Setting)
ATS0=0  (Turns off the "auto-answer" feature)
ATS0=2  (Auto-Answers after 2 rings)
ATDT12125551212  (Dials a given phone number)
ATH  (Hangup command)



After sending the modem commands, it is necessary to give it a little bit of time to respond (also note that the modem will disregard or lose commands that are sent too quickly in succession). You should have an OnComm event that will catch modem responses.  This event needs to be allowed to run while and after you send commands to the modem. I use a Pause procedure to take care of this.  I also use Visual Basic so my examples here are VB.

Private Sub subPause(lngHowLong As Long)        
        Dim lngStart As Long
        lngStart = Timer  'Timer is the system timer that start counting after midnight
        DoEvents
        Do While Timer < lngStart + lngHowLong
        Loop
End Sub




So here's how I communicate with the modem in VB. This code doesn't do the "listening" for responses. That is happening in another procedure.

            comm1.Output = "ATI3" + vbCr
            subPause (1)
           
            comm1.Output = "ATI4" + vbCr
            subPause (1)

            comm1.Output = "AT+GMM" + vbCr
            subPause (1)



It is also necessary to know that for some features you will have to use TAPI instead of serial communications. Not all modems are TAPI compliant. And TAPI seems to be more intensive to learn to program (I've never learned it myself). If you want to send noises over the modem, such as text to speech, or Wav files, you will have to use TAPI.
0
 
LVL 4

Expert Comment

by:HKComputer
ID: 18037347
Sorry. My post applies only to a standard phone modem and doesn't really apply to the GSM part. I have never used a GSM modem. I'm a little late catching on.
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 18037723
0
 

Author Comment

by:ddipro
ID: 18051599
Ok thanks for ur cooperation
i have done this in my own way becaz ur most of the things was in VB.
i got some link from ur site that i will use for further improvement

Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 109
VB6 Compile Compatibility Issue 4 115
Hide vba in gp 7 104
Tembedded WB animatid gifs not animated on some pcs 2 84
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question