Phonebook
- group LWGSM_PHONEBOOK
Phonebook manager.
Functions
-
lwgsmr_t lwgsm_pb_enable(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
Enable phonebook functionality.
-
lwgsmr_t lwgsm_pb_disable(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
Disable phonebook functionality.
-
lwgsmr_t lwgsm_pb_add(lwgsm_mem_t mem, const char *name, const char *num, lwgsm_number_type_t type, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
Add new phonebook entry to desired memory.
- Parameters
mem – [in] Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory
name – [in] Entry name
num – [in] Entry phone number
type – [in] Entry phone number type
evt_fn – [in] Callback function called when command has finished. Set to
NULL
when not usedevt_arg – [in] Custom argument for event callback function
blocking – [in] Status whether command should be blocking or not
- Returns
-
lwgsmr_t lwgsm_pb_edit(lwgsm_mem_t mem, size_t pos, const char *name, const char *num, lwgsm_number_type_t type, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
Edit or overwrite phonebook entry at desired memory and position.
- Parameters
mem – [in] Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory
pos – [in] Entry position in memory to edit
name – [in] New entry name
num – [in] New entry phone number
type – [in] New entry phone number type
evt_fn – [in] Callback function called when command has finished. Set to
NULL
when not usedevt_arg – [in] Custom argument for event callback function
blocking – [in] Status whether command should be blocking or not
- Returns
-
lwgsmr_t lwgsm_pb_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 phonebook entry at desired memory and position.
- Parameters
mem – [in] Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory
pos – [in] Entry position in memory to delete
evt_fn – [in] Callback function called when command has finished. Set to
NULL
when not usedevt_arg – [in] Custom argument for event callback function
blocking – [in] Status whether command should be blocking or not
- Returns
-
lwgsmr_t lwgsm_pb_read(lwgsm_mem_t mem, size_t pos, lwgsm_pb_entry_t *entry, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
Read single phonebook entry.
- Parameters
mem – [in] Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory
pos – [in] Entry position in memory to read
entry – [out] Pointer to entry variable to save data
evt_fn – [in] Callback function called when command has finished. Set to
NULL
when not usedevt_arg – [in] Custom argument for event callback function
blocking – [in] Status whether command should be blocking or not
- Returns
-
lwgsmr_t lwgsm_pb_list(lwgsm_mem_t mem, size_t start_index, lwgsm_pb_entry_t *entries, size_t etr, size_t *er, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
List entires from specific memory.
- Parameters
mem – [in] Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory
start_index – [in] Start position in memory to list
entries – [out] Pointer to array to save entries
etr – [in] Number of entries to read
er – [out] Pointer to output variable to save entries listed
evt_fn – [in] Callback function called when command has finished. Set to
NULL
when not usedevt_arg – [in] Custom argument for event callback function
blocking – [in] Status whether command should be blocking or not
- Returns
-
lwgsmr_t lwgsm_pb_search(lwgsm_mem_t mem, const char *search, lwgsm_pb_entry_t *entries, size_t etr, size_t *er, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)
Search for entires with specific name from specific memory.
Note
Search works by entry name only. Phone number search is not available
- Parameters
mem – [in] Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory
search – [in] String to search for
entries – [out] Pointer to array to save entries
etr – [in] Number of entries to read
er – [out] Pointer to output variable to save entries found
evt_fn – [in] Callback function called when command has finished. Set to
NULL
when not usedevt_arg – [in] Custom argument for event callback function
blocking – [in] Status whether command should be blocking or not
- Returns
-
lwgsmr_t lwgsm_pb_enable(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)