Solved

"AT" command help

Posted on 2006-11-29
10
355 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is about my first experience with programming Arduino.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now