22. Preferred Message Storage (AT+CPMS)
The AT command +CPMS (command name in text: Preferred Message Storage) serves several purposes. It can be used to:
1. Select the message storage area that will be used when sending, receiving, reading, writing or deleting SMS messages.
2. Find the number of messages that are currently stored in the message storage area.
3. Find the maximum number of messages that can be stored in the message storage area.
22.1. Selecting the Message Storage Areas to be Used for SMS Reading, Writing, Deleting, Sending or Receiving
To select the message storage areas to be used for SMS reading, writing, deleting, sending or receiving, you should perform a set operation with the +CPMS AT command. The syntax is: (Optional parameters are enclosed in square brackets.)
+CPMS=message_storage1[,message_storage2[,message_storage3]]
Before we discuss each of the parameters, let's see an example that gives you some idea of how an actual command line should look like:
AT+CPMS="ME","SM","MT"
The message_storage1 Parameter
The first parameter of the +CPMS AT command, message_storage1, specifies the message storage area that will be used when reading or deleting SMS messages. (For details about reading SMS messages, see AT commands +CMGR and +CMGL. For details about deleting SMS messages, see the AT command +CMGD.)
The message_storage2 Parameter
The second parameter of the +CPMS AT command, message_storage2, specifies the message storage area that will be used when sending SMS messages from message storage or writing SMS messages. (For details about sending SMS messages from message storage, see the AT command +CMSS. For details about writing SMS messages, see the AT command +CMGW.)
The message_storage3 Parameter
The third parameter of the +CPMS AT command, message_storage3, specifies the preferred message storage area for storing newly received SMS messages. If you use the +CNMI AT command (command name in text: New Message Indications to TE) to tell the GSM/GPRS modem or mobile phone to forward newly received SMS messages directly to the PC instead of storing them in the message storage area, you do not need to care about the message_storage3 parameter.
Values that May be Assigned to the Parameters of the +CPMS AT Command
Here are the values defined in the SMS specification that may be assigned to the parameters message_storage1, message_storage2 and message_storage3:
SM. It refers to the message storage area on the SIM card.
ME. It refers to the message storage area on the GSM/GPRS modem or mobile phone. Usually its storage space is larger than that of the message storage area on the SIM card.
MT. It refers to all message storage areas associated with the GSM/GPRS modem or mobile phone. For example, suppose a mobile phone can access two message storage areas: "SM" and "ME". The "MT" message storage area refers to the "SM" message storage area and the "ME" message storage area combined together.
BM. It refers to the broadcast message storage area. It is used to store cell broadcast messages.
SR. It refers to the status report message storage area. It is used to store status reports.
TA. It refers to the terminal adaptor message storage area.
Note that a GSM/GPRS modem or mobile phone may not support all the above values and it may support other manufacturer specific values. To learn how to find the values supported by your GSM/GPRS modem or mobile phone, please refer to the section "Finding the Message Storage Areas Supported by a GSM/GPRS Modem or Mobile Phone".
22.2. Format of the Information Response of the +CPMS AT Command
If the GSM/GPRS modem or mobile phone executes the +CPMS set command successfully, it will return an information response to the computer / PC. The information response of the +CPMS AT command has the following format:
+CPMS: used_space1,max_space1,used_space2,max_space2,used_space3,max_space3
used_space1 is the number of messages currently stored in the message storage area specified by the message_storage1 parameter.
max_space1 is the maximum number of messages that can be stored in the message storage area specified by the message_storage1 parameter.
used_space2 is the number of messages currently stored in the message storage area specified by the message_storage2 parameter.
max_space2 is the maximum number of messages that can be stored in the message storage area specified by the message_storage2 parameter.
used_space3 is the number of messages currently stored in the message storage area specified by the message_storage3 parameter.
max_space3 is the maximum number of messages that can be stored in the message storage area specified by the message_storage3 parameter.
22.3. Finding the Message Storage Areas Supported by a GSM/GPRS Modem or Mobile Phone
Before we can use the +CPMS AT command to select the message storage areas to be used for various SMS operations, we have to know what message storage areas are supported by the GSM/GPRS modem or mobile phone. Among the six types of message storage area mentioned in the last section, "SM", "ME" and "MT" are commonly supported by GSM/GPRS modems and mobile phones. To find out the message storage areas that are supported by your GSM/GPRS modem or mobile phone, you can perform a test operation with the +CPMS AT command using the command line below:
AT+CPMS=?
If the GSM/GPRS modem or mobile phone executes the above command line successfully, it will return an information response to the computer / PC. The information response of the +CPMS AT command has the following format:
+CPMS: (storage1a,storage1b,...),(storage2a,storage2b,...),(storage3a,storage3b,...)
The first, second and third parentheses contain the values supported by the message_storage1 parameter, the message_storage2 parameter and the message_storage3 parameter respectively.
Previous Page | Page 36 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)