## MMModem3gppUssd

MMModem3gppUssd — The 3GPP USSD interface

## Functions

const gchar * | mm_modem_3gpp_ussd_get_path ()
gchar * | mm_modem_3gpp_ussd_dup_path ()
MMModem3gppUssdSessionState | mm_modem_3gpp_ussd_get_state ()
const gchar * | mm_modem_3gpp_ussd_get_network_request ()
gchar * | mm_modem_3gpp_ussd_dup_network_request ()
const gchar * | mm_modem_3gpp_ussd_get_network_notification ()
gchar * | mm_modem_3gpp_ussd_dup_network_notification ()
void | mm_modem_3gpp_ussd_initiate ()
gchar * | mm_modem_3gpp_ussd_initiate_finish ()
gchar * | mm_modem_3gpp_ussd_initiate_sync ()
void | mm_modem_3gpp_ussd_respond ()
gchar * | mm_modem_3gpp_ussd_respond_finish ()
gchar * | mm_modem_3gpp_ussd_respond_sync ()
void | mm_modem_3gpp_ussd_cancel ()
gboolean | mm_modem_3gpp_ussd_cancel_finish ()
gboolean | mm_modem_3gpp_ussd_cancel_sync ()

## Types and Values

struct | MMModem3gppUssd

## Object Hierarchy

        GObject
        ╰── GDBusProxy
            ╰── MmGdbusModem3gppUssdProxy
                ╰── MMModem3gppUssd

## Implemented Interfaces

MMModem3gppUssd implements GDBusInterface, GInitable, GAsyncInitable and MmGdbusModem3gppUssd.

## Description

The MMModem3gppUssd is an object providing access to the methods, signals and properties of the 3GPP USSD interface.

This interface is only exposed when the 3GPP modem is known to handle USSD operations.

## Functions

### mm_modem_3gpp_ussd_get_path ()

    const gchar *
    mm_modem_3gpp_ussd_get_path (MMModem3gppUssd *self);

Gets the DBus path of the MMObject which implements this interface.

#### Parameters

self | A MMModem3gppUssd. |

#### Returns

The DBus path of the MMObject object.

[transfer none]

Since: 1.0

### mm_modem_3gpp_ussd_dup_path ()

    gchar *
    mm_modem_3gpp_ussd_dup_path (MMModem3gppUssd *self);

Gets a copy of the DBus path of the MMObject object which implements this interface.

#### Parameters

self | A MMModem3gppUssd. |

#### Returns

The DBus path of the MMObject. The returned value should be freed with `g_free()`.

[transfer full]

Since: 1.0

### mm_modem_3gpp_ussd_get_state ()

    MMModem3gppUssdSessionState
    mm_modem_3gpp_ussd_get_state (MMModem3gppUssd *self);

Get the state of the ongoing USSD session, if any.

#### Parameters

self | A MMModem. |

#### Returns

A MMModem3gppUssdSessionState value, specifying the current state.

Since: 1.0

### mm_modem_3gpp_ussd_get_network_request ()

    const gchar *
    mm_modem_3gpp_ussd_get_network_request
                                   (MMModem3gppUssd *self);

Gets any pending network-initiated request.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where `self` was constructed. Use `mm_modem_3gpp_ussd_dup_network_request()` if on another thread.

#### Parameters

self | A MMModem3gppUssd. |

#### Returns

The network request, or `NULL` if none available.

[transfer none]

Since: 1.0

### mm_modem_3gpp_ussd_dup_network_request ()

    gchar *
    mm_modem_3gpp_ussd_dup_network_request
                                   (MMModem3gppUssd *self);

Gets a copy of any pending network-initiated request.

#### Parameters

self | A MMModem3gppUssd. |

#### Returns

The network request, or `NULL` if none available. The returned value should be freed with `g_free()`.

[transfer full]

Since: 1.0

### mm_modem_3gpp_ussd_get_network_notification ()

    const gchar *
    mm_modem_3gpp_ussd_get_network_notification
                                   (MMModem3gppUssd *self);

Gets any pending network-initiated request to which no USSD response is required.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where `self` was constructed. Use `mm_modem_3gpp_ussd_dup_network_notification()` if on another thread.

#### Parameters

self | A MMModem3gppUssd. |

#### Returns

The network notification, or `NULL` if none available.

[transfer none]

Since: 1.0

### mm_modem_3gpp_ussd_dup_network_notification ()

    gchar *
    mm_modem_3gpp_ussd_dup_network_notification
                                   (MMModem3gppUssd *self);

Gets a copy of any pending network-initiated request to which no USSD response is required.

#### Parameters

self | A MMModem3gppUssd. |

#### Returns

The network notification, or `NULL` if none available. The returned value should be freed with `g_free()`.

[transfer full]

Since: 1.0

### mm_modem_3gpp_ussd_initiate ()

    void
    mm_modem_3gpp_ussd_initiate (MMModem3gppUssd *self,
                                 const gchar *command,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

Asynchronously sends a USSD command string to the network initiating a USSD session.

When the request is handled by the network, the method returns the response or an appropriate error. The network may be awaiting further response from the ME after returning from this method and no new command.

When the operation is finished, `callback` will be invoked in the

thread-default main loop

of the thread you are calling this method from. You can then call `mm_modem_3gpp_ussd_initiate_finish()` to get the result of the operation.

See `mm_modem_3gpp_ussd_initiate_sync()` for the synchronous, blocking version of this method.

#### Parameters

self | A MMModem3gppUssd. |
command | The command to start the USSD session with. |
cancellable | A GCancellable or `NULL`. | [allow-none]
callback | A GAsyncReadyCallback to call when the request is satisfied or `NULL`. |
user_data | User data to pass to `callback` . |

Since: 1.0

### mm_modem_3gpp_ussd_initiate_finish ()

    gchar *
    mm_modem_3gpp_ussd_initiate_finish (MMModem3gppUssd *self,
                                        GAsyncResult *res,
                                        GError **error);

Finishes an operation started with `mm_modem_3gpp_ussd_initiate()`.

#### Parameters

self | A MMModem3gppUssd. |
res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_modem_3gpp_ussd_initiate()`. |
error | Return location for error or `NULL`. |

#### Returns

The response from the network, if any. The returned value should be freed with `g_free()`.

Since: 1.0

### mm_modem_3gpp_ussd_initiate_sync ()

    gchar *
    mm_modem_3gpp_ussd_initiate_sync (MMModem3gppUssd *self,
                                      const gchar *command,
                                      GCancellable *cancellable,
                                      GError **error);

Synchronously sends a USSD command string to the network initiating a USSD session.

When the request is handled by the network, the method returns the response or an appropriate error. The network may be awaiting further response from the ME after returning from this method and no new command.

The calling thread is blocked until a reply is received. See `mm_modem_3gpp_ussd_initiate()` for the asynchronous version of this method.

#### Parameters

self | A MMModem3gppUssd. |
command | The command to start the USSD session with. |
cancellable | A GCancellable or `NULL`. | [allow-none]
error | Return location for error or `NULL`. |

#### Returns

The response from the network, if any. The returned value should be freed with `g_free()`.

Since: 1.0

### mm_modem_3gpp_ussd_respond ()

    void
    mm_modem_3gpp_ussd_respond (MMModem3gppUssd *self,
                                const gchar *response,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously responds to a USSD request that is either initiated by the mobile network, or that is awaiting further input after a previous call to `mm_modem_3gpp_ussd_initiate()`.

When the operation is finished, `callback` will be invoked in the

thread-default main loop

of the thread you are calling this method from. You can then call `mm_modem_3gpp_ussd_respond_finish()` to get the result of the operation.

See `mm_modem_3gpp_ussd_respond_sync()` for the synchronous, blocking version of this method.

#### Parameters

self | A MMModem3gppUssd. |
response | The response to network-initiated USSD command, or a response to a request for further input. |
cancellable | A GCancellable or `NULL`. | [allow-none]
callback | A GAsyncReadyCallback to call when the request is satisfied or `NULL`. |
user_data | User data to pass to `callback` . |

Since: 1.0

### mm_modem_3gpp_ussd_respond_finish ()

    gchar *
    mm_modem_3gpp_ussd_respond_finish (MMModem3gppUssd *self,
                                       GAsyncResult *res,
                                       GError **error);

Finishes an operation started with `mm_modem_3gpp_ussd_respond()`.

#### Parameters

self | A MMModem3gppUssd. |
res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_modem_3gpp_ussd_respond()`. |
error | Return location for error or `NULL`. |

#### Returns

The network reply to this response to the network-initiated USSD command. The reply may require further responses. The returned value should be freed with `g_free()`.

Since: 1.0

### mm_modem_3gpp_ussd_respond_sync ()

    gchar *
    mm_modem_3gpp_ussd_respond_sync (MMModem3gppUssd *self,
                                     const gchar *response,
                                     GCancellable *cancellable,
                                     GError **error);

Synchronously responds to a USSD request that is either initiated by the mobile network, or that is awaiting further input after a previous call to `mm_modem_3gpp_ussd_initiate()`.

The calling thread is blocked until a reply is received. See `mm_modem_3gpp_ussd_respond()` for the asynchronous version of this method.

#### Parameters

self | A MMModem3gppUssd. |
response | The response to network-initiated USSD command, or a response to a request for further input. |
cancellable | A GCancellable or `NULL`. | [allow-none]
error | Return location for error or `NULL`. |

#### Returns

The network reply to this response to the network-initiated USSD command. The reply may require further responses. The returned value should be freed with `g_free()`.

Since: 1.0

### mm_modem_3gpp_ussd_cancel ()

    void
    mm_modem_3gpp_ussd_cancel (MMModem3gppUssd *self,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Asynchronously cancels an ongoing USSD session, either mobile or network initiated.

When the operation is finished, `callback` will be invoked in the

thread-default main loop

of the thread you are calling this method from. You can then call `mm_modem_3gpp_ussd_cancel_finish()` to get the result of the operation.

See `mm_modem_3gpp_ussd_cancel_sync()` for the synchronous, blocking version of this method.

#### Parameters

self | A MMModem3gppUssd. |
cancellable | A GCancellable or `NULL`. | [allow-none]
callback | A GAsyncReadyCallback to call when the request is satisfied or `NULL`. |
user_data | User data to pass to `callback` . |

Since: 1.0

### mm_modem_3gpp_ussd_cancel_finish ()

    gboolean
    mm_modem_3gpp_ussd_cancel_finish (MMModem3gppUssd *self,
                                      GAsyncResult *res,
                                      GError **error);

Finishes an operation started with `mm_modem_3gpp_ussd_cancel()`.

#### Parameters

self | A MMModem3gppUssd. |
res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_modem_3gpp_ussd_cancel()`. |
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the session was successfully cancelled, `FALSE` if `error` is set.

Since: 1.0

### mm_modem_3gpp_ussd_cancel_sync ()

    gboolean
    mm_modem_3gpp_ussd_cancel_sync (MMModem3gppUssd *self,
                                    GCancellable *cancellable,
                                    GError **error);

Synchronously cancels an ongoing USSD session, either mobile or network initiated.

The calling thread is blocked until a reply is received. See `mm_modem_3gpp_ussd_cancel()` for the asynchronous version of this method.

#### Parameters

self | A MMModem3gppUssd. |
cancellable | A GCancellable or `NULL`. | [allow-none]
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the session was successfully cancelled, `FALSE` if `error` is set.

Since: 1.0

## Types and Values

### struct MMModem3gppUssd

    struct MMModem3gppUssd;

The MMModem3gppUssd structure contains private data and should only be accessed using the provided API.