SMS¶
-
group
LWGSM_SMS SMS manager.
Enums
-
enum
lwgsm_sms_status_t¶ SMS status in current memory.
Values:
-
enumerator
LWGSM_SMS_STATUS_ALL¶ Process all SMS, used for mass delete or SMS list
-
enumerator
LWGSM_SMS_STATUS_READ¶ SMS status is read
-
enumerator
LWGSM_SMS_STATUS_UNREAD¶ SMS status is unread
-
enumerator
LWGSM_SMS_STATUS_SENT¶ SMS status is sent
-
enumerator
LWGSM_SMS_STATUS_UNSENT¶ SMS status is unsent
-
enumerator
LWGSM_SMS_STATUS_INBOX¶ SMS status, used only for mass delete operation
-
enumerator
Functions
-
lwgsmr_t
lwgsm_sms_enable(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Enable SMS functionality.
-
lwgsmr_t
lwgsm_sms_disable(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Disable SMS functionality.
-
lwgsmr_t
lwgsm_sms_send(const char *num, const char *text, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Send SMS text to phone number.
- Return
- Parameters
[in] num: String number[in] text: Text to send. Maximal160characters[in] evt_fn: Callback function called when command has finished. Set toNULLwhen not used[in] evt_arg: Custom argument for event callback function[in] blocking: Status whether command should be blocking or not
-
lwgsmr_t
lwgsm_sms_read(lwgsm_mem_t mem, size_t pos, lwgsm_sms_entry_t *entry, uint8_t update, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Read SMS entry at specific memory and position.
- Return
- Parameters
[in] mem: Memory used to read message from[in] pos: Position number in memory to read[out] entry: Pointer to SMS entry structure to fill data to[in] update: Flag indicates update. Set to1to changeUNREADmessages toREADor0to leave as is[in] evt_fn: Callback function called when command has finished. Set toNULLwhen not used[in] evt_arg: Custom argument for event callback function[in] blocking: Status whether command should be blocking or not
-
lwgsmr_t
lwgsm_sms_delete(lwgsm_mem_t mem, size_t pos, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Delete SMS entry at specific memory and position.
- Return
- Parameters
[in] mem: Memory used to read message from[in] pos: Position number in memory to read[in] evt_fn: Callback function called when command has finished. Set toNULLwhen not used[in] evt_arg: Custom argument for event callback function[in] blocking: Status whether command should be blocking or not
-
lwgsmr_t
lwgsm_sms_delete_all(lwgsm_sms_status_t status, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Delete all SMS entries with specific status.
- Return
- Parameters
[in] status: SMS status. This parameter can be one of all possible types in lwgsm_sms_status_t enumeration[in] evt_fn: Callback function called when command has finished. Set toNULLwhen not used[in] evt_arg: Custom argument for event callback function[in] blocking: Status whether command should be blocking or not
-
lwgsmr_t
lwgsm_sms_list(lwgsm_mem_t mem, lwgsm_sms_status_t stat, lwgsm_sms_entry_t *entries, size_t etr, size_t *er, uint8_t update, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ List SMS from SMS memory.
- Return
- Parameters
[in] mem: Memory to read entries from. Use LWGSM_MEM_CURRENT to read from current memory[in] stat: SMS status to read, eitherread,unread,sent,unsentorall[out] entries: Pointer to array to save SMS entries[in] etr: Number of entries to read[out] er: Pointer to output variable to save number of entries in array[in] update: Flag indicates update. Set to1to changeUNREADmessages toREADor0to leave as is[in] evt_fn: Callback function called when command has finished. Set toNULLwhen not used[in] evt_arg: Custom argument for event callback function[in] blocking: Status whether command should be blocking or not
-
lwgsmr_t
lwgsm_sms_set_preferred_storage(lwgsm_mem_t mem1, lwgsm_mem_t mem2, lwgsm_mem_t mem3, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)¶ Set preferred storage for SMS.
- Return
- Parameters
[in] mem1: Preferred memory for read/delete SMS operations. Use LWGSM_MEM_CURRENT to keep it as is[in] mem2: Preferred memory for sent/write SMS operations. Use LWGSM_MEM_CURRENT to keep it as is[in] mem3: Preferred memory for received SMS entries. Use LWGSM_MEM_CURRENT to keep it as is[in] evt_fn: Callback function called when command has finished. Set toNULLwhen not used[in] evt_arg: Custom argument for event callback function[in] blocking: Status whether command should be blocking or not
-
struct
lwgsm_sms_mem_t¶ - #include <lwgsm_private.h>
SMS memory information.
Public Members
-
uint32_t
mem_available¶ Bit field of available memories
-
lwgsm_mem_t
current¶ Current memory choice
-
size_t
total¶ Size of memory in units of entries
-
size_t
used¶ Number of used entries
-
uint32_t
-
struct
lwgsm_sms_t¶ - #include <lwgsm_private.h>
SMS structure.
Public Members
-
uint8_t
ready¶ Flag indicating feature ready by device
-
uint8_t
enabled¶ Flag indicating feature enabled
-
lwgsm_sms_mem_t
mem[3]¶ 3 memory info for operation,receive,sent storage
-
uint8_t
-
struct
lwgsm_pb_mem_t¶ - #include <lwgsm_private.h>
SMS memory information.
Public Members
-
uint32_t
mem_available¶ Bit field of available memories
-
lwgsm_mem_t
current¶ Current memory choice
-
size_t
total¶ Size of memory in units of entries
-
size_t
used¶ Number of used entries
-
uint32_t
-
struct
lwgsm_sms_entry_t¶ - #include <lwgsm_typedefs.h>
SMS entry structure.
Public Members
-
lwgsm_mem_t
mem¶ Memory storage
-
size_t
pos¶ Memory position
-
lwgsm_datetime_t
datetime¶ Date and time
-
lwgsm_sms_status_t
status¶ Message status
-
char
number[26]¶ Phone number
-
char
name[20]¶ Name in phonebook if exists
-
char
data[161]¶ Data memory
-
size_t
length¶ Length of SMS data
-
lwgsm_mem_t
-
enum