22.4. Example Demonstrating How to Use the +CPMS AT Command to Select the Message Storage Areas to be Used
Now let's see an example that demonstrates how to use the +CPMS AT command to select the message storage areas to be used for various SMS operations.
Finding the Message Storage Areas Supported by the GSM/GPRS Modem or Mobile Phone
First, enter the command line "AT+CPMS=?" in a terminal program (for example, Windows' HyperTerminal program) to find the message storage areas supported by the GSM/GPRS modem or mobile phone. Below shows the response returned from my Nokia 6021 to Windows' HyperTerminal program after the execution of the command line "AT+CPMS=?":
AT+CPMS=?
+CPMS:
("ME","SM"),("ME","SM"),("MT")
OK
The information response above indicates Nokia 6021 supports the use of "ME" or "SM" for SMS reading, deleting, sending and writing, while it only supports the use of "MT" for storing inbound SMS messages.
Selecting Message Storage Areas
After knowing what message storage areas are selectable, we can now perform a set operation to select the message storage areas. For example, let's say you want to instruct the GSM/GPRS modem or mobile phone to use:
the phone message storage area for SMS reading and deleting,
the SIM message storage area for SMS writing and sending, and
both the phone message storage area and SIM message storage area for storing inbound SMS messages.
You should assign the string values "ME", "SM" and "MT" to the +CPMS AT command. Following shows the response returned from my Nokia 6021 mobile phone to HyperTerminal:
AT+CPMS="ME","SM","MT"
+CPMS:
2,150,2,10,4,160
OK
As you can see, there are six values in the information response of the +CPMS AT command. Following is a description of them.
The First and Second Fields: 2,150
The value 2 indicates there are currently two messages stored in the ME message storage area. 150 is the maximum number of messages that can be stored in the ME message storage area.
The Third and Fourth Fields: 2,10
The value 2 indicates there are currently two messages stored in the SM message storage area. 10 is the maximum number of messages that can be stored in the SM message storage area.
The Fifth and Sixth Fields: 4,160
The value of the fifth field of the +CPMS information response, 4, indicates there are currently four messages stored in the MT message storage area. The same result can also be obtained by calculating manually like this:
Number
of messages currently stored in the ME message storage area + Number
of messages currently stored in the SM message storage area
= 2 +
2
= 4
The value of the sixth field of the +CPMS information response, 160, is the maximum number of messages that can be stored in the MT message storage area. The same result can also be obtained by calculating manually like this:
Maximum
number of messages that can be stored in the ME message storage area
+ Maximum number of messages that can be stored in the SM message
storage area
= 150 + 10
= 160
Previous Page | Page 37 of 65 | Next Page |
- 1. Introduction to SMS Messaging
- 2. What Makes SMS Messaging So Successful Worldwide?
- 3. Example Applications of SMS Messaging
- 4. What is an SMS Center / SMSC?
- 5. Basic Concepts of SMS Technology
- 6. Intra-operator SMS Messages
- 7. Inter-operator SMS Messages
- 8. International SMS Messages
- 9. What is an SMS Gateway?
- 10. How to Send SMS Messages from a Computer / PC?
- 11. How to Receive SMS Messages Using a Computer / PC?
- 12. Introduction to GSM / GPRS Wireless Modems
- 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
- 14. Introduction to AT Commands
- 15. General Syntax of Extended AT Commands
- 16. Result Codes of AT Commands
- 17. AT Command Operations: Test, Set, Read and Execution
- 18. Testing the Communication between the PC and GSM/GPRS Modem or Mobile Phone
- 19. Checking if the GSM/GPRS Modem or Mobile Phone Supports the Use of AT Commands to Send, Receive and Read SMS Messages
- 20. Operating Mode: SMS Text Mode and SMS PDU Mode
- 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
- 22. Preferred Message Storage (AT+CPMS)
- 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
- 24. Deleting SMS Messages from Message Storage (AT+CMGD)
- 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
- 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)
- 27. Appendix A: How to Choose an SMS Service Provider (SMS Gateway Provider, SMS Reseller, SMS Broker)?
- 28. Appendix B: Comparison Table of SMS Service Providers (SMS Gateway Providers, SMS Resellers, SMS Brokers)
- 29. Appendix C: Free Software/Tools and Libraries for Sending and Receiving SMS Messages with a Computer / PC
- 30. Appendix D: GSM 7-bit Default Alphabet Table (with Character Codes of ISO 8859 Latin 1)