18#ifndef AT_CELLULAR_SMS_H_
19#define AT_CELLULAR_SMS_H_
21#if MBED_CONF_CELLULAR_USE_SMS
23#include "CellularSMS.h"
26#include "AT_CellularDevice.h"
43class AT_CellularSMS:
public CellularSMS {
46 AT_CellularSMS(ATHandler &atHandler, AT_CellularDevice &device);
47 virtual ~AT_CellularSMS();
53 CellularSMSEncoding encoding = CellularSMSEncoding7Bit);
57 virtual nsapi_size_or_error_t get_sms(
char *buf, uint16_t buf_len,
char *phone_num, uint16_t phone_len,
58 char *time_stamp, uint16_t time_len,
int *buf_size);
60 virtual void set_sms_callback(Callback<
void()> func);
62 virtual nsapi_error_t set_cpms(
const char *memr,
const char *memw,
const char *mems);
70 virtual void set_extra_sim_wait_time(
int sim_wait_time);
74 char date[SMS_MAX_TIME_STAMP_SIZE];
75 uint16_t msg_index[50];
79 uint16_t msg_ref_number;
80 struct sms_info_t *next_info;
81 sms_info_t() : msg_size(0), parts(1), parts_added(1), msg_ref_number(0), next_info(0) {};
129 int read_sms_params(
char *,
char *);
130 void free_linked_list();
131 void add_info(sms_info_t *
info,
int index,
int part_number);
132 int read_udh_from_pdu(
const char *pdu, sms_info_t *
info,
int &part_number,
int &padding_bits);
134 char *phone_number = NULL,
char *msg = NULL);
135 nsapi_size_or_error_t read_pdu_payload(
const char *pdu,
int msg_len,
int scheme,
char *msg,
int padding_bits);
136 sms_info_t *get_oldest_sms_index();
137 bool create_time(
const char *time_string, time_t *time);
138 int compare_time_strings(
const char *time_string_1,
const char *time_string_2);
139 char *create_pdu(
const char *phone_number,
const char *message, uint8_t message_length, uint8_t msg_parts,
140 uint8_t msg_part_number, uint8_t &header_size);
153 uint16_t pack_7_bit_gsm_and_hex(
const char *str, uint16_t len,
char *buf,
int number_of_padding_bit);
165 uint16_t unpack_7_bit_gsm_to_str(
const char *str,
int len,
char *buf,
int padding_bits,
170 Callback<void()> _cb;
171 CellularSMSMmode _mode;
172 bool _use_8bit_encoding;
173 uint32_t _sim_wait_time;
174 uint16_t _sms_message_ref_number;
175 sms_info_t *_sms_info;
178 AT_CellularDevice &_device;
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
signed int nsapi_error_t
Type used to represent error codes.