## MmGdbusModemSar MmGdbusModemSar — Generated C code for the org.freedesktop.ModemManager1.Modem.Sar D-Bus interface |

## Functions

guint | mm_gdbus_modem_sar_get_power_level ()
gboolean | mm_gdbus_modem_sar_get_state ()
void | mm_gdbus_modem_sar_call_enable ()
gboolean | mm_gdbus_modem_sar_call_enable_finish ()
gboolean | mm_gdbus_modem_sar_call_enable_sync ()
void | mm_gdbus_modem_sar_call_set_power_level ()
gboolean | mm_gdbus_modem_sar_call_set_power_level_finish ()
gboolean | mm_gdbus_modem_sar_call_set_power_level_sync ()

## Properties

guint | power-level | Read / Write
gboolean | state | Read / Write

## Signals

gboolean | handle-enable | Run Last
gboolean | handle-set-power-level | Run Last

## Types and Values

| MmGdbusModemSar
struct | MmGdbusModemSarIface

## Object Hierarchy

        GInterface
        ╰── MmGdbusModemSar

## Prerequisites

MmGdbusModemSar requires GObject.

## Known Implementations

MmGdbusModemSar is implemented by MMModemSar, MmGdbusModemSarProxy and MmGdbusModemSarSkeleton.

## Description

This section contains code for working with the org.freedesktop.ModemManager1.Modem.Sar D-Bus interface in C.

## Functions

### mm_gdbus_modem_sar_get_power_level ()

    guint
    mm_gdbus_modem_sar_get_power_level (MmGdbusModemSar *object);

Gets the value of the "PowerLevel" D-Bus property.

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

[skip]

#### Parameters

object | A MmGdbusModemSar. |

#### Returns

The property value.

### mm_gdbus_modem_sar_get_state ()

    gboolean
    mm_gdbus_modem_sar_get_state (MmGdbusModemSar *object);

Gets the value of the "State" D-Bus property.

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

[skip]

#### Parameters

object | A MmGdbusModemSar. |

#### Returns

The property value.

### mm_gdbus_modem_sar_call_enable ()

    void
    mm_gdbus_modem_sar_call_enable (MmGdbusModemSar *proxy,
                                    gboolean arg_enable,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously invokes the `Enable()` D-Bus method on `proxy` . When the operation is finished, `callback` will be invoked in the thread-default main loop of the thread you are calling this method from (see `g_main_context_push_thread_default()`). You can then call `mm_gdbus_modem_sar_call_enable_finish()` to get the result of the operation.

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

#### Parameters

proxy | A MmGdbusModemSarProxy. |
arg_enable | Argument to pass with the method invocation. |
cancellable | A GCancellable or `NULL`. | [nullable]
callback | A GAsyncReadyCallback to call when the request is satisfied or `NULL`. |
user_data | User data to pass to `callback` . |

### mm_gdbus_modem_sar_call_enable_finish ()

    gboolean
    mm_gdbus_modem_sar_call_enable_finish (MmGdbusModemSar *proxy,
                                           GAsyncResult *res,
                                           GError **error);

Finishes an operation started with `mm_gdbus_modem_sar_call_enable()`.

#### Parameters

proxy | A MmGdbusModemSarProxy. |
res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_gdbus_modem_sar_call_enable()`. |
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the call succeeded, `FALSE` if `error` is set.

[skip]

### mm_gdbus_modem_sar_call_enable_sync ()

    gboolean
    mm_gdbus_modem_sar_call_enable_sync (MmGdbusModemSar *proxy,
                                         gboolean arg_enable,
                                         GCancellable *cancellable,
                                         GError **error);

Synchronously invokes the `Enable()` D-Bus method on `proxy` . The calling thread is blocked until a reply is received.

See `mm_gdbus_modem_sar_call_enable()` for the asynchronous version of this method.

#### Parameters

proxy | A MmGdbusModemSarProxy. |
arg_enable | Argument to pass with the method invocation. |
cancellable | A GCancellable or `NULL`. | [nullable]
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the call succeeded, `FALSE` if `error` is set.

[skip]

### mm_gdbus_modem_sar_call_set_power_level ()

    void
    mm_gdbus_modem_sar_call_set_power_level
                                   (MmGdbusModemSar *proxy,
                                    guint arg_level,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously invokes the `SetPowerLevel()` D-Bus method on `proxy` . When the operation is finished, `callback` will be invoked in the thread-default main loop of the thread you are calling this method from (see `g_main_context_push_thread_default()`). You can then call `mm_gdbus_modem_sar_call_set_power_level_finish()` to get the result of the operation.

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

#### Parameters

proxy | A MmGdbusModemSarProxy. |
arg_level | Argument to pass with the method invocation. |
cancellable | A GCancellable or `NULL`. | [nullable]
callback | A GAsyncReadyCallback to call when the request is satisfied or `NULL`. |
user_data | User data to pass to `callback` . |

### mm_gdbus_modem_sar_call_set_power_level_finish ()

    gboolean
    mm_gdbus_modem_sar_call_set_power_level_finish
                                   (MmGdbusModemSar *proxy,
                                    GAsyncResult *res,
                                    GError **error);

Finishes an operation started with `mm_gdbus_modem_sar_call_set_power_level()`.

#### Parameters

proxy | A MmGdbusModemSarProxy. |
res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `mm_gdbus_modem_sar_call_set_power_level()`. |
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the call succeeded, `FALSE` if `error` is set.

[skip]

### mm_gdbus_modem_sar_call_set_power_level_sync ()

    gboolean
    mm_gdbus_modem_sar_call_set_power_level_sync
                                   (MmGdbusModemSar *proxy,
                                    guint arg_level,
                                    GCancellable *cancellable,
                                    GError **error);

Synchronously invokes the `SetPowerLevel()` D-Bus method on `proxy` . The calling thread is blocked until a reply is received.

See `mm_gdbus_modem_sar_call_set_power_level()` for the asynchronous version of this method.

#### Parameters

proxy | A MmGdbusModemSarProxy. |
arg_level | Argument to pass with the method invocation. |
cancellable | A GCancellable or `NULL`. | [nullable]
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the call succeeded, `FALSE` if `error` is set.

[skip]

## Types and Values

### MmGdbusModemSar

    typedef struct _MmGdbusModemSar MmGdbusModemSar;

Abstract interface type for the D-Bus interface org.freedesktop.ModemManager1.Modem.Sar.

### struct MmGdbusModemSarIface

    struct MmGdbusModemSarIface {
      GTypeInterface parent_iface;

      gboolean (*handle_enable) (
        MmGdbusModemSar *object,
        GDBusMethodInvocation *invocation,
        gboolean arg_enable);

      gboolean (*handle_set_power_level) (
        MmGdbusModemSar *object,
        GDBusMethodInvocation *invocation,
        guint arg_level);

      guint  (*get_power_level) (MmGdbusModemSar *object);

      gboolean  (*get_state) (MmGdbusModemSar *object);
    };

Virtual table for the D-Bus interface org.freedesktop.ModemManager1.Modem.Sar.

#### Members

GTypeInterface `parent_iface`; | The parent interface. |
`handle_enable` () | Handler for the “handle-enable” signal. |
`handle_set_power_level` () | Handler for the “handle-set-power-level” signal. |
`get_power_level` () | Getter for the “power-level” property. |
`get_state` () | Getter for the “state” property. |

## Property Details

### The `“power-level”` property

      “power-level”              guint

Represents the D-Bus property "PowerLevel".

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

Owner: MmGdbusModemSar

Flags: Read / Write

Default value: 0

### The `“state”` property

      “state”                    gboolean

Represents the D-Bus property "State".

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

Owner: MmGdbusModemSar

Flags: Read / Write

Default value: FALSE

## Signal Details

### The `“handle-enable”` signal

    gboolean
    user_function (MmGdbusModemSar       *object,
                   GDBusMethodInvocation *invocation,
                   gboolean               arg_enable,
                   gpointer               user_data)

Signal emitted when a remote caller is invoking the `Enable()` D-Bus method.

If a signal handler returns `TRUE`, it means the signal handler will handle the invocation (e.g. take a reference to `invocation` and eventually call `mm_gdbus_modem_sar_complete_enable()` or e.g. `g_dbus_method_invocation_return_error()` on it) and no other signal handlers will run. If no signal handler handles the invocation, the `G_DBUS_ERROR_UNKNOWN_METHOD` error is returned.

#### Parameters

object | A MmGdbusModemSar. |
invocation | A GDBusMethodInvocation. |
arg_enable | Argument passed by remote caller. |
user_data | user data set when the signal handler was connected. |

#### Returns

`G_DBUS_METHOD_INVOCATION_HANDLED` or `TRUE` if the invocation was handled, `G_DBUS_METHOD_INVOCATION_UNHANDLED` or `FALSE` to let other signal handlers run.

Flags: Run Last

### The `“handle-set-power-level”` signal

    gboolean
    user_function (MmGdbusModemSar       *object,
                   GDBusMethodInvocation *invocation,
                   guint                  arg_level,
                   gpointer               user_data)

Signal emitted when a remote caller is invoking the `SetPowerLevel()` D-Bus method.

If a signal handler returns `TRUE`, it means the signal handler will handle the invocation (e.g. take a reference to `invocation` and eventually call `mm_gdbus_modem_sar_complete_set_power_level()` or e.g. `g_dbus_method_invocation_return_error()` on it) and no other signal handlers will run. If no signal handler handles the invocation, the `G_DBUS_ERROR_UNKNOWN_METHOD` error is returned.

#### Parameters

object | A MmGdbusModemSar. |
invocation | A GDBusMethodInvocation. |
arg_level | Argument passed by remote caller. |
user_data | user data set when the signal handler was connected. |

#### Returns

`G_DBUS_METHOD_INVOCATION_HANDLED` or `TRUE` if the invocation was handled, `G_DBUS_METHOD_INVOCATION_UNHANDLED` or `FALSE` to let other signal handlers run.

Flags: Run Last