Upload
suli-warraich
View
46
Download
1
Embed Size (px)
Citation preview
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 1/30
USING AT-Commandsin HYPERTERMINAL and in
PROGRAMMING languages “AT” stands for “attention commands” and are great way
to interface with your GSM based mobile for variety forenhancing operations. PC connection with the mobile is
required which can be done using data cable or Bluetoothconnectivity
PREPARED BY: UMER FAROOQCENTRE FOR ADVANCED STUDIES IN ENGINEERING
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 2/30
AT-COMMANDS
This document contains some commonlyused AT Commands. For there
functionality please refer to the ATCOMMANDS reference guide for moredetails.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 3/30
CHECKING SUPPORTEDCOMMANDS
AT◦ Returns all the AT-COMMANDS which are
supported by the attached phone
◦ USAGE: AT
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 4/30
DIAL COMMAND
ATD◦ Calls a number through your phone
◦ USAGE: ATD “+92345xxxxxx”;
◦DON’T FORGET THE COLON AT THEEND.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 5/30
ATTENDING A CALL
ATA◦ If there is incoming call, on using this
command, the call is attending.
◦ USAGE: ATA
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 6/30
HANGING UP THE CURRENT CALL
AT+CHUP◦ Hang up the ongoing call
◦ USAGE: AT+CHUP
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 7/30
BATTERY CHARGE
AT+CBC◦ Returns Battery Charging Status and charged
amount
◦ USAGE: AT+CBC=?
◦ RETURNS:
◦ +CBC <CHARGING STATUS> <CHARGING AMOUNT>
◦ FOR COMPLETE DETAILS, VIEW THEREFERENCE MANUAL
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 8/30
SIGNAL STRENGTH
AT+CSQ◦ Gives the signal strength of the cell at that
point
◦ USAGE: AT+CSQ=?
◦ RETURNS
+CSQ <Signal Strength>
FOR COMPLETE DETAILS, VIEW THEREFERENCE MANUAL
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 9/30
PHONEBOOK COMMANDS
AT+CPBS◦ Sets the phonebook storage (SIM/PHONE MEM)
◦ USAGE: AT+CPBS=<storage mode> AT+CPBR
◦ Returns the phonebook entry with given index
◦ USAGE:AT+CPBR=<index>
AT+CPBF◦ Search phonebook with given name
◦ USAGE:AT+CPBF=<text>
AT+CPBW
◦ Writes the phonebook◦ USAGE:AT+CPBW=<index>, <number> <text>
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 10/30
GETTING MOBILE SPECIFICATION
AT+CGMI◦ Request Manufacturer Identification
◦ USAGE: AT+CGMI=?
AT+CGMM or AT+GMM◦ Request Model Identification
◦ USAGE: AT+CGMM=? Or AT+GMM=?
AT+CGSN◦ Request IMEI number
◦ USAGE: AT+CGSN=?
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 11/30
MESSAGING FORMAT
AT+CMGF◦ Sets the message format (0-PDU, 1-TEXT)
◦ SAMSUNG AND MOTROLLA MOBILE SUPPORTSTEXT AND PDU
◦ OTHER MOBILE PHONES ONLY SUPPORTS PDUMODE. (Requires some hard work to send a
message if you are building your ownapplication
◦ USAGE: AT+CMGF=<0-1>
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 12/30
MESSAGE READ
AT+CMGR◦ Read the message placed at the given index
◦ USAGE: AT+CMGR=<index>
◦ RETURNS: The message is in text format if CMGF was set to 1 otherwise you will se someencoded TEXT in PDU. Its still a message. You
have to decode it first to understand it.
◦ Supports READ, UNREAD, SENT, UNSENT andTEMPLATE messages.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 13/30
SERVICE CENTRE NUMBER
AT+CSCA◦ Sets the SERVICE CENTRE NUMBER
◦ USAGE: AT+CSCA=“+923455000010”
◦ AT+CSCA=?
◦ Returns the current SC number
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 14/30
SENDS A MESSAGE
AT+CMGS
Sends the current messagee
USAGE (TEXT ONLY):
AT+CMGS=“+92345123456”, <ENTER>
<hi this is a test> <CTRL-Z/ESC>
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 15/30
WHAT IS <CR> and <LF>
<CR> stands for ENTER KEY
<LF> stands for CTRL-Z/ESC key
In the reference manual, you mayencounter these terms which are difficult
to understand while reading thedocument. Now it is easy for you.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 16/30
SOME MORE COMMANDS
AT*CPI (Call progress information)
AT+CCWA (Enable Call waiting)
AT*EDIF (Call diverting)
AT+CPWD (Change Password)
AT+CPAS (Shows all phone activity)
AT+CMAR (Master Reset) AT+CLAN (Changing Language)
AT*EKEY (Keypad Control)
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 17/30
AND AGAIN SOME MORECOMMANDS
AT+CCLK (Returns time in mobile)
AT+CALA (Alarm Setting)
AT+CALD (Alarm Delete)
AT*SEDISKL (Disable Keypad)
AT+CSIL (Silent on off)
FOR USAGE OF THESE COMMANDS, referto the reference manual.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 18/30
AT COMMANDS
As we say from the commands, it is veryeasy to use these commands. You can
enhance your software (which ever thelanguage is used).
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 19/30
TESTING COMMANDS INHYPERTERMINAL
Before you actually start using ATCommands, make sure you check these
commands in hyperterminal which is verysimple to use.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 20/30
STEPS OF USING HYPERTERMINAL
1. Run hyperterminal located inaccessories.
2. Name the connection.3. Select the COM port to which your
mobile is connected. If you are not sure,
keep testing the commands inhyperterminal. If any work, you foundthe COM port.
4. Keep clicking OK
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 21/30
FURTHER STEPS
You will see a text editor.
Write ATD “000”;
If your mobile phone dials the number.You are connected to it.
Use different commands and check the
return value. The return value is the same which is
returned when you use these commandsin any programming language.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 22/30
USING AT COMMANDS INLANGUAGE
In almost all Visual Languages like VB 6,VB.NET, VC++, VC++.NET, C#.NET, there
is a tool called SERIAL PORT. You may have to see programming
language manual or concern MSDN formore details on how to use SERIAL PORTCOMPONENT.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 23/30
FOOLISH ASSUMTIONS
YOU KNOW ONE OF THE VISUALLANGUAGE
YOU KNOW HOW TO USE SERIAL PORT YOU ARE FAMILIAR WITH EVENTS,
METHODS, PROPERTIES
BUT YOU DON’T KNOW HOW TO USE ATCOMMANDS IN THE LANGUAGE
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 24/30
SOME MORE FOOLISHASSUMTIONS
I am considering that your programminglanguage SERIAL PORT COMPONENT has
the following methods
Write(string) Writes the string to port
ReadExisting()
Reads everything on port
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 25/30
FINALLY USING AT COMMANDS
To use any AT Command, make sure youare connected to the serial port.
Serialport.write(“AT+CSIL = 1”);
Simple isnt it??
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 26/30
DATA RECEIVE EVENT
When you write/send the command to theport or you can say your cell, your Cell
also returns something (likehyperterminal returns you. Infact itreturns the same as hyperterminalreturns you)
The DATA RECEIVED EVENT of SERIALPORT COMPONENT can be used to retrievethe RETURN VALUE.
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 27/30
DATA RECEIVE EVENT
This is how to use it with assumptionsthat “serialport” is the name of
component where as “data” is a globalSTRING VARIABLE.
Public data_recieved(blah blah)
{
Data = serialport.readexisting();
}
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 28/30
TIP: USE PARSING
Parse the return value as required by you.Don’t show all the return value to the user
using your software. Offcouse!!
WHY WOULD A MAGICIAN
REVEAL HIS SECRETS!!!!
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 29/30
THAT’S ALL
I hope I provided you all the basics youneed in order to use the AT-COMMANDS in
programming languages, in HyperTerminaland off course gave some AT-COMMANDSto enhance your knowledge.
So what are you waiting for,
GET STARTED NOW
5/14/2018 Using at Commands - slidepdf.com
http://slidepdf.com/reader/full/using-at-commands 30/30
USING AT-Commandsin HYPERTERMINAL and inPROGRAMMING languages
THANKS
PREPARED BY: UMER FAROOQCENTRE FOR ADVANCED STUDIES
IN ENGINEERING