18 #ifndef AT_CELLULAR_SMS_H_ 19 #define AT_CELLULAR_SMS_H_ 21 #include "CellularSMS.h" 22 #include "AT_CellularBase.h" 47 char *time_stamp, uint16_t time_len,
int *buf_size);
64 char date[SMS_MAX_TIME_STAMP_SIZE];
65 uint16_t msg_index[50];
69 uint16_t msg_ref_number;
70 struct sms_info_t *next_info;
71 sms_info_t() : msg_size(0), parts(1), parts_added(1), msg_ref_number(0), next_info(0) {};
76 CellularSMSMmode _mode;
77 bool _use_8bit_encoding;
78 uint32_t _sim_wait_time;
79 uint16_t _sms_message_ref_number;
80 sms_info_t *_sms_info;
127 int read_sms_params(
char *,
char *);
128 void free_linked_list();
129 void add_info(sms_info_t *
info,
int index,
int part_number);
130 int read_udh_from_pdu(
const char *pdu, sms_info_t *info,
int &part_number,
int &padding_bits);
132 char *phone_number = NULL,
char *msg = NULL);
133 nsapi_size_or_error_t read_pdu_payload(
const char *pdu,
int msg_len,
int scheme,
char *msg,
int padding_bits);
134 sms_info_t *get_oldest_sms_index();
135 bool create_time(
const char *time_string, time_t *time);
136 int compare_time_strings(
const char *time_string_1,
const char *time_string_2);
137 char *create_pdu(
const char *phone_number,
const char *message, uint8_t message_length, uint8_t msg_parts,
138 uint8_t msg_part_number, uint8_t &header_size);
151 uint16_t pack_7_bit_gsm_and_hex(
const char *str, uint16_t len,
char *buf,
int number_of_padding_bit);
163 uint16_t unpack_7_bit_gsm_to_str(
const char *str,
int len,
char *buf,
int padding_bits,
169 #endif // AT_CELLULAR_SMS_H_ virtual void set_extra_sim_wait_time(int sim_wait_time)
Some modems need extra time between AT commands and responses, or there will be error -314...
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_size_or_error_t set_cscs(const char *chr_set)
Set command sets the current character set used by the device.
virtual nsapi_error_t set_csca(const char *sca, int type)
CSCA - set Service Center Address.
virtual nsapi_error_t set_cpms(const char *memr, const char *memw, const char *mems)
CPMS preferred message storage.
virtual void set_sms_callback(Callback< void()> func)
Callback that is called when new SMS is received.
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)
Gets the oldest received sms.
Callback class based on template specialization.
Class for sending AT commands and parsing AT responses.
virtual nsapi_error_t delete_all_messages()
Deletes all messages from the currently set memory/SIM.
virtual nsapi_size_or_error_t send_sms(const char *phone_number, const char *message, int msg_len)
Send the SMS with the given parameters.