## Phonebook service

Phonebook service — Support for the Phonebook service.

## Functions

void | mbim_phonebook_entry_array_free ()
MbimMessage * | mbim_message_phonebook_configuration_query_new ()
gboolean | mbim_message_phonebook_configuration_response_parse ()
gboolean | mbim_message_phonebook_configuration_notification_parse ()
MbimMessage * | mbim_message_phonebook_read_query_new ()
gboolean | mbim_message_phonebook_read_response_parse ()
MbimMessage * | mbim_message_phonebook_delete_set_new ()
gboolean | mbim_message_phonebook_delete_response_parse ()
MbimMessage * | mbim_message_phonebook_write_set_new ()
gboolean | mbim_message_phonebook_write_response_parse ()

## Types and Values

| MbimPhonebookEntry
typedef | MbimPhonebookEntryArray

## Description

This section implements support for requests, responses and notifications in the Phonebook service.

## Functions

### mbim_phonebook_entry_array_free ()

    void
    mbim_phonebook_entry_array_free (MbimPhonebookEntryArray *array);

Frees the memory allocated for the array of MbimPhonebookEntry structs.

#### Parameters

array | a NULL terminated array of MbimPhonebookEntry structs. |

Since: 1.4

### mbim_message_phonebook_configuration_query_new ()

    MbimMessage *
    mbim_message_phonebook_configuration_query_new
                                   (GError **error);

Create a new request for the 'Configuration' query command in the 'Phonebook' service.

#### Parameters

error | return location for error or `NULL`. |

#### Returns

a newly allocated MbimMessage, which should be freed with `mbim_message_unref()`.

Since: 1.4

### mbim_message_phonebook_configuration_response_parse ()

    gboolean
    mbim_message_phonebook_configuration_response_parse
                                   (const MbimMessage *message,
                                    MbimPhonebookState *out_state,
                                    guint32 *out_number_of_entries,
                                    guint32 *out_used_entries,
                                    guint32 *out_max_number_length,
                                    guint32 *out_max_name,
                                    GError **error);

Parses and returns parameters of the 'Configuration' response command in the 'Phonebook' service.

#### Parameters

message | the MbimMessage. |
out_state | return location for a MbimPhonebookState, or `NULL` if the 'State' field is not needed. | [out][optional][transfer none]
out_number_of_entries | return location for a guint32, or `NULL` if the 'NumberOfEntries' field is not needed. | [out][optional][transfer none]
out_used_entries | return location for a guint32, or `NULL` if the 'UsedEntries' field is not needed. | [out][optional][transfer none]
out_max_number_length | return location for a guint32, or `NULL` if the 'MaxNumberLength' field is not needed. | [out][optional][transfer none]
out_max_name | return location for a guint32, or `NULL` if the 'MaxName' field is not needed. | [out][optional][transfer none]
error | return location for error or `NULL`. |

#### Returns

`TRUE` if the message was correctly parsed, `FALSE` if `error` is set.

Since: 1.4

### mbim_message_phonebook_configuration_notification_parse ()

    gboolean
    mbim_message_phonebook_configuration_notification_parse
                                   (const MbimMessage *message,
                                    MbimPhonebookState *out_state,
                                    guint32 *out_number_of_entries,
                                    guint32 *out_used_entries,
                                    guint32 *out_max_number_length,
                                    guint32 *out_max_name,
                                    GError **error);

Parses and returns parameters of the 'Configuration' notification command in the 'Phonebook' service.

#### Parameters

message | the MbimMessage. |
out_state | return location for a MbimPhonebookState, or `NULL` if the 'State' field is not needed. | [out][optional][transfer none]
out_number_of_entries | return location for a guint32, or `NULL` if the 'NumberOfEntries' field is not needed. | [out][optional][transfer none]
out_used_entries | return location for a guint32, or `NULL` if the 'UsedEntries' field is not needed. | [out][optional][transfer none]
out_max_number_length | return location for a guint32, or `NULL` if the 'MaxNumberLength' field is not needed. | [out][optional][transfer none]
out_max_name | return location for a guint32, or `NULL` if the 'MaxName' field is not needed. | [out][optional][transfer none]
error | return location for error or `NULL`. |

#### Returns

`TRUE` if the message was correctly parsed, `FALSE` if `error` is set.

Since: 1.4

### mbim_message_phonebook_read_query_new ()

    MbimMessage *
    mbim_message_phonebook_read_query_new (MbimPhonebookFlag filter_flag,
                                           guint32 filter_message_index,
                                           GError **error);

Create a new request for the 'Read' query command in the 'Phonebook' service.

#### Parameters

filter_flag | the 'FilterFlag' field, given as a MbimPhonebookFlag. | [in]
filter_message_index | the 'FilterMessageIndex' field, given as a guint32. | [in]
error | return location for error or `NULL`. |

#### Returns

a newly allocated MbimMessage, which should be freed with `mbim_message_unref()`.

Since: 1.4

### mbim_message_phonebook_read_response_parse ()

    gboolean
    mbim_message_phonebook_read_response_parse
                                   (const MbimMessage *message,
                                    guint32 *out_entry_count,
                                    MbimPhonebookEntryArray **out_entries,
                                    GError **error);

Parses and returns parameters of the 'Read' response command in the 'Phonebook' service.

#### Parameters

message | the MbimMessage. |
out_entry_count | return location for a guint32, or `NULL` if the 'EntryCount' field is not needed. | [out][optional][transfer none]
out_entries | return location for a newly allocated array of MbimPhonebookEntry items, or `NULL` if the 'Entries' field is not needed. Free the returned value with `mbim_phonebook_entry_array_free()`. | [out][optional][transfer full][array zero-terminated=1][element-type MbimPhonebookEntry]
error | return location for error or `NULL`. |

#### Returns

`TRUE` if the message was correctly parsed, `FALSE` if `error` is set.

Since: 1.4

### mbim_message_phonebook_delete_set_new ()

    MbimMessage *
    mbim_message_phonebook_delete_set_new (MbimPhonebookFlag filter_flag,
                                           guint32 filter_message_index,
                                           GError **error);

Create a new request for the 'Delete' set command in the 'Phonebook' service.

#### Parameters

filter_flag | the 'FilterFlag' field, given as a MbimPhonebookFlag. | [in]
filter_message_index | the 'FilterMessageIndex' field, given as a guint32. | [in]
error | return location for error or `NULL`. |

#### Returns

a newly allocated MbimMessage, which should be freed with `mbim_message_unref()`.

Since: 1.4

### mbim_message_phonebook_delete_response_parse ()

    gboolean
    mbim_message_phonebook_delete_response_parse
                                   (const MbimMessage *message,
                                    GError **error);

Parses and returns parameters of the 'Delete' response command in the 'Phonebook' service.

#### Parameters

message | the MbimMessage. |
error | return location for error or `NULL`. |

#### Returns

`TRUE` if the message was correctly parsed, `FALSE` if `error` is set.

Since: 1.4

### mbim_message_phonebook_write_set_new ()

    MbimMessage *
    mbim_message_phonebook_write_set_new (MbimPhonebookWriteFlag save_flag,
                                          guint32 save_index,
                                          const gchar *number,
                                          const gchar *name,
                                          GError **error);

Create a new request for the 'Write' set command in the 'Phonebook' service.

#### Parameters

save_flag | the 'SaveFlag' field, given as a MbimPhonebookWriteFlag. | [in]
save_index | the 'SaveIndex' field, given as a guint32. | [in]
number | the 'Number' field, given as a string. | [in]
name | the 'Name' field, given as a string. | [in]
error | return location for error or `NULL`. |

#### Returns

a newly allocated MbimMessage, which should be freed with `mbim_message_unref()`.

Since: 1.4

### mbim_message_phonebook_write_response_parse ()

    gboolean
    mbim_message_phonebook_write_response_parse
                                   (const MbimMessage *message,
                                    GError **error);

Parses and returns parameters of the 'Write' response command in the 'Phonebook' service.

#### Parameters

message | the MbimMessage. |
error | return location for error or `NULL`. |

#### Returns

`TRUE` if the message was correctly parsed, `FALSE` if `error` is set.

Since: 1.4

## Types and Values

### MbimPhonebookEntry

    typedef struct {
        guint32 entry_index;
        gchar *number;
        gchar *name;
    } MbimPhonebookEntry;

A MbimPhonebookEntry element.

#### Members

guint32 `entry_index`; | a guint32. |
gchar *`number`; | a string. |
gchar *`name`; | a string. |

Since: 1.4

### MbimPhonebookEntryArray

    typedef MbimPhonebookEntry *MbimPhonebookEntryArray;

A NULL-terminated array of MbimPhonebookEntry elements.

Since: 1.24