14#include <zephyr/types.h>
51#define SMS_MAX_PAYLOAD_LEN_CHARS 160
57#define SMS_MAX_ADDRESS_LEN_CHARS 20
int sms_register_listener(sms_callback_t listener, void *context)
Register a new listener to SMS library.
void(* sms_callback_t)(struct sms_data *const data, void *context)
SMS listener callback function.
Definition sms.h:167
#define SMS_MAX_ADDRESS_LEN_CHARS
Maximum length of SMS address, i.e., phone number, in characters as specified in 3GPP TS 23....
Definition sms.h:57
#define SMS_MAX_PAYLOAD_LEN_CHARS
Maximum length of SMS in number of characters as specified in 3GPP TS 23.038 Section 4 and Section 6....
Definition sms.h:51
void sms_unregister_listener(int handle)
Unregister a listener.
int sms_send_text(const char *number, const char *text)
Send SMS message as ASCII string with ISO-8859-15 extension.
int sms_send(const char *number, const uint8_t *data, uint16_t data_len, enum sms_data_type type)
Send SMS message in given message type.
sms_type
SMS message type.
Definition sms.h:30
@ SMS_TYPE_DELIVER
SMS-DELIVER message type.
Definition sms.h:32
@ SMS_TYPE_STATUS_REPORT
SMS-STATUS-REPORT message type.
Definition sms.h:34
sms_data_type
SMS data type.
Definition sms.h:40
@ SMS_DATA_TYPE_GSM7BIT
GSM 7 bit Default Alphabet as specified in 3GPP TS 23.038 Section 6.2.
Definition sms.h:44
@ SMS_DATA_TYPE_ASCII
ASCII string with ISO-8859-15 extension.
Definition sms.h:42
uint8_t type
Address type as specified in 3GPP TS 23.040 Section 9.1.2.5.
Definition sms.h:84
uint8_t length
Address length in number of characters.
Definition sms.h:82
char address_str[20+1]
Address in NUL-terminated string format.
Definition sms.h:80
SMS address, i.e., phone number.
Definition sms.h:78
int payload_len
Length of the payload buffer.
Definition sms.h:151
uint8_t payload[160+1]
SMS message payload.
Definition sms.h:163
union sms_header header
SMS header.
Definition sms.h:148
enum sms_type type
Received message type.
Definition sms.h:146
SMS PDU data.
Definition sms.h:144
uint8_t year
Year. Last two digits of the year.
Definition sms.h:63
uint8_t hour
Hour.
Definition sms.h:66
uint8_t second
Second.
Definition sms.h:68
uint8_t month
Month.
Definition sms.h:64
int8_t timezone
Timezone in quarters of an hour.
Definition sms.h:69
uint8_t day
Day.
Definition sms.h:65
uint8_t minute
Minute.
Definition sms.h:67
SMS time information specified in 3GPP TS 23.040 Section 9.2.3.11.
Definition sms.h:62
uint16_t src_port
Source port.
Definition sms.h:114
uint16_t dest_port
Destination port.
Definition sms.h:112
bool present
Indicates whether this field is present in the SMS message.
Definition sms.h:110
SMS application port addressing information.
Definition sms.h:108
bool present
Indicates whether this field is present in the SMS message.
Definition sms.h:94
uint8_t total_msgs
Maximum number of short messages in the concatenated short message.
Definition sms.h:98
uint16_t ref_number
Concatenated short message reference number.
Definition sms.h:96
uint8_t seq_number
Sequence number of the current short message.
Definition sms.h:100
SMS concatenated short message information.
Definition sms.h:92