18 #ifndef AT_CELLULAR_SMS_H_ 19 #define AT_CELLULAR_SMS_H_ 21 #include "CellularSMS.h" 22 #include "AT_CellularBase.h" 43 CellularSMSEncoding encoding = CellularSMSEncoding7Bit);
48 char *time_stamp, uint16_t time_len,
int *buf_size);
65 char date[SMS_MAX_TIME_STAMP_SIZE];
66 uint16_t msg_index[50];
70 uint16_t msg_ref_number;
71 struct sms_info_t *next_info;
72 sms_info_t() : msg_size(0), parts(1), parts_added(1), msg_ref_number(0), next_info(0) {};
77 CellularSMSMmode _mode;
78 bool _use_8bit_encoding;
79 uint32_t _sim_wait_time;
80 uint16_t _sms_message_ref_number;
81 sms_info_t *_sms_info;
128 int read_sms_params(
char *,
char *);
129 void free_linked_list();
130 void add_info(sms_info_t *
info,
int index,
int part_number);
131 int read_udh_from_pdu(
const char *pdu, sms_info_t *info,
int &part_number,
int &padding_bits);
133 char *phone_number = NULL,
char *msg = NULL);
134 nsapi_size_or_error_t read_pdu_payload(
const char *pdu,
int msg_len,
int scheme,
char *msg,
int padding_bits);
135 sms_info_t *get_oldest_sms_index();
136 bool create_time(
const char *time_string, time_t *time);
137 int compare_time_strings(
const char *time_string_1,
const char *time_string_2);
138 char *create_pdu(
const char *phone_number,
const char *message, uint8_t message_length, uint8_t msg_parts,
139 uint8_t msg_part_number, uint8_t &header_size);
152 uint16_t pack_7_bit_gsm_and_hex(
const char *str, uint16_t len,
char *buf,
int number_of_padding_bit);
164 uint16_t unpack_7_bit_gsm_to_str(
const char *str,
int len,
char *buf,
int padding_bits,
170 #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.