MMBearer

## MMBearer MMBearer — The Bearer interface |

## Synopsis

    struct              MMBearer;

    const gchar *       mm_bearer_get_path                  (MMBearer *self);
    gchar *             mm_bearer_dup_path                  (MMBearer *self);
    const gchar *       mm_bearer_get_interface             (MMBearer *self);
    gchar *             mm_bearer_dup_interface             (MMBearer *self);
    gboolean            mm_bearer_get_connected             (MMBearer *self);
    gboolean            mm_bearer_get_suspended             (MMBearer *self);
    guint               mm_bearer_get_ip_timeout            (MMBearer *self);
    MMBearerIpConfig *  mm_bearer_peek_ipv4_config          (MMBearer *self);
    MMBearerIpConfig *  mm_bearer_get_ipv4_config           (MMBearer *self);
    MMBearerIpConfig *  mm_bearer_peek_ipv6_config          (MMBearer *self);
    MMBearerIpConfig *  mm_bearer_get_ipv6_config           (MMBearer *self);
    MMBearerProperties * mm_bearer_peek_properties          (MMBearer *self);
    MMBearerProperties * mm_bearer_get_properties           (MMBearer *self);

    void                mm_bearer_connect                   (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            mm_bearer_connect_finish            (MMBearer *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    gboolean            mm_bearer_connect_sync              (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GError **error);
    void                mm_bearer_disconnect                (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            mm_bearer_disconnect_finish         (MMBearer *self,
                                                             GAsyncResult *res,
                                                             GError **error);
    gboolean            mm_bearer_disconnect_sync           (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----GDBusProxy
             +----MmGdbusBearerProxy
                   +----MMBearer

## Implemented Interfaces

MMBearer implements GDBusInterface, GInitable, GAsyncInitable and MmGdbusBearer.

## Description

The MMBearer is an object providing access to the methods, signals and properties of the Bearer interface.

When the bearer is exposed and available in the bus, it is ensured that at least this interface is also available.

## Details

### struct MMBearer

    struct MMBearer;

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

### mm_bearer_get_path ()

    const gchar *       mm_bearer_get_path                  (MMBearer *self);

Gets the DBus path of the MMBearer object.

`self` : | A MMBearer.
Returns : | The DBus path of the MMBearer object. [transfer none]

### mm_bearer_dup_path ()

    gchar *             mm_bearer_dup_path                  (MMBearer *self);

Gets a copy of the DBus path of the MMBearer object.

`self` : | A MMBearer.
Returns : | The DBus path of the MMBearer object. The returned value should be freed with `g_free()`. [transfer full]

### mm_bearer_get_interface ()

    const gchar *       mm_bearer_get_interface             (MMBearer *self);

Gets the operating system name for the network data interface that provides packet data using this MMBearer. This will only be available once the MMBearer is in connected state.

### Warning

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_bearer_dup_interface()` if on another thread.

`self` : | A MMBearer.
Returns : | The name of the interface, or `NULL` if it couldn't be retrieved. [transfer none]

### mm_bearer_dup_interface ()

    gchar *             mm_bearer_dup_interface             (MMBearer *self);

Gets a copy of the operating system name for the network data interface that provides packet data using this MMBearer. This will only be available once the MMBearer is in connected state.

`self` : | A MMBearer.
Returns : | The name of the interface, or `NULL` if it couldn't be retrieved. The returned value should be freed with `g_free()`. [transfer full]

### mm_bearer_get_connected ()

    gboolean            mm_bearer_get_connected             (MMBearer *self);

Checks whether or not the MMBearer is connected and thus whether packet data communication is possible.

`self` : | A MMBearer.
Returns : | `TRUE` if the MMBearer is connected, FALSE otherwise.

### mm_bearer_get_suspended ()

    gboolean            mm_bearer_get_suspended             (MMBearer *self);

Checks whether or not the MMBearer is suspended (but not deactivated) while the device is handling other communications, like a voice call.

`self` : | A MMBearer.
Returns : | `TRUE` if packet data service is suspended in the MMBearer, FALSE otherwise.

### mm_bearer_get_ip_timeout ()

    guint               mm_bearer_get_ip_timeout            (MMBearer *self);

Gets the maximum time to wait for the bearer to retrieve a valid IP address.

`self` : | A MMBearer.
Returns : | The IP timeout, or 0 if no specific one given.

### mm_bearer_peek_ipv4_config ()

    MMBearerIpConfig *  mm_bearer_peek_ipv4_config          (MMBearer *self);

Gets a MMBearerIpConfig object specifying the IPv4 configuration to use in the bearer.

### Warning

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_bearer_get_ipv4_config()` if on another thread.

`self` : | A MMBearer.
Returns : | (transfer none) A MMBearerIpConfig. Do not free the returned value, it belongs to `self`.

### mm_bearer_get_ipv4_config ()

    MMBearerIpConfig *  mm_bearer_get_ipv4_config           (MMBearer *self);

Gets a MMBearerIpConfig object specifying the IPv4 configuration to use in the bearer.

### Warning

The values reported by `self` are not updated when the values in the interface change. Instead, the client is expected to call `mm_bearer_get_ipv4_config()` again to get a new MMBearerIpConfig with the new values.

`self` : | A MMBearer.
Returns : | (transfer full) A MMBearerIpConfig that must be freed with `g_object_unref()` or `NULL` if unknown.

### mm_bearer_peek_ipv6_config ()

    MMBearerIpConfig *  mm_bearer_peek_ipv6_config          (MMBearer *self);

Gets a MMBearerIpConfig object specifying the IPv6 configuration to use in the bearer.

### Warning

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_bearer_get_ipv6_config()` if on another thread.

`self` : | A MMBearer.
Returns : | (transfer none) A MMBearerIpConfig. Do not free the returned value, it belongs to `self`.

### mm_bearer_get_ipv6_config ()

    MMBearerIpConfig *  mm_bearer_get_ipv6_config           (MMBearer *self);

Gets a MMBearerIpConfig object specifying the IPv6 configuration to use in the bearer.

### Warning

The values reported by `self` are not updated when the values in the interface change. Instead, the client is expected to call `mm_bearer_get_ipv6_config()` again to get a new MMBearerIpConfig with the new values.

`self` : | A MMBearer.
Returns : | (transfer full) A MMBearerIpConfig that must be freed with `g_object_unref()` or `NULL` if unknown.

### mm_bearer_peek_properties ()

    MMBearerProperties * mm_bearer_peek_properties          (MMBearer *self);

Gets a MMBearerProperties object specifying the properties which were used to create the bearer.

### Warning

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_bearer_get_properties()` if on another thread.

`self` : | A MMBearer.
Returns : | (transfer none) A MMBearerProperties. Do not free the returned value, it belongs to `self`.

### mm_bearer_get_properties ()

    MMBearerProperties * mm_bearer_get_properties           (MMBearer *self);

Gets a MMBearerProperties object specifying the properties which were used to create the bearer.

### Warning

The values reported by `self` are not updated when the values in the interface change. Instead, the client is expected to call `mm_bearer_get_properties()` again to get a new MMBearerProperties with the new values.

`self` : | A MMBearer.
Returns : | (transfer full) A MMBearerProperties that must be freed with `g_object_unref()` or `NULL` if unknown.

### mm_bearer_connect ()

    void                mm_bearer_connect                   (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Asynchronously requests activation of a packet data connection with the network using this MMBearer properties.

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_bearer_connect_finish()` to get the result of the operation.

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

`self` : | A MMBearer.
`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`.

### mm_bearer_connect_finish ()

    gboolean            mm_bearer_connect_finish            (MMBearer *self,
                                                             GAsyncResult *res,
                                                             GError **error);

Finishes an operation started with `mm_bearer_connect()`.

`self` : | A MMBearer.
`res` : | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_bearer_connect()`.
`error` : | Return location for error or `NULL`.
Returns : | `TRUE` if the operation succeded, `FALSE` if `error` is set.

### mm_bearer_connect_sync ()

    gboolean            mm_bearer_connect_sync              (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GError **error);

Synchronously requests activation of a packet data connection with the network using this MMBearer properties.

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

`self` : | A MMBearer.
`cancellable` : | A GCancellable or `NULL`. [allow-none]
`error` : | Return location for error or `NULL`.
Returns : | `TRUE` if the operation succeded, `FALSE` if `error` is set.

### mm_bearer_disconnect ()

    void                mm_bearer_disconnect                (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Synchronously requests disconnection and deactivation of the packet data connection.

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_bearer_disconnect_finish()` to get the result of the operation.

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

`self` : | A MMBearer.
`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`.

### mm_bearer_disconnect_finish ()

    gboolean            mm_bearer_disconnect_finish         (MMBearer *self,
                                                             GAsyncResult *res,
                                                             GError **error);

Finishes an operation started with `mm_bearer_disconnect()`.

`self` : | A MMBearer.
`res` : | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_bearer_disconnect()`.
`error` : | Return location for error or `NULL`.
Returns : | `TRUE` if the operation succeded, `FALSE` if `error` is set.

### mm_bearer_disconnect_sync ()

    gboolean            mm_bearer_disconnect_sync           (MMBearer *self,
                                                             GCancellable *cancellable,
                                                             GError **error);

Synchronously requests disconnection and deactivation of the packet data connection.

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

`self` : | A MMBearer.
`cancellable` : | A GCancellable or `NULL`. [allow-none]
`error` : | Return location for error or `NULL`.
Returns : | `TRUE` if the operation succeded, `FALSE` if `error` is set.