Joke Collection Website - Public benefit messages - On the question of AT instruction, hero scored 200 points.

On the question of AT instruction, hero scored 200 points.

AT command plays an important role in short message communication, which can control many behaviors of mobile phone, including dialing, key control, fax, GPRS and so on.

Basic usage of AT instruction:

1. test command (test command)

Add "=?" After the AT instruction. This constitutes a test command. For example, "AT+CSCS=?" Lists all supported character sets.

2. Read command (read command)

Add "?" After the AT instruction. Which constitutes a read command. For example, "AT+CSCS?" The current settings will be listed.

3. Execute the command (Execute the command)

Generally speaking, it is enough to add "=" and command parameters after the AT instruction. Some commands, such as AT+CMGR command, can be executed directly without parameters.

Take WAVECOM GSM MODEM as an example, its commonly used AT instruction set and development reference are as follows:

Instruction name usage description

CSMS selective information service

0 is compatible with GSM07.05 phase 2 version 4.7.0.

1 compatible with GSM07.05 Phase 2+ version.

T+CSMS=0

+CSMS: 1, 1, 1

AT+CSMS= 1

+CSMS: 1, 1, 1 SMS -MO

SMS-MT

SMS-CB (cell broadcast)

All support

CNMA new SMS received confirmation.

CPMS preferred SMS store

SM is the SIM card area, BM is the memory area, and the default value is SM.

AT+CPMS=?

+CPMS:(“SM”,“BM”),“SM”)

AT+CPMS="SM "

+CPMS:3.25,3.25

AT+CPMS="BM "

+cpms: 0,20,3,25 (1) is the information to be read and deleted.

(2) Information for writing and sending

Used 1, total * *1,used 2, total ***2.

CMGF sets the SMS encoding mode (1 text format, 0 is PDU format).

CSAS stores information about CSCA and CSMP in E2PROM.

CRES recovers relevant information from E2PROM.

CSDH display text format parameter (1 for display, 0 for no display)

AT+CDSH= 1

+CMT:“+86 1350 1 154 105”,“0 1/09/ 12, 18:04:09+32”, 145,4,0”,“86 13800 100500”

American Automobile Association

AT+CSDH=0

+CMT:"+86 1350 1 154 105 "," 0 1/09/ 12, 18:04:48+32 "

The information related to AAA includes ++CMTI, ++ CMT, ++CDS, ++CMGR and ++CMGL.

The two examples on the left are also sending and receiving short messages with AAA content.

Output mode of CNMI short message

AT+CNMI=2,2,0,0,0

+CMT:"+86 1350 1 154 105 "," 0 1/09/ 13, 1 1:04:09+32 "

American Automobile Association

AT+CNMI=2, 1,0,0,0

+cmti: "SM", 4 where the second bit determines whether SMS is directly output or stored in "sm".

The two examples on the left are also sending and receiving short messages with AAA content. If it is 0, it will not be received.

CMGR reads the information stored in "SM"

AT+CMGR= 1

+CMGR: "record reading", "8613501154102", "0108/14,14.

X000E8

AT+CMGR=4

+CMGR: "Record Unread", "+8613501154105", "0109/13,/kloc-"

American Automobile Association

AT+CMGR=2

+CMGR: "record reading", "8613501154105", "0 1/08/23,16: 32:.

DCS format error

at+cmgf = 0; +cmgr=2

+CMGR: 1,,26

089 1683 108 100005 f 0040d 9 1683 1450 1f 50008 108032665438。

Source13501154102

Read article 4

Source13501154105

When reading the second article, I encountered a DCS format error, and read the data after converting it into PDU format.

Source13501154105

CMGL information list, (+cmgl: index, type,, length =

AT+CMGL=4

+CMGL: 1, 1,,26

089 1683 108 100005 f 0040d 9 1683 165 1450 1f 20000 10804 10 1647423065865448

+CMGL:265438

089 1683 108 100005 f 0040d 9 1683 165 1450 1f 50008 1080326 123432306040046000

+CMGL:3 1,,32

089 1683 108 100005 f 0040d 9 1683 165 1450 1f 50008 1080326 17492230 c 00340365438

003 100320033

+CMGL: 4,65438

089 1683 108 100005 f 0040d 9 1683 165 1450 1f 50000 1090365438+

"Unread record" 0

"Record reading" 1

"STO Not Sent" 2

"STO School" 3

"all" 4

CMGS sends SMS text or PDU mode.

AT+CMGF= 1

good

AT+CMGS = 1350 1 154 105

& gtAAA & lt^z>;

+CMGS: 204 people

good

AT+CMGF=0

good

AT+CMGS= 18

& gt00 1 1000d 9 1683 105 1450 1f 500040 1034 14 14 14 14 1 & lt; ^z>;

+CMGS: 205 people

Confirm to send as text.

Send in PDU mode

CMGW writes information into memory.

AT+CMGW = "+86 1350 1 154 105 "

& gtAAA & lt^z>;

+CMGW: 5

good

At+cmgw = < length > < Cr > < PDU > < z > written as text.

Write in PDU mode

CMSS sends messages from memory.

AT+CMSS=5

+CMSS: 207 people

good

+CMT:23 years old

089 1683 108 100005 f 0040d 9 1683 165 1450 1f 50000 10903 16 163932303 c 65438

AT+CMSS=5,+86 1350 1 154 102

+CMSS: 2 10

OK, send the fifth message in the memory.

Receive information

You can also send the fifth message to the specified user.

CSMP sets text format parameters, +csmp: < fo > < VP > < PID > < DCS >

AT+CSMP?

+CSMP: 1,167,0,0, where the information is valid,

167 default value

0- 143: (VP+ 1) * 5 minutes

143-167:12 hours +(VP- 143) * 30 minutes

168-196: (VP-166) *1day

197-255: (VP-192) *1week

CMGD delete information, at+cmgd = < index >

CSCA SMS service center number

at+csca?

+CSCA:“+86 13800 100500”, 145

Ok, the number of Beijing SMS service center

CSCB selects the type of cell broadcast information.

WCBM cell broadcast information identifier

WMSC information state correction

WMGO information rewriting