18 #ifndef CELLULAR_SMS_H_ 19 #define CELLULAR_SMS_H_ 22 #include "nsapi_types.h" 27 const uint16_t SMS_MAX_SIZE_WITH_CONCATENATION = 4096 + 1;
28 const uint16_t SMS_MAX_PHONE_NUMBER_SIZE = 20 + 1;
29 const uint16_t SMS_MAX_TIME_STAMP_SIZE = 20 + 1;
31 const uint16_t SMS_MAX_SIZE_8BIT_SINGLE_SMS_SIZE = 140;
32 const uint16_t SMS_MAX_SIZE_GSM7_SINGLE_SMS_SIZE = 160;
34 const uint16_t SMS_SIM_WAIT_TIME_MILLISECONDS = 200;
36 const int SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ = -5001;
60 enum CellularSMSMmode {
61 CellularSMSMmodePDU = 0,
65 enum CellularSMSEncoding {
66 CellularSMSEncoding7Bit,
67 CellularSMSEncoding8Bit,
78 CellularSMSEncoding encoding = CellularSMSEncoding::CellularSMSEncoding7Bit) = 0;
111 char *time_stamp, uint16_t time_len,
int *buf_size) = 0;
182 #endif // CELLULAR_SMS_H_ 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...
virtual nsapi_error_t set_csca(const char *sca, int type)=0
CSCA - set Service Center Address.
virtual nsapi_size_or_error_t set_cscs(const char *chr_set)=0
Set command sets the current character set used by the device.
virtual nsapi_error_t set_cpms(const char *memr, const char *memw, const char *mems)=0
CPMS preferred message storage.
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.
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.
signed int nsapi_error_t
Type used to represent error codes.
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
virtual nsapi_error_t initialize(CellularSMSMmode mode, CellularSMSEncoding encoding=CellularSMSEncoding::CellularSMSEncoding7Bit)=0
Does all the necessary initializations needed for receiving and sending SMS.
virtual ~CellularSMS()
virtual Destructor
virtual nsapi_error_t delete_all_messages()=0
Deletes all messages from the currently set memory/SIM.
virtual void set_sms_callback(Callback< void()> func)=0
Callback that is called when new SMS is received.
Callback class based on template specialization.