I. SEND SMS with AT commands
Previous connect your PC ama HP / GSM modem, and hold pake HyperTerminal application we started writing it AT commands.
The logic is like this:
0. Previously a PC with a terminal make sure we (HP / GSM modem)'ve connected ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... .. AT
Try tanyain our terminal equipment (HP / GSM Modem, whether he support PDU mode (0) or SMS text mode (1) or both ... ... ... ... ... AT + CMGF =?
1. For example kalo our tool support SMS text mode, then I want ngajak HP / GSM modem operating in SMS text mode ... ... ... ... .. AT + CMGF = 1
2. Now, we write the new number and we will send messages to the Message Storage on the HP / GSM modem (SIM card) we ... ... ... ... ... ... ... ... ... AT + CMGW = "reply destination phone number" ... ... (Enter) ... YG WANT TO SENT A MESSAGE ... .. (Ctrl-Z to end the message) ... then came info index number where the message we were saved in message storage.
3. We send our message in message storage index was ... ... ... ... ... ... .... AT + CMSS = nomorindexpesankita
Done ... for example AT commands, and his response below:
AT
OK
AT + CMGF = 1
OK
AT + CMGW = "+85291234567"
> A simple demo of SMS text messaging.
+ CMGW: 1
OK
AT + CMSS = 1
+ CMSS: 20
OK
-------
Complete AT commands for Send SMS:
AT command Meaning
+ CMGS Send message
+ CMSS Send message from storage
+ CMGW Write message to memory (the destination number and the message will be sent)
+ CMGD Delete message
+ CMGC Send command
+ CMMS More messages to send
------
II. READ SMS AT Commands Pake
1. Invite HP / GSM modem we make SMS text mode ... ... ... ... ... .. AT + CMGF = 1
2. Read all messages in the Message Storage HP / GSM modem (SIM card) we .... AT + CMGL = "ALL"
Examples:
AT
OK
AT + CMGF = 1
OK
AT + CMGL = "ALL"
+ CMGL: 1, "REC READ", "+85291234567",, "06/11/11, 00:30:29 +32"
Hello, welcome to our SMS tutorial.
+ CMGL: 2, "REC READ", "+85291234567",, "06/11/11, 00:32:20 +32"
A simple demo of SMS text messaging.
OK
--
See there are 2 messages in the Message Storage GSM Modem (SIM).
- "REC READ" means the message is read uudah
- "+85291234567" Sender number
- "" 06/11/11, 00:32:20 +32 "... the message is received on Year 11 ... 2006/Bulan 11/Tanggal hour time 00:32:20 (GMT +32 / 4) which is GMT +8
- The contents of the message
-------------
* To find options in the Message field Message Reading Storage (+ CMGL) ... ... ... ... ... ... .. AT + CMGL =?
* Reading the SMS messages on a particular index in the Message Storage ... ... ... ... ... ... ... ... ... .. AT + CMGR = nomorindex
Example I want to read SMS messages in Index 15 Message Storage:
AT + CMGR = 15
+ CMGR: "STO SENT", "0411363xxxx",
TEST OK TONY
* Setting up a new SMS If there are incoming HP / GSM modem we were told doing ... ... ... ... ... ... ... ... ... ... ... .... AT + CMNI = ..., ...., ..., ..., ... .. (options suitable number untu AT commands manual HP / GSM modem that we pake)
We can ordered "every time there is an incoming SMS sent directly to your PC" or "every time a save incoming SMS in Message Storage aja then mberi-known PC
* SIM card Mencheck whether we've just entered the GSM Modem ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... .. AT + CPIN?
AT + CPIN?
+ CPIN: READY
-------------
AT Commands for Reading SMS:
AT command Meaning
+ CNMI New message Indications (Kalo is a new SMS entry will diapain?)
+ CMGL List messages (See LIST (L) SMS in Message Storage!)
+ CMGR Read messages (Read / READ (R) messages in the index ...)
+ CNMA New message Acknowledge
-------------
* + CNMI for my GSM Modem (Wavecom)
AT + CNMI = treatment code for a NOT search results (only support mode 2: stored in memory and sent to the PC later), treatment for SMS Check-in (default 1), treatment for Cell Broadcast Messages are entered (0: if CBM is entry NOT be forwarded, 1: first stored in the modem and the index memory location is sent to PC applications, 2: forwarded directly to the PC), SMS Status Report on the route or not (default 0: not sent, 1: sent, 2: stored and shipped ), buffer (default 0: the contents of buffers sent to the PC, 1: fill the buffer is removed)
AT + CNMI = 2, 1, 1, 2, 0
--------------
So now the question:
"What if I want to send SMS messages rather than with HyperTerminal but I woke Application pake Language Programming and the AT commands (so that its interface easier to use by common people and its features can macem2?"
Answer: we need to write the script to send AT commands sequence to HP / GSM modem we had with our Programming Languages
Tidak ada komentar:
Posting Komentar