qevan的工作日记

一本普通的工作日记

导航

AT+CPMS指令的意义以及AT+CNMI自动接收短信时的方法

Posted on 2005-03-17 11:35  qevan  阅读(8183)  评论(1)    收藏  举报
AT+CPMS指令的意义以及AT+CNMI自动接收短信时的方法
qevan

AT+CPMS=?
+CPMS: ("ME","SM"),("ME","SM"),("MT")
first parameter means the preferred store-location when reading SMS,
2nd means sending
3rd means receiving.

so when if u use AT+CNMI=2,1 to receive SMS automatically
COM would read
+CMTI: <loc>,<index>
 
when new SMS arrives...

<loc> could be ME SM or MT
ME means SMS is stored on MobilePhone,
SM means on SIM card
MT means on the total store space,
here my phone (Nokia 6610) just use the dammed last MT notifying me!
following is some pseudocode worked properly on my phone
if  <loc>='MT' then 
      if <index> > SIM capacity then
      begin
               <loc>='ME'
               <index>=<index>-SIM capacity
      end
      else 
               <loc>='SM'

AT+CPMS="<loc>" //set reading preference only
AT+CMGR=<index>