MS: Mobile Station
SC: Service Centre (used for SMS)
SR:Status Report Message storage
1) SMS-DELIVER
2) SMS-DELIVER-REPORT
3) SMS-SUBMIT
4) SMS-SUBMIT-REPORT,
5) SMS-STATUS-REPORT
6) SMS-COMMAND
1) AT+CNMI=2,1,0,1,1
2) AT+CMGF=0
3) AT+CSCS=”UCS2”
八位元
|
描述
|
00
|
SMSC長度,此處爲零,表示不含短消息中心號碼
|
06
|
First octet字節,即00000110B,表示這是一個status report
|
08
|
引用消息號碼,就是使用AT+CMGS發送短信成功時返回的那個+CMGS值,可以一一對應檢索狀態
|
0D91683158136777F7
|
對應短信接受方手機號碼 13853167777
|
60207041653000
|
SMSC接收到所發送短信的時間
|
60207041653000
|
SMSC處理並給出狀態的時間
|
00
|
對應發送短信的狀態,00表示成功
|
1) AT+CNMI=2,1,0,2,1
2) AT+CPMS=”SR”,”SM”
3) … …
switch(getMaskByte(pDst->TP_FIRSTOCT, FOD_TP_MTI))
case SMS_STATUS_REPORT:
gsmString2Bytes(pCloneSrc, &tmp, 2); //TP-Message-Reference
pDst->TP_MR = tmp;
pCloneSrc += 2; // 指針後移
gsmString2Bytes(pCloneSrc, &tmp, 2); // 取長度
if(tmp & 1) tmp += 1; // 調整奇偶性
pCloneSrc += 4; // 指針後移,忽略了回覆地址(TP-RA)格式
gsmSerializeNumbers(pCloneSrc, pDst->TPA, tmp); // 取TP-RA號碼
pCloneSrc += tmp; // 指針後移
gsmSerializeNumbers(pCloneSrc, pDst->TP_SCTS, 14); // 服務時間戳字符串(TP_SCTS)
pCloneSrc += 14; // 指針後移
gsmSerializeNumbers(pCloneSrc, pDst->TP_DT, 14); // 處理時間戳字符串(TP_DT)
pCloneSrc += 14; // 指針後移
gsmString2Bytes(pCloneSrc, &tmp, 2); // TP-Status
pDst->TP_ST = tmp;
break;
case SMS_DELIVER:
default:
… …