
-22-
v4.9
GSM related functions
4.14. Sending SMS
It sends an SMS to the specified number.
Note:
the maximum length is 160 Bytes (160 characters).
Example of use:
{
// Sends this text in a SMS to the desired number
_3G.sendSMS(“Hello World!”,“6********”);
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with CMS error code available
4.15. Getting the number of SMS stored in SIM card
This function gets the number of total SMS stored in the SIM card.
Example of use:
{
uint8_t total_SMS=0;
// Gets the total SMS in SIM card:
total_SMS=_3G.getTotalSMS();
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with CMS error code available
4.16. Deleting SMS
This function deletes an SMS stored in the SIM card. It’s advisable use first the function
getTotalSMS()
in order to know the
number of SMS.
Example of use:
{
// Deletes the SMS in the 2 index:
total_SMS=_3G.getTotalSMS();
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with CMS error code available