"AT" command help

Posted on 2006-11-29
Last Modified: 2012-06-27
i have written a code on vc++ for connection of pc and mobile with function
openport()  : with createfile()
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
Question by:ddipro
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
LVL 16

Expert Comment

ID: 18035702
here is some descrition for ATc ommand
send the symbols in file and read symbols from file.

Author Comment

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
LVL 16

Expert Comment

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.
>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.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 18036120
These may be useful for you:
Great sample (in VB)
AT command list: (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.

Accepted Solution

taycuong76 earned 500 total points
ID: 18036146

Expert Comment

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
        Do While Timer < lngStart + lngHowLong
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.

Expert Comment

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.
LVL 16

Expert Comment

ID: 18037723

Author Comment

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


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

615 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