这里有用过GSM AT 指令的吗?我有一些问题想请教

lingfeng42 2004-08-05 04:14:36
发送短信,我采用的是AT+CMGF=1(为文本方式)。在接收的时候用想用CMGL可是列不出数据来,如果用CMGR就可以。如果AT+CMGF=0 CMGL可以列出数据来。现在有一个问题,如果采用CMGR,,在程序关闭的时候来的短信不可以显示,因为不知道它存储在什么位置,请问各位有什么好的办法吗?有没有什么相关的AT指令那,,,对了,在用CMGR之前,,读串口,看是否有+CMTI:返回。。。
...全文
175 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
stevecrisewu 2004-08-06
  • 打赏
  • 举报
回复
22.Select Message Service
send: AT+CSMS=<service>
receive: +CSMS: <MO>,<MT>,<CB>
OK
remark: <MO>0:Not support <MT>0:Not support <CB>0:Not support
1:support 1:support 1:support

23.Preferred Message storage
send: AT+CPMS=<mem1>,[<mem2>]
receive: +CPMS:<used1>,<total1>,<used2>,<total2>
remark: this command allows the message storage area to be selected.
<mem1>"SM","BM","SR",<mem2>"SM"
sample: at+cpms?
+CPMS: "SM",13,15,"SM",13,15
OK

24.Preferred Message Format
send: AT+CMGF=<mode>
receive: OK
remark: the formats implemented are text mode and PDU mode
<mode>0:text mode
1:PDU mode

25.Read Message
send: AT+CGMR=<index>
receive: +CMGR:<stat>,<oa>,[<alpha>],<scts>,
[<tooa>,<fo>,<pid>,<dcs>,<sca>,<tosca>,<length>]
<stat>"REC UNREAD" or "REC READ" or "STO UNSENT" or "STO SENT"
sample: AT+CMGR=1
+CMGR: "REC READ","1630",,"03/11/28,10:51:43+32"
abcdefg
OK

26.List Message
send: AT+CMGL=<stat>
receive: +CMGL:<index>,stat>,<oa>,[<alpha>],<scts>
OK
remark: this command allows application to read message.
<stat>"REC UNREAD" or "REC READ" or "STO UNSENT" or "STO SENT" or "ALL"
sample: AT+CMGL="ALL"
+CMGL: 13,"REC READ","1630",,"03/11/28,14:05:38+32"
abcdefg
OK
27.Send Message
send: AT+CMGS=<da>,[<total>] //text is entered
AT+CMGS=<length> //PDU is entered
receive: +CMGS:<n>
OK
remark: n is the serial number.
Ctrl-Z and ESC charater
sample:
AT+CMGF=1
OK
at+cmgs="13810234473"
at+cmgs="13810234473"
123456789
+CMGS:2
OK
for more information about PDU mode please see chapter 9.12 page 107

28.Write Message to Memory
send: AT+CMGW=<oa/da>,[<tooa/toda>,[<stat>]] //text is entered
AT+CMGW=<length>,[<stat>]
receive: +CMGW:<index>
OK
remark: This Command stores a message in memory.(no choice possible as
with phonebooks +CPBW)
sample: AT+CMGF=1
OK
at+cmgw="13810234473"
> how are you

+CMGW: 14
OK
at+cmgr=14
at+cmgr=14
+CMGR: "STO UNSENT","13810234473",
how are you
OK

29.Send Message From storage
send: AT+CMSS=<index>,[<da>,<toda>]
receive: +CMGS:<mr>
remark: This command sends a message stored at location value<index>
<da>may be a different destination
sample: at+cmss=5,13810234473
at+cmss=5,13810234473
+CMSS: 36
OK

30.Delete Message From storage
send: AT+CMGD=<index>,[<DelFlag>]
receive: OK
remark: this command is used to delete one or several message from
preferred message storage
<DelFlag>0:Delete message at location<index>
1:Delete all READ messages
2:Delete all READ and SENT messages
3:Delete all READ,SENT and UNSEND messages
4:Delete all messages

31.Service Center Address
send: AT+CSCA=<SC>
receive: OK
remark: this command shall be used to indicate to which service center the
message has to be sent.
<SC>service center number
sample: at+csca="+8613800100500"
at+csca="+8613800100500"
OK


这是wavecomQ2406a得关于短信得AT指令,希望帮你有用。

我这里也有标准得GSM7.07得相关指令,西门子的也有,wavecom公司的CDMA的也有。
zhangnanonnet 2004-08-06
  • 打赏
  • 举报
回复
我记得你前几天好像问过短信的事,你是不是在作短信的项目呢。我感觉你用的是WAVECOM的MODULE,其实网上有很多现成的收发短信的例程,你应该去看看
zhangnanonnet 2004-08-06
  • 打赏
  • 举报
回复
如果你的MODULE是符合GSM 0705 的话,应该有CPMS用于指定短信保存的位置,你查一下。格式应该是这样

CString code("AT+CPMS=\"");

code += rmem; //读存储
code += "\",\"";
code += wmem; //写存储
code += "\"\r";

还有就是在你程序停掉以后其实MODULE还带电运行,所以有短信过来它还是会接收的,只要你这是保存的STORE就可以了。
另外在初始化设备的时候设置CNMI,格式应该是这样
CString tmp1("AT+CNMI="), code("");
char tmp2[50];

memset(tmp2, 0, 50);
sprintf(tmp2, "%s%d,%d,%d,%d,%d\r", tmp1, mode, mt, bm, ds, bfr);
code = tmp2;

参数值用CNMI(2,1,0,0,0);

这样就可以保证如果接收的信息没有及时读取的话可以保存到我们制定的STORAGE中去
lingfeng42 2004-08-06
  • 打赏
  • 举报
回复
谢谢

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧