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.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

lwgsmr_t lwgsm_pb_disable(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Disable phonebook functionality.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

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.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] mem: Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory

  • [in] name: Entry name

  • [in] num: Entry phone number

  • [in] type: Entry phone number type

  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

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.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] mem: Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory

  • [in] pos: Entry position in memory to edit

  • [in] name: New entry name

  • [in] num: New entry phone number

  • [in] type: New entry phone number type

  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

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.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] mem: Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory

  • [in] pos: Entry position in memory to delete

  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

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.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] mem: Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory

  • [in] pos: Entry position in memory to read

  • [out] entry: Pointer to entry variable to save data

  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

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.

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] mem: Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory

  • [in] start_index: Start position in memory to list

  • [out] entries: Pointer to array to save entries

  • [in] etr: Number of entries to read

  • [out] er: Pointer to output variable to save entries listed

  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not

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

Return

lwgsmOK on success, member of lwgsmr_t otherwise

Parameters
  • [in] mem: Memory to use to save entry. Use LWGSM_MEM_CURRENT to use current memory

  • [in] search: String to search for

  • [out] entries: Pointer to array to save entries

  • [in] etr: Number of entries to read

  • [out] er: Pointer to output variable to save entries found

  • [in] evt_fn: Callback function called when command has finished. Set to NULL when not used

  • [in] evt_arg: Custom argument for event callback function

  • [in] blocking: Status whether command should be blocking or not