Class CellularSMS. More...
#include <CellularSMS.h>
Public Member Functions | |
virtual nsapi_error_t | initialize (CellularSMSMmode mode)=0 |
Does all the necessary initializations needed for receiving and sending SMS. More... | |
virtual nsapi_size_or_error_t | send_sms (const char *phone_number, const char *message, int msg_len)=0 |
Send the SMS with the given parameters. More... | |
virtual nsapi_size_or_error_t | get_sms (char *buf, uint16_t buf_len, char *phone_num, uint16_t phone_len, char *time_stamp, uint16_t time_len, int *buf_size)=0 |
Gets the oldest received sms. More... | |
virtual void | set_sms_callback (Callback< void()> func)=0 |
Callback that is called when new SMS is received. More... | |
virtual nsapi_error_t | set_cpms (const char *memr, const char *memw, const char *mems)=0 |
CPMS preferred message storage. More... | |
virtual nsapi_error_t | set_csca (const char *sca, int type)=0 |
CSCA - set Service Center Address. More... | |
virtual nsapi_size_or_error_t | set_cscs (const char *chr_set)=0 |
Set command sets the current character set used by the device. More... | |
virtual nsapi_error_t | delete_all_messages ()=0 |
Deletes all messages from the currently set memory/SIM. More... | |
virtual void | set_extra_sim_wait_time (int sim_wait_time)=0 |
Some modems need extra time between AT commands and responses, or there will be error -314, SIM busy. More... | |
Protected Member Functions | |
virtual | ~CellularSMS () |
virtual Destructor More... | |
Class CellularSMS.
An abstract interface for SMS sending, reading and deleting.
Definition at line 48 of file CellularSMS.h.
|
protectedvirtual |
virtual Destructor
Definition at line 56 of file CellularSMS.h.
|
pure virtual |
Deletes all messages from the currently set memory/SIM.
Implemented in AT_CellularSMS.
|
pure virtual |
Gets the oldest received sms.
buf | preallocated buffer for SMS message content |
buf_len | length of allocated buf |
phone_num | preallocated buffer for phone number where SMS was sent |
phone_len | length of allocated phone_num buffer |
time_stamp | preallocated buffer for TP-Service Centre Time Stamp (format: yy/MM/dd,hh:mm:ss-+zz). +-zz is timezone. The unit of time zone is a quarter of an hour relative to GMT. For example +32 would be GMT+8. |
time_len | length of allocated time_stamp buffer |
buf_size | if method return error NSAPI_ERROR_NO_MEMORY because the given buf was not big enough, this holds the size which is enough. Otherwise zero. |
Implemented in AT_CellularSMS.
|
pure virtual |
Does all the necessary initializations needed for receiving and sending SMS.
mode | enumeration for choosing the correct mode: text/pdu |
|
pure virtual |
Send the SMS with the given parameters.
phone_number | Phone number where to send SMS |
message | SMS message content |
msg_len | Length of the message |
Implemented in AT_CellularSMS.
|
pure virtual |
CPMS preferred message storage.
memr | memory from which messages are read and deleted "SM" - SIM SMS memory storage (default) "ME" - NVM SMS storage |
memw | memory to which writing and sending operations are made "SM" - SIM SMS memory storage (default) "ME" - NVM SMS storage |
mems | memory to which received SMs are preferred to be stored "SM" - SIM SMS memory storage (default) "ME" - NVM SMS storage |
Implemented in AT_CellularSMS.
|
pure virtual |
CSCA - set Service Center Address.
sca | Service Center Address to be used for mobile originated SMS transmissions. |
type | 129 - national numbering scheme, 145 - international numbering scheme (contains the character "+") |
Implemented in AT_CellularSMS.
|
pure virtual |
Set command sets the current character set used by the device.
"GSM", "IRA",....
chr_set | preferred character set list (comma separated). Modem might not support the wanted character set, so chr_set list is looped from start until supported set is found. Used character set index is returned. See more from 3GPP TS 27.005. |
Implemented in AT_CellularSMS.
|
pure virtual |
Some modems need extra time between AT commands and responses, or there will be error -314, SIM busy.
If SIM busy errors are an issue, this time should be increased. It can also be set to zero to make operations faster and more energy efficient if no errors will follow. By default, wait time is zero.
sim_wait_time |
Implemented in AT_CellularSMS.
|
pure virtual |
Callback that is called when new SMS is received.
SMS can be fetched using method get_sms().
func | Callback function that is called when new SMS is received. |
Implemented in AT_CellularSMS.