first commit
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..fd9db19
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+CC=gcc
+OBJS = objects/pflash/progress.o objects/pflash/ast-sf-ctrl.o
+OBJS += objects/pflash/libflash/libflash.o objects/pflash/libflash/libffs.o
+OBJS += objects/pflash/arm_io.o
+LIBS=/gsa/ausgsa/home/n/j/njames/openbmc
+HOME = /media/sf_vbox/openbmc
+CFLAGS=$(shell pkg-config --libs --cflags gtk+-2.0 glib-2.0)
+
+%.o: interfaces/%.c
+ $(CC) -c -o obj/$@ $< -I$(HOME) $(CFLAGS)
+
+%.o: objects/%.c
+ $(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/objects/pflash $(CFLAGS)
+
+%.o: objects/pflash/%.c
+ $(CC) -c -o obj/$@ $< -I$(HOME) -I$(HOME)/objects/pflash $(CFLAGS)
+
+power_control: power_control.o power_control_obj.o
+ $(CC) -o bin/$@ obj/power_control.o obj/power_control_obj.o $(CFLAGS)
+
+chassis_identify: led.o chassis_identify_obj.o
+ $(CC) -o bin/$@ obj/led.o obj/chassis_identify_obj.o $(CFLAGS)
+
+sensor_ambient: sensor.o sensor_temperature_ambient_obj.o
+ $(CC) -o bin/$@ obj/sensor.o obj/sensor_temperature_ambient_obj.o $(CFLAGS)
+
+button_power: button.o button_power_obj.o
+ $(CC) -o bin/$@ obj/button.o obj/button_power_obj.o $(CFLAGS)
+
+sensor_host_status: sensor.o sensor_host_status_obj.o
+ $(CC) -o bin/$@ obj/sensor.o obj/sensor_host_status_obj.o $(CFLAGS)
+
+host_control: host_control.o host_control_obj.o
+ $(CC) -o bin/$@ obj/host_control.o obj/host_control_obj.o $(CFLAGS)
+
+flash_bios: pflash.o flash.o flash_bios_obj.o
+ $(CC) -o bin/$@ obj/flash.o obj/flash_bios_obj.o $(OBJS) $(CFLAGS)
+
diff --git a/bin/.rest_server_obj.py.swp b/bin/.rest_server_obj.py.swp
new file mode 100644
index 0000000..6cad1c3
--- /dev/null
+++ b/bin/.rest_server_obj.py.swp
Binary files differ
diff --git a/bin/button_power b/bin/button_power
new file mode 100644
index 0000000..5bba86a
--- /dev/null
+++ b/bin/button_power
Binary files differ
diff --git a/bin/chassis_control.py b/bin/chassis_control.py
new file mode 100644
index 0000000..6c01c39
--- /dev/null
+++ b/bin/chassis_control.py
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+
+class ChassisControlObject(dbus.service.Object):
+ def __init__(self,bus,name):
+ self.power_state=0
+ dbus.service.Object.__init__(self,bus,name)
+ bus = dbus.SessionBus()
+ try:
+ # Get PowerControl object
+ power_control_service = bus.get_object('org.openbmc.PowerControl','/org/openbmc/PowerControl/0')
+ self.power_control_iface = dbus.Interface(power_control_service, 'org.openbmc.PowerControl')
+ # Get ChassisIdentify object
+ chassis_identify_service = bus.get_object('org.openbmc.ChassisIdentify','/org/openbmc/ChassisIdentify/0')
+ self.identify_led_iface = dbus.Interface(chassis_identify_service, 'org.openbmc.Led');
+ # Get HostControl object
+ host_control_service = bus.get_object('org.openbmc.HostControl','/org/openbmc/HostControl/0')
+ self.host_control_iface = dbus.Interface(host_control_service, 'org.openbmc.HostControl');
+
+
+ except dbus.exceptions.DBusException, e:
+ # TODO: not sure what to do if can't find other services
+ print "Unable to find dependent services: ",e
+
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='s')
+ def getID(self):
+ return id
+
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='')
+ def setIdentify(self):
+ print "Turn on identify"
+ self.identify_led_iface.setOn()
+ return None
+
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='')
+ def clearIdentify(self):
+ print "Turn off identify"
+ r=self.identify_led_iface.setOff()
+ return None
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='')
+ def setPowerOn(self):
+ print "Turn on power and boot"
+ self.power_state=0
+ if (self.getPowerState()==0):
+ self.power_control_iface.setPowerState(1)
+ self.power_state=1
+ return None
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='')
+ def setPowerOff(self):
+ print "Turn off power"
+ self.power_control_iface.setPowerState(0);
+ return None
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='i')
+ def getPowerState(self):
+ state = self.power_control_iface.getPowerState();
+ return state
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='', out_signature='')
+ def setDebugMode(self):
+ return None
+
+ @dbus.service.method("org.openbmc.ChassisControl",
+ in_signature='i', out_signature='')
+ def setPowerPolicy(self,policy):
+ return None
+
+ ## Signal handler
+ def power_button_signal_handler(self):
+ # only power on if not currently powered on
+ state = self.getPowerState()
+ if state == 0:
+ self.setPowerOn()
+ elif state == 1:
+ self.setPowerOff();
+
+ # TODO: handle long press and reset
+
+ ## Signal handler
+ def power_good_signal_handler(self):
+ if (self.power_state==1):
+ self.host_control_iface.boot()
+ self.power_state=2
+
+
+
+if __name__ == '__main__':
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SessionBus()
+ name = dbus.service.BusName("org.openbmc.ChassisControl", bus)
+ object = ChassisControlObject(bus, '/org/openbmc/ChassisControl')
+ mainloop = gobject.MainLoop()
+ bus.add_signal_receiver(object.power_button_signal_handler, dbus_interface = "org.openbmc.Button", signal_name = "ButtonPressed")
+ bus.add_signal_receiver(object.power_good_signal_handler, dbus_interface = "org.openbmc.PowerControl", signal_name = "PowerGood")
+
+ print "Running ChassisControlService"
+ mainloop.run()
+
diff --git a/bin/chassis_identify b/bin/chassis_identify
new file mode 100644
index 0000000..2396d4b
--- /dev/null
+++ b/bin/chassis_identify
Binary files differ
diff --git a/bin/flash_bios b/bin/flash_bios
new file mode 100644
index 0000000..c2679da
--- /dev/null
+++ b/bin/flash_bios
Binary files differ
diff --git a/bin/host_control b/bin/host_control
new file mode 100644
index 0000000..524b119
--- /dev/null
+++ b/bin/host_control
Binary files differ
diff --git a/bin/power_control b/bin/power_control
new file mode 100644
index 0000000..8ba016a
--- /dev/null
+++ b/bin/power_control
Binary files differ
diff --git a/bin/rest_server.py b/bin/rest_server.py
new file mode 100644
index 0000000..5a36e9e
--- /dev/null
+++ b/bin/rest_server.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+
+from BaseHTTPServer import BaseHTTPRequestHandler
+import urlparse
+import dbus
+import json
+import re
+import xml.etree.ElementTree as ET
+
+def parseIntrospection(obj,interface,method=None):
+ introspect_iface = dbus.Interface(obj,"org.freedesktop.DBus.Introspectable")
+ tree = ET.ElementTree(ET.fromstring(introspect_iface.Introspect()))
+ root = tree.getroot()
+ r = []
+ for intf in root.iter('interface'):
+ if (intf.attrib['name'] == interface):
+ for methd in intf.iter('method'):
+ if (method == None):
+ r.append(methd.attrib['name'])
+ elif (method == methd.attrib['name']):
+ for arg in methd.iter('arg'):
+ a = [arg.attrib['name'],arg.attrib['type'],arg.attrib['direction']]
+ r.append(a)
+ return r
+
+def getArgFromSignature(args,signature):
+ if (signature == 'i'):
+ return int(args[0])
+ elif (signature == 's'):
+ return args[0];
+
+ raise Exception("Inavlid signature: "+signature)
+
+
+class GetHandler(BaseHTTPRequestHandler):
+ def do_GET(self):
+ url_data = urlparse.urlparse(self.path)
+ parms = urlparse.parse_qs(url_data.query)
+ self.objmap = {
+ 'chassis' : ['org.openbmc.ChassisControl','/org/openbmc/ChassisControl','org.openbmc.ChassisControl'],
+ 'flash' : ['org.openbmc.Flash.BIOS','/org/openbmc/Flash/BIOS/0','org.openbmc.Flash'],
+ 'power' : ['org.openbmc.PowerControl','/org/openbmc/PowerControl/0','org.openbmc.PowerControl']
+ }
+ self.sensors = {
+ '/org/openbmc/Sensors/HostStatus/0' : ['org.openbmc.Sensors.HostStatus','org.openbmc.SensorIntegerSettable',0,""],
+ '/org/openbmc/Sensors/Temperature/Ambient/0': ['org.openbmc.Sensors.Temperature.Ambient','org.openbmc.SensorInteger',0,""]
+ }
+
+
+ parts = url_data.path.split('/');
+ item = parts[1]
+
+ method = ''
+ if (len(parts) > 2):
+ method = parts[2]
+
+ code = 403
+ payload = {'status': 'error'}
+ bus = dbus.SessionBus()
+
+ if (item == 'sensors'):
+ try:
+ for s in self.sensors.keys():
+ obj = bus.get_object(self.sensors[s][0],s)
+ iface = dbus.Interface(obj,self.sensors[s][1])
+ self.sensors[s][2] = iface.getValue()
+ self.sensors[s][3] = iface.getUnits()
+
+ payload['status'] = 'ok'
+ payload['sensors'] = self.sensors
+ code = 200
+ except dbus.exceptions.DBusException as e:
+ payload['error-message'] = e.get_dbus_name()
+
+ elif (self.objmap.has_key(item)):
+ bus_name = self.objmap[item][0]
+ obj_name = self.objmap[item][1]
+ interface = self.objmap[item][2]
+ try:
+ obj = bus.get_object(bus_name,obj_name)
+
+ if (method == ''):
+ payload['available-methods'] = parseIntrospection(obj,interface)
+ else:
+ args = parseIntrospection(obj,interface,method)
+ arg_array = []
+ signature_in = ''
+ signature_out = ''
+ for a in args:
+ if (a[2] == 'in'):
+ if (parms.has_key(a[0]) == False):
+ raise Exception("Method '"+method+"' requires argument '"+a[0]+"'")
+ arg_array.append(getArgFromSignature(parms[a[0]],a[1]))
+ signature_in = signature_in + a[1]
+ else:
+ signature_out = a[1]
+
+ rtn = bus.call_blocking(bus_name,obj_name,interface,method,signature_in,arg_array)
+
+ code = 200
+ payload['status'] = 'ok'
+
+ except dbus.exceptions.DBusException as e:
+ payload['error-message'] = str(e)
+ except Exception as ex:
+ payload['error-message'] = str(ex)
+
+ else:
+ payload['status'] = 'ok'
+ payload['available-commands'] = self.objmap.keys()
+
+ self.send_response(code)
+ self.send_header('Content-Type', 'application/json')
+ self.end_headers()
+ self.wfile.write(json.dumps(payload))
+ return
+
+if __name__ == '__main__':
+ from BaseHTTPServer import HTTPServer
+ server = HTTPServer(('', 3000), GetHandler)
+ print 'Starting server, use <Ctrl-C> to stop'
+ server.serve_forever()
+
diff --git a/bin/sensor_ambient b/bin/sensor_ambient
new file mode 100644
index 0000000..262be4a
--- /dev/null
+++ b/bin/sensor_ambient
Binary files differ
diff --git a/bin/sensor_host_status b/bin/sensor_host_status
new file mode 100644
index 0000000..77b6397
--- /dev/null
+++ b/bin/sensor_host_status
Binary files differ
diff --git a/codegen b/codegen
new file mode 100644
index 0000000..0fb688e
--- /dev/null
+++ b/codegen
@@ -0,0 +1 @@
+gdbus-codegen --interface-prefix org.openbmc --c-generate-object-manager --generate-c-code interfaces/$1 xml/$1.xml
diff --git a/interfaces/button.c b/interfaces/button.c
new file mode 100644
index 0000000..25c5687
--- /dev/null
+++ b/interfaces/button.c
@@ -0,0 +1,2413 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/button.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.Button
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Button
+ * @title: Button
+ * @short_description: Generated C code for the org.openbmc.Button D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.Button ---- */
+
+static const _ExtendedGDBusArgInfo _button_method_info_is_on_OUT_ARG_state =
+{
+ {
+ -1,
+ (gchar *) "state",
+ (gchar *) "b",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _button_method_info_is_on_OUT_ARG_pointers[] =
+{
+ &_button_method_info_is_on_OUT_ARG_state,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _button_method_info_is_on =
+{
+ {
+ -1,
+ (gchar *) "isOn",
+ NULL,
+ (GDBusArgInfo **) &_button_method_info_is_on_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-is-on",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _button_method_info_sim_button_press =
+{
+ {
+ -1,
+ (gchar *) "simButtonPress",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-sim-button-press",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _button_method_info_sim_button_long_press =
+{
+ {
+ -1,
+ (gchar *) "simButtonLongPress",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-sim-button-long-press",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _button_method_info_pointers[] =
+{
+ &_button_method_info_is_on,
+ &_button_method_info_sim_button_press,
+ &_button_method_info_sim_button_long_press,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _button_signal_info_button_release =
+{
+ {
+ -1,
+ (gchar *) "ButtonRelease",
+ NULL,
+ NULL
+ },
+ "button-release"
+};
+
+static const _ExtendedGDBusSignalInfo _button_signal_info_button_pressed =
+{
+ {
+ -1,
+ (gchar *) "ButtonPressed",
+ NULL,
+ NULL
+ },
+ "button-pressed"
+};
+
+static const _ExtendedGDBusSignalInfo _button_signal_info_button_pressed_long =
+{
+ {
+ -1,
+ (gchar *) "ButtonPressedLong",
+ NULL,
+ NULL
+ },
+ "button-pressed-long"
+};
+
+static const _ExtendedGDBusSignalInfo * const _button_signal_info_pointers[] =
+{
+ &_button_signal_info_button_release,
+ &_button_signal_info_button_pressed,
+ &_button_signal_info_button_pressed_long,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _button_property_info_state =
+{
+ {
+ -1,
+ (gchar *) "state",
+ (gchar *) "b",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "state",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _button_property_info_pointers[] =
+{
+ &_button_property_info_state,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _button_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.Button",
+ (GDBusMethodInfo **) &_button_method_info_pointers,
+ (GDBusSignalInfo **) &_button_signal_info_pointers,
+ (GDBusPropertyInfo **) &_button_property_info_pointers,
+ NULL
+ },
+ "button",
+};
+
+
+/**
+ * button_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+button_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_button_interface_info.parent_struct;
+}
+
+/**
+ * button_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #Button interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+button_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "state");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * Button:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link>.
+ */
+
+/**
+ * ButtonIface:
+ * @parent_iface: The parent interface.
+ * @handle_is_on: Handler for the #Button::handle-is-on signal.
+ * @handle_sim_button_long_press: Handler for the #Button::handle-sim-button-long-press signal.
+ * @handle_sim_button_press: Handler for the #Button::handle-sim-button-press signal.
+ * @get_state: Getter for the #Button:state property.
+ * @button_pressed: Handler for the #Button::button-pressed signal.
+ * @button_pressed_long: Handler for the #Button::button-pressed-long signal.
+ * @button_release: Handler for the #Button::button-release signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link>.
+ */
+
+typedef ButtonIface ButtonInterface;
+G_DEFINE_INTERFACE (Button, button, G_TYPE_OBJECT);
+
+static void
+button_default_init (ButtonIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * Button::handle-is-on:
+ * @object: A #Button.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Button.isOn">isOn()</link> 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 button_complete_is_on() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-is-on",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ButtonIface, handle_is_on),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * Button::handle-sim-button-press:
+ * @object: A #Button.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Button.simButtonPress">simButtonPress()</link> 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 button_complete_sim_button_press() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-sim-button-press",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ButtonIface, handle_sim_button_press),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * Button::handle-sim-button-long-press:
+ * @object: A #Button.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Button.simButtonLongPress">simButtonLongPress()</link> 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 button_complete_sim_button_long_press() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-sim-button-long-press",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ButtonIface, handle_sim_button_long_press),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * Button::button-release:
+ * @object: A #Button.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-Button.ButtonRelease">"ButtonRelease"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("button-release",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ButtonIface, button_release),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+ /**
+ * Button::button-pressed:
+ * @object: A #Button.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-Button.ButtonPressed">"ButtonPressed"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("button-pressed",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ButtonIface, button_pressed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+ /**
+ * Button::button-pressed-long:
+ * @object: A #Button.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-Button.ButtonPressedLong">"ButtonPressedLong"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("button-pressed-long",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ButtonIface, button_pressed_long),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * Button:state:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-Button.state">"state"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_boolean ("state", "state", "state", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * button_get_state: (skip)
+ * @object: A #Button.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-Button.state">"state"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gboolean
+button_get_state (Button *object)
+{
+ return BUTTON_GET_IFACE (object)->get_state (object);
+}
+
+/**
+ * button_set_state: (skip)
+ * @object: A #Button.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-Button.state">"state"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+button_set_state (Button *object, gboolean value)
+{
+ g_object_set (G_OBJECT (object), "state", value, NULL);
+}
+
+/**
+ * button_emit_button_release:
+ * @object: A #Button.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-Button.ButtonRelease">"ButtonRelease"</link> D-Bus signal.
+ */
+void
+button_emit_button_release (
+ Button *object)
+{
+ g_signal_emit_by_name (object, "button-release");
+}
+
+/**
+ * button_emit_button_pressed:
+ * @object: A #Button.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-Button.ButtonPressed">"ButtonPressed"</link> D-Bus signal.
+ */
+void
+button_emit_button_pressed (
+ Button *object)
+{
+ g_signal_emit_by_name (object, "button-pressed");
+}
+
+/**
+ * button_emit_button_pressed_long:
+ * @object: A #Button.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-Button.ButtonPressedLong">"ButtonPressedLong"</link> D-Bus signal.
+ */
+void
+button_emit_button_pressed_long (
+ Button *object)
+{
+ g_signal_emit_by_name (object, "button-pressed-long");
+}
+
+/**
+ * button_call_is_on:
+ * @proxy: A #ButtonProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Button.isOn">isOn()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call button_call_is_on_finish() to get the result of the operation.
+ *
+ * See button_call_is_on_sync() for the synchronous, blocking version of this method.
+ */
+void
+button_call_is_on (
+ Button *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "isOn",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * button_call_is_on_finish:
+ * @proxy: A #ButtonProxy.
+ * @out_state: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to button_call_is_on().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with button_call_is_on().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+button_call_is_on_finish (
+ Button *proxy,
+ gboolean *out_state,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(b)",
+ out_state);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * button_call_is_on_sync:
+ * @proxy: A #ButtonProxy.
+ * @out_state: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Button.isOn">isOn()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See button_call_is_on() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+button_call_is_on_sync (
+ Button *proxy,
+ gboolean *out_state,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "isOn",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(b)",
+ out_state);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * button_call_sim_button_press:
+ * @proxy: A #ButtonProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Button.simButtonPress">simButtonPress()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call button_call_sim_button_press_finish() to get the result of the operation.
+ *
+ * See button_call_sim_button_press_sync() for the synchronous, blocking version of this method.
+ */
+void
+button_call_sim_button_press (
+ Button *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "simButtonPress",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * button_call_sim_button_press_finish:
+ * @proxy: A #ButtonProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to button_call_sim_button_press().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with button_call_sim_button_press().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+button_call_sim_button_press_finish (
+ Button *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * button_call_sim_button_press_sync:
+ * @proxy: A #ButtonProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Button.simButtonPress">simButtonPress()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See button_call_sim_button_press() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+button_call_sim_button_press_sync (
+ Button *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "simButtonPress",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * button_call_sim_button_long_press:
+ * @proxy: A #ButtonProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Button.simButtonLongPress">simButtonLongPress()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call button_call_sim_button_long_press_finish() to get the result of the operation.
+ *
+ * See button_call_sim_button_long_press_sync() for the synchronous, blocking version of this method.
+ */
+void
+button_call_sim_button_long_press (
+ Button *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "simButtonLongPress",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * button_call_sim_button_long_press_finish:
+ * @proxy: A #ButtonProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to button_call_sim_button_long_press().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with button_call_sim_button_long_press().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+button_call_sim_button_long_press_finish (
+ Button *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * button_call_sim_button_long_press_sync:
+ * @proxy: A #ButtonProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Button.simButtonLongPress">simButtonLongPress()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See button_call_sim_button_long_press() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+button_call_sim_button_long_press_sync (
+ Button *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "simButtonLongPress",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * button_complete_is_on:
+ * @object: A #Button.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @state: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Button.isOn">isOn()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+button_complete_is_on (
+ Button *object,
+ GDBusMethodInvocation *invocation,
+ gboolean state)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(b)",
+ state));
+}
+
+/**
+ * button_complete_sim_button_press:
+ * @object: A #Button.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Button.simButtonPress">simButtonPress()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+button_complete_sim_button_press (
+ Button *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * button_complete_sim_button_long_press:
+ * @object: A #Button.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Button.simButtonLongPress">simButtonLongPress()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+button_complete_sim_button_long_press (
+ Button *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * ButtonProxy:
+ *
+ * The #ButtonProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ButtonProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ButtonProxy.
+ */
+
+struct _ButtonProxyPrivate
+{
+ GData *qdata;
+};
+
+static void button_proxy_iface_init (ButtonIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (ButtonProxy, button_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (ButtonProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_BUTTON, button_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (ButtonProxy, button_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_BUTTON, button_proxy_iface_init));
+
+#endif
+static void
+button_proxy_finalize (GObject *object)
+{
+ ButtonProxy *proxy = BUTTON_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (button_proxy_parent_class)->finalize (object);
+}
+
+static void
+button_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ info = _button_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+button_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.Button: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+button_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ info = _button_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.Button", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) button_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+button_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_button_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_BUTTON);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_BUTTON);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+button_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ ButtonProxy *proxy = BUTTON_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_button_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_button_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static gboolean
+button_proxy_get_state (Button *object)
+{
+ ButtonProxy *proxy = BUTTON_PROXY (object);
+ GVariant *variant;
+ gboolean value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "state");
+ if (variant != NULL)
+ {
+ value = g_variant_get_boolean (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+button_proxy_init (ButtonProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = button_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_BUTTON_PROXY, ButtonProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), button_interface_info ());
+}
+
+static void
+button_proxy_class_init (ButtonProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = button_proxy_finalize;
+ gobject_class->get_property = button_proxy_get_property;
+ gobject_class->set_property = button_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = button_proxy_g_signal;
+ proxy_class->g_properties_changed = button_proxy_g_properties_changed;
+
+ button_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (ButtonProxyPrivate));
+#endif
+}
+
+static void
+button_proxy_iface_init (ButtonIface *iface)
+{
+ iface->get_state = button_proxy_get_state;
+}
+
+/**
+ * button_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call button_proxy_new_finish() to get the result of the operation.
+ *
+ * See button_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+button_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_BUTTON_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.Button", NULL);
+}
+
+/**
+ * button_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to button_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with button_proxy_new().
+ *
+ * Returns: (transfer full) (type ButtonProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Button *
+button_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return BUTTON (ret);
+ else
+ return NULL;
+}
+
+/**
+ * button_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See button_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ButtonProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Button *
+button_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_BUTTON_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.Button", NULL);
+ if (ret != NULL)
+ return BUTTON (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * button_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like button_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call button_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See button_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+button_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_BUTTON_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.Button", NULL);
+}
+
+/**
+ * button_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to button_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with button_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type ButtonProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Button *
+button_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return BUTTON (ret);
+ else
+ return NULL;
+}
+
+/**
+ * button_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like button_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See button_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ButtonProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Button *
+button_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_BUTTON_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.Button", NULL);
+ if (ret != NULL)
+ return BUTTON (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * ButtonSkeleton:
+ *
+ * The #ButtonSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ButtonSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ButtonSkeleton.
+ */
+
+struct _ButtonSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_button_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_BUTTON);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_BUTTON);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_button_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_button_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_button_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_button_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _button_skeleton_vtable =
+{
+ _button_skeleton_handle_method_call,
+ _button_skeleton_handle_get_property,
+ _button_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+button_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return button_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+button_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_button_skeleton_vtable;
+}
+
+static GVariant *
+button_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_button_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _button_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _button_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _button_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Button", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _button_emit_changed (gpointer user_data);
+
+static void
+button_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _button_emit_changed (skeleton);
+}
+
+static void
+_button_on_signal_button_release (
+ Button *object)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Button", "ButtonRelease",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void
+_button_on_signal_button_pressed (
+ Button *object)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Button", "ButtonPressed",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void
+_button_on_signal_button_pressed_long (
+ Button *object)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Button", "ButtonPressedLong",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void button_skeleton_iface_init (ButtonIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (ButtonSkeleton, button_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (ButtonSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_BUTTON, button_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (ButtonSkeleton, button_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_BUTTON, button_skeleton_iface_init));
+
+#endif
+static void
+button_skeleton_finalize (GObject *object)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+ guint n;
+ for (n = 0; n < 1; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (button_skeleton_parent_class)->finalize (object);
+}
+
+static void
+button_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_button_emit_changed (gpointer user_data)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.Button",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_button_schedule_emit_changed (ButtonSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+button_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _button_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+button_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _button_schedule_emit_changed (skeleton, _button_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+button_skeleton_init (ButtonSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = button_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_BUTTON_SKELETON, ButtonSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 1);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_BOOLEAN);
+}
+
+static gboolean
+button_skeleton_get_state (Button *object)
+{
+ ButtonSkeleton *skeleton = BUTTON_SKELETON (object);
+ gboolean value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_boolean (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+button_skeleton_class_init (ButtonSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = button_skeleton_finalize;
+ gobject_class->get_property = button_skeleton_get_property;
+ gobject_class->set_property = button_skeleton_set_property;
+ gobject_class->notify = button_skeleton_notify;
+
+
+ button_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = button_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = button_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = button_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = button_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (ButtonSkeletonPrivate));
+#endif
+}
+
+static void
+button_skeleton_iface_init (ButtonIface *iface)
+{
+ iface->button_release = _button_on_signal_button_release;
+ iface->button_pressed = _button_on_signal_button_pressed;
+ iface->button_pressed_long = _button_on_signal_button_pressed_long;
+ iface->get_state = button_skeleton_get_state;
+}
+
+/**
+ * button_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link>.
+ *
+ * Returns: (transfer full) (type ButtonSkeleton): The skeleton object.
+ */
+Button *
+button_skeleton_new (void)
+{
+ return BUTTON (g_object_new (TYPE_BUTTON_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:button:
+ *
+ * The #Button instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("button", "button", "button", TYPE_BUTTON, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_button:
+ * @object: A #Object.
+ *
+ * Gets the #Button instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #Button that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+Button *object_get_button (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Button");
+ if (ret == NULL)
+ return NULL;
+ return BUTTON (ret);
+}
+
+
+/**
+ * object_peek_button: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_button() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #Button or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+Button *object_peek_button (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Button");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return BUTTON (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Button");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "button");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_BUTTON (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.Button");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Button");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "button");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_button:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #Button or %NULL to clear the interface.
+ *
+ * Sets the #Button instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Button.top_of_page">org.openbmc.Button</link> on @object.
+ */
+void object_skeleton_set_button (ObjectSkeleton *object, Button *interface_)
+{
+ g_object_set (G_OBJECT (object), "button", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.Button", GSIZE_TO_POINTER (TYPE_BUTTON_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/button.h b/interfaces/button.h
new file mode 100644
index 0000000..4d468b0
--- /dev/null
+++ b/interfaces/button.h
@@ -0,0 +1,390 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_BUTTON_H__
+#define __INTERFACES_BUTTON_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.Button */
+
+#define TYPE_BUTTON (button_get_type ())
+#define BUTTON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_BUTTON, Button))
+#define IS_BUTTON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_BUTTON))
+#define BUTTON_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_BUTTON, ButtonIface))
+
+struct _Button;
+typedef struct _Button Button;
+typedef struct _ButtonIface ButtonIface;
+
+struct _ButtonIface
+{
+ GTypeInterface parent_iface;
+
+
+
+ gboolean (*handle_is_on) (
+ Button *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_sim_button_long_press) (
+ Button *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_sim_button_press) (
+ Button *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*get_state) (Button *object);
+
+ void (*button_pressed) (
+ Button *object);
+
+ void (*button_pressed_long) (
+ Button *object);
+
+ void (*button_release) (
+ Button *object);
+
+};
+
+GType button_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *button_interface_info (void);
+guint button_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void button_complete_is_on (
+ Button *object,
+ GDBusMethodInvocation *invocation,
+ gboolean state);
+
+void button_complete_sim_button_press (
+ Button *object,
+ GDBusMethodInvocation *invocation);
+
+void button_complete_sim_button_long_press (
+ Button *object,
+ GDBusMethodInvocation *invocation);
+
+
+
+/* D-Bus signal emissions functions: */
+void button_emit_button_release (
+ Button *object);
+
+void button_emit_button_pressed (
+ Button *object);
+
+void button_emit_button_pressed_long (
+ Button *object);
+
+
+
+/* D-Bus method calls: */
+void button_call_is_on (
+ Button *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean button_call_is_on_finish (
+ Button *proxy,
+ gboolean *out_state,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean button_call_is_on_sync (
+ Button *proxy,
+ gboolean *out_state,
+ GCancellable *cancellable,
+ GError **error);
+
+void button_call_sim_button_press (
+ Button *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean button_call_sim_button_press_finish (
+ Button *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean button_call_sim_button_press_sync (
+ Button *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void button_call_sim_button_long_press (
+ Button *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean button_call_sim_button_long_press_finish (
+ Button *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean button_call_sim_button_long_press_sync (
+ Button *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+gboolean button_get_state (Button *object);
+void button_set_state (Button *object, gboolean value);
+
+
+/* ---- */
+
+#define TYPE_BUTTON_PROXY (button_proxy_get_type ())
+#define BUTTON_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_BUTTON_PROXY, ButtonProxy))
+#define BUTTON_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_BUTTON_PROXY, ButtonProxyClass))
+#define BUTTON_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_BUTTON_PROXY, ButtonProxyClass))
+#define IS_BUTTON_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_BUTTON_PROXY))
+#define IS_BUTTON_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_BUTTON_PROXY))
+
+typedef struct _ButtonProxy ButtonProxy;
+typedef struct _ButtonProxyClass ButtonProxyClass;
+typedef struct _ButtonProxyPrivate ButtonProxyPrivate;
+
+struct _ButtonProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ ButtonProxyPrivate *priv;
+};
+
+struct _ButtonProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType button_proxy_get_type (void) G_GNUC_CONST;
+
+void button_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+Button *button_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+Button *button_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void button_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+Button *button_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+Button *button_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_BUTTON_SKELETON (button_skeleton_get_type ())
+#define BUTTON_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_BUTTON_SKELETON, ButtonSkeleton))
+#define BUTTON_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_BUTTON_SKELETON, ButtonSkeletonClass))
+#define BUTTON_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_BUTTON_SKELETON, ButtonSkeletonClass))
+#define IS_BUTTON_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_BUTTON_SKELETON))
+#define IS_BUTTON_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_BUTTON_SKELETON))
+
+typedef struct _ButtonSkeleton ButtonSkeleton;
+typedef struct _ButtonSkeletonClass ButtonSkeletonClass;
+typedef struct _ButtonSkeletonPrivate ButtonSkeletonPrivate;
+
+struct _ButtonSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ ButtonSkeletonPrivate *priv;
+};
+
+struct _ButtonSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType button_skeleton_get_type (void) G_GNUC_CONST;
+
+Button *button_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+Button *object_get_button (Object *object);
+Button *object_peek_button (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_button (ObjectSkeleton *object, Button *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_BUTTON_H__ */
diff --git a/interfaces/eventlog.c b/interfaces/eventlog.c
new file mode 100644
index 0000000..bdd0095
--- /dev/null
+++ b/interfaces/eventlog.c
@@ -0,0 +1,2025 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/eventlog.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.EventLog
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:EventLog
+ * @title: EventLog
+ * @short_description: Generated C code for the org.openbmc.EventLog D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.EventLog ---- */
+
+static const _ExtendedGDBusArgInfo _event_log_method_info_error_IN_ARG_message =
+{
+ {
+ -1,
+ (gchar *) "message",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _event_log_method_info_error_IN_ARG_pointers[] =
+{
+ &_event_log_method_info_error_IN_ARG_message,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _event_log_method_info_error =
+{
+ {
+ -1,
+ (gchar *) "error",
+ (GDBusArgInfo **) &_event_log_method_info_error_IN_ARG_pointers,
+ NULL,
+ NULL
+ },
+ "handle-error",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _event_log_method_info_pointers[] =
+{
+ &_event_log_method_info_error,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _event_log_signal_info_error_event_ARG_message =
+{
+ {
+ -1,
+ (gchar *) "message",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _event_log_signal_info_error_event_ARG_pointers[] =
+{
+ &_event_log_signal_info_error_event_ARG_message,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _event_log_signal_info_error_event =
+{
+ {
+ -1,
+ (gchar *) "ErrorEvent",
+ (GDBusArgInfo **) &_event_log_signal_info_error_event_ARG_pointers,
+ NULL
+ },
+ "error-event"
+};
+
+static const _ExtendedGDBusSignalInfo * const _event_log_signal_info_pointers[] =
+{
+ &_event_log_signal_info_error_event,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _event_log_property_info_message =
+{
+ {
+ -1,
+ (gchar *) "message",
+ (gchar *) "s",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "message",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _event_log_property_info_pointers[] =
+{
+ &_event_log_property_info_message,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _event_log_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.EventLog",
+ (GDBusMethodInfo **) &_event_log_method_info_pointers,
+ (GDBusSignalInfo **) &_event_log_signal_info_pointers,
+ (GDBusPropertyInfo **) &_event_log_property_info_pointers,
+ NULL
+ },
+ "event-log",
+};
+
+
+/**
+ * event_log_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+event_log_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_event_log_interface_info.parent_struct;
+}
+
+/**
+ * event_log_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #EventLog interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+event_log_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "message");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * EventLog:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link>.
+ */
+
+/**
+ * EventLogIface:
+ * @parent_iface: The parent interface.
+ * @handle_error: Handler for the #EventLog::handle-error signal.
+ * @get_message: Getter for the #EventLog:message property.
+ * @error_event: Handler for the #EventLog::error-event signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link>.
+ */
+
+typedef EventLogIface EventLogInterface;
+G_DEFINE_INTERFACE (EventLog, event_log, G_TYPE_OBJECT);
+
+static void
+event_log_default_init (EventLogIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * EventLog::handle-error:
+ * @object: A #EventLog.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_message: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-EventLog.error">error()</link> 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 event_log_complete_error() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-error",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EventLogIface, handle_error),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * EventLog::error-event:
+ * @object: A #EventLog.
+ * @arg_message: Argument.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-EventLog.ErrorEvent">"ErrorEvent"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("error-event",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EventLogIface, error_event),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 1, G_TYPE_STRING);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * EventLog:message:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-EventLog.message">"message"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_string ("message", "message", "message", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * event_log_get_message: (skip)
+ * @object: A #EventLog.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-EventLog.message">"message"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use event_log_dup_message() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
+ */
+const gchar *
+event_log_get_message (EventLog *object)
+{
+ return EVENT_LOG_GET_IFACE (object)->get_message (object);
+}
+
+/**
+ * event_log_dup_message: (skip)
+ * @object: A #EventLog.
+ *
+ * Gets a copy of the <link linkend="gdbus-property-org-openbmc-EventLog.message">"message"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
+ */
+gchar *
+event_log_dup_message (EventLog *object)
+{
+ gchar *value;
+ g_object_get (G_OBJECT (object), "message", &value, NULL);
+ return value;
+}
+
+/**
+ * event_log_set_message: (skip)
+ * @object: A #EventLog.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-EventLog.message">"message"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+event_log_set_message (EventLog *object, const gchar *value)
+{
+ g_object_set (G_OBJECT (object), "message", value, NULL);
+}
+
+/**
+ * event_log_emit_error_event:
+ * @object: A #EventLog.
+ * @arg_message: Argument to pass with the signal.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-EventLog.ErrorEvent">"ErrorEvent"</link> D-Bus signal.
+ */
+void
+event_log_emit_error_event (
+ EventLog *object,
+ const gchar *arg_message)
+{
+ g_signal_emit_by_name (object, "error-event", arg_message);
+}
+
+/**
+ * event_log_call_error:
+ * @proxy: A #EventLogProxy.
+ * @arg_message: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-EventLog.error">error()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call event_log_call_error_finish() to get the result of the operation.
+ *
+ * See event_log_call_error_sync() for the synchronous, blocking version of this method.
+ */
+void
+event_log_call_error (
+ EventLog *proxy,
+ const gchar *arg_message,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "error",
+ g_variant_new ("(s)",
+ arg_message),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * event_log_call_error_finish:
+ * @proxy: A #EventLogProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to event_log_call_error().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with event_log_call_error().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+event_log_call_error_finish (
+ EventLog *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * event_log_call_error_sync:
+ * @proxy: A #EventLogProxy.
+ * @arg_message: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-EventLog.error">error()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See event_log_call_error() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+event_log_call_error_sync (
+ EventLog *proxy,
+ const gchar *arg_message,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "error",
+ g_variant_new ("(s)",
+ arg_message),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * event_log_complete_error:
+ * @object: A #EventLog.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-EventLog.error">error()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+event_log_complete_error (
+ EventLog *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * EventLogProxy:
+ *
+ * The #EventLogProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * EventLogProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #EventLogProxy.
+ */
+
+struct _EventLogProxyPrivate
+{
+ GData *qdata;
+};
+
+static void event_log_proxy_iface_init (EventLogIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (EventLogProxy, event_log_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (EventLogProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_EVENT_LOG, event_log_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (EventLogProxy, event_log_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_EVENT_LOG, event_log_proxy_iface_init));
+
+#endif
+static void
+event_log_proxy_finalize (GObject *object)
+{
+ EventLogProxy *proxy = EVENT_LOG_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (event_log_proxy_parent_class)->finalize (object);
+}
+
+static void
+event_log_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ info = _event_log_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+event_log_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.EventLog: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+event_log_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ info = _event_log_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.EventLog", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) event_log_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+event_log_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_event_log_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_EVENT_LOG);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_EVENT_LOG);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+event_log_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ EventLogProxy *proxy = EVENT_LOG_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_event_log_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_event_log_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static const gchar *
+event_log_proxy_get_message (EventLog *object)
+{
+ EventLogProxy *proxy = EVENT_LOG_PROXY (object);
+ GVariant *variant;
+ const gchar *value = NULL;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "message");
+ if (variant != NULL)
+ {
+ value = g_variant_get_string (variant, NULL);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+event_log_proxy_init (EventLogProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = event_log_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_EVENT_LOG_PROXY, EventLogProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), event_log_interface_info ());
+}
+
+static void
+event_log_proxy_class_init (EventLogProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = event_log_proxy_finalize;
+ gobject_class->get_property = event_log_proxy_get_property;
+ gobject_class->set_property = event_log_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = event_log_proxy_g_signal;
+ proxy_class->g_properties_changed = event_log_proxy_g_properties_changed;
+
+ event_log_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (EventLogProxyPrivate));
+#endif
+}
+
+static void
+event_log_proxy_iface_init (EventLogIface *iface)
+{
+ iface->get_message = event_log_proxy_get_message;
+}
+
+/**
+ * event_log_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call event_log_proxy_new_finish() to get the result of the operation.
+ *
+ * See event_log_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+event_log_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_EVENT_LOG_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.EventLog", NULL);
+}
+
+/**
+ * event_log_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to event_log_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with event_log_proxy_new().
+ *
+ * Returns: (transfer full) (type EventLogProxy): The constructed proxy object or %NULL if @error is set.
+ */
+EventLog *
+event_log_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return EVENT_LOG (ret);
+ else
+ return NULL;
+}
+
+/**
+ * event_log_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See event_log_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type EventLogProxy): The constructed proxy object or %NULL if @error is set.
+ */
+EventLog *
+event_log_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_EVENT_LOG_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.EventLog", NULL);
+ if (ret != NULL)
+ return EVENT_LOG (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * event_log_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like event_log_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call event_log_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See event_log_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+event_log_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_EVENT_LOG_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.EventLog", NULL);
+}
+
+/**
+ * event_log_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to event_log_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with event_log_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type EventLogProxy): The constructed proxy object or %NULL if @error is set.
+ */
+EventLog *
+event_log_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return EVENT_LOG (ret);
+ else
+ return NULL;
+}
+
+/**
+ * event_log_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like event_log_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See event_log_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type EventLogProxy): The constructed proxy object or %NULL if @error is set.
+ */
+EventLog *
+event_log_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_EVENT_LOG_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.EventLog", NULL);
+ if (ret != NULL)
+ return EVENT_LOG (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * EventLogSkeleton:
+ *
+ * The #EventLogSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * EventLogSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #EventLogSkeleton.
+ */
+
+struct _EventLogSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_event_log_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_EVENT_LOG);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_EVENT_LOG);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_event_log_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_event_log_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_event_log_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_event_log_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _event_log_skeleton_vtable =
+{
+ _event_log_skeleton_handle_method_call,
+ _event_log_skeleton_handle_get_property,
+ _event_log_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+event_log_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return event_log_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+event_log_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_event_log_skeleton_vtable;
+}
+
+static GVariant *
+event_log_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_event_log_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _event_log_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _event_log_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _event_log_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.EventLog", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _event_log_emit_changed (gpointer user_data);
+
+static void
+event_log_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _event_log_emit_changed (skeleton);
+}
+
+static void
+_event_log_on_signal_error_event (
+ EventLog *object,
+ const gchar *arg_message)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
+ arg_message));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.EventLog", "ErrorEvent",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void event_log_skeleton_iface_init (EventLogIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (EventLogSkeleton, event_log_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (EventLogSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_EVENT_LOG, event_log_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (EventLogSkeleton, event_log_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_EVENT_LOG, event_log_skeleton_iface_init));
+
+#endif
+static void
+event_log_skeleton_finalize (GObject *object)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (object);
+ guint n;
+ for (n = 0; n < 1; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (event_log_skeleton_parent_class)->finalize (object);
+}
+
+static void
+event_log_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_event_log_emit_changed (gpointer user_data)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.EventLog",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_event_log_schedule_emit_changed (EventLogSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+event_log_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _event_log_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+event_log_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 1);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _event_log_schedule_emit_changed (skeleton, _event_log_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+event_log_skeleton_init (EventLogSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = event_log_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_EVENT_LOG_SKELETON, EventLogSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 1);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
+}
+
+static const gchar *
+event_log_skeleton_get_message (EventLog *object)
+{
+ EventLogSkeleton *skeleton = EVENT_LOG_SKELETON (object);
+ const gchar *value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_string (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+event_log_skeleton_class_init (EventLogSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = event_log_skeleton_finalize;
+ gobject_class->get_property = event_log_skeleton_get_property;
+ gobject_class->set_property = event_log_skeleton_set_property;
+ gobject_class->notify = event_log_skeleton_notify;
+
+
+ event_log_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = event_log_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = event_log_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = event_log_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = event_log_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (EventLogSkeletonPrivate));
+#endif
+}
+
+static void
+event_log_skeleton_iface_init (EventLogIface *iface)
+{
+ iface->error_event = _event_log_on_signal_error_event;
+ iface->get_message = event_log_skeleton_get_message;
+}
+
+/**
+ * event_log_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link>.
+ *
+ * Returns: (transfer full) (type EventLogSkeleton): The skeleton object.
+ */
+EventLog *
+event_log_skeleton_new (void)
+{
+ return EVENT_LOG (g_object_new (TYPE_EVENT_LOG_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:event-log:
+ *
+ * The #EventLog instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("event-log", "event-log", "event-log", TYPE_EVENT_LOG, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_event_log:
+ * @object: A #Object.
+ *
+ * Gets the #EventLog instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #EventLog that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+EventLog *object_get_event_log (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.EventLog");
+ if (ret == NULL)
+ return NULL;
+ return EVENT_LOG (ret);
+}
+
+
+/**
+ * object_peek_event_log: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_event_log() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #EventLog or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+EventLog *object_peek_event_log (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.EventLog");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return EVENT_LOG (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.EventLog");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "event-log");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_EVENT_LOG (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.EventLog");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.EventLog");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "event-log");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_event_log:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #EventLog or %NULL to clear the interface.
+ *
+ * Sets the #EventLog instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-EventLog.top_of_page">org.openbmc.EventLog</link> on @object.
+ */
+void object_skeleton_set_event_log (ObjectSkeleton *object, EventLog *interface_)
+{
+ g_object_set (G_OBJECT (object), "event-log", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.EventLog", GSIZE_TO_POINTER (TYPE_EVENT_LOG_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/eventlog.h b/interfaces/eventlog.h
new file mode 100644
index 0000000..0b061f1
--- /dev/null
+++ b/interfaces/eventlog.h
@@ -0,0 +1,333 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_EVENTLOG_H__
+#define __INTERFACES_EVENTLOG_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.EventLog */
+
+#define TYPE_EVENT_LOG (event_log_get_type ())
+#define EVENT_LOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_EVENT_LOG, EventLog))
+#define IS_EVENT_LOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_EVENT_LOG))
+#define EVENT_LOG_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_EVENT_LOG, EventLogIface))
+
+struct _EventLog;
+typedef struct _EventLog EventLog;
+typedef struct _EventLogIface EventLogIface;
+
+struct _EventLogIface
+{
+ GTypeInterface parent_iface;
+
+
+
+ gboolean (*handle_error) (
+ EventLog *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_message);
+
+ const gchar * (*get_message) (EventLog *object);
+
+ void (*error_event) (
+ EventLog *object,
+ const gchar *arg_message);
+
+};
+
+GType event_log_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *event_log_interface_info (void);
+guint event_log_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void event_log_complete_error (
+ EventLog *object,
+ GDBusMethodInvocation *invocation);
+
+
+
+/* D-Bus signal emissions functions: */
+void event_log_emit_error_event (
+ EventLog *object,
+ const gchar *arg_message);
+
+
+
+/* D-Bus method calls: */
+void event_log_call_error (
+ EventLog *proxy,
+ const gchar *arg_message,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean event_log_call_error_finish (
+ EventLog *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean event_log_call_error_sync (
+ EventLog *proxy,
+ const gchar *arg_message,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+const gchar *event_log_get_message (EventLog *object);
+gchar *event_log_dup_message (EventLog *object);
+void event_log_set_message (EventLog *object, const gchar *value);
+
+
+/* ---- */
+
+#define TYPE_EVENT_LOG_PROXY (event_log_proxy_get_type ())
+#define EVENT_LOG_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_EVENT_LOG_PROXY, EventLogProxy))
+#define EVENT_LOG_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_EVENT_LOG_PROXY, EventLogProxyClass))
+#define EVENT_LOG_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_EVENT_LOG_PROXY, EventLogProxyClass))
+#define IS_EVENT_LOG_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_EVENT_LOG_PROXY))
+#define IS_EVENT_LOG_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_EVENT_LOG_PROXY))
+
+typedef struct _EventLogProxy EventLogProxy;
+typedef struct _EventLogProxyClass EventLogProxyClass;
+typedef struct _EventLogProxyPrivate EventLogProxyPrivate;
+
+struct _EventLogProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ EventLogProxyPrivate *priv;
+};
+
+struct _EventLogProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType event_log_proxy_get_type (void) G_GNUC_CONST;
+
+void event_log_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+EventLog *event_log_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+EventLog *event_log_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void event_log_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+EventLog *event_log_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+EventLog *event_log_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_EVENT_LOG_SKELETON (event_log_skeleton_get_type ())
+#define EVENT_LOG_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_EVENT_LOG_SKELETON, EventLogSkeleton))
+#define EVENT_LOG_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_EVENT_LOG_SKELETON, EventLogSkeletonClass))
+#define EVENT_LOG_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_EVENT_LOG_SKELETON, EventLogSkeletonClass))
+#define IS_EVENT_LOG_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_EVENT_LOG_SKELETON))
+#define IS_EVENT_LOG_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_EVENT_LOG_SKELETON))
+
+typedef struct _EventLogSkeleton EventLogSkeleton;
+typedef struct _EventLogSkeletonClass EventLogSkeletonClass;
+typedef struct _EventLogSkeletonPrivate EventLogSkeletonPrivate;
+
+struct _EventLogSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ EventLogSkeletonPrivate *priv;
+};
+
+struct _EventLogSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType event_log_skeleton_get_type (void) G_GNUC_CONST;
+
+EventLog *event_log_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+EventLog *object_get_event_log (Object *object);
+EventLog *object_peek_event_log (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_event_log (ObjectSkeleton *object, EventLog *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_EVENTLOG_H__ */
diff --git a/interfaces/flash.c b/interfaces/flash.c
new file mode 100644
index 0000000..6dc02c6
--- /dev/null
+++ b/interfaces/flash.c
@@ -0,0 +1,2139 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/flash.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.Flash
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Flash
+ * @title: Flash
+ * @short_description: Generated C code for the org.openbmc.Flash D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.Flash ---- */
+
+static const _ExtendedGDBusArgInfo _flash_method_info_update_via_file_IN_ARG_file =
+{
+ {
+ -1,
+ (gchar *) "file",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _flash_method_info_update_via_file_IN_ARG_pointers[] =
+{
+ &_flash_method_info_update_via_file_IN_ARG_file,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _flash_method_info_update_via_file =
+{
+ {
+ -1,
+ (gchar *) "updateViaFile",
+ (GDBusArgInfo **) &_flash_method_info_update_via_file_IN_ARG_pointers,
+ NULL,
+ NULL
+ },
+ "handle-update-via-file",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _flash_method_info_update_via_http_IN_ARG_url =
+{
+ {
+ -1,
+ (gchar *) "url",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _flash_method_info_update_via_http_IN_ARG_pointers[] =
+{
+ &_flash_method_info_update_via_http_IN_ARG_url,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _flash_method_info_update_via_http =
+{
+ {
+ -1,
+ (gchar *) "updateViaHttp",
+ (GDBusArgInfo **) &_flash_method_info_update_via_http_IN_ARG_pointers,
+ NULL,
+ NULL
+ },
+ "handle-update-via-http",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _flash_method_info_erase =
+{
+ {
+ -1,
+ (gchar *) "erase",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-erase",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _flash_method_info_init =
+{
+ {
+ -1,
+ (gchar *) "init",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-init",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _flash_method_info_pointers[] =
+{
+ &_flash_method_info_update_via_file,
+ &_flash_method_info_update_via_http,
+ &_flash_method_info_erase,
+ &_flash_method_info_init,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _flash_signal_info_updated =
+{
+ {
+ -1,
+ (gchar *) "Updated",
+ NULL,
+ NULL
+ },
+ "updated"
+};
+
+static const _ExtendedGDBusSignalInfo * const _flash_signal_info_pointers[] =
+{
+ &_flash_signal_info_updated,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _flash_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.Flash",
+ (GDBusMethodInfo **) &_flash_method_info_pointers,
+ (GDBusSignalInfo **) &_flash_signal_info_pointers,
+ NULL,
+ NULL
+ },
+ "flash",
+};
+
+
+/**
+ * flash_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+flash_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_flash_interface_info.parent_struct;
+}
+
+/**
+ * flash_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #Flash interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+flash_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * Flash:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link>.
+ */
+
+/**
+ * FlashIface:
+ * @parent_iface: The parent interface.
+ * @handle_erase: Handler for the #Flash::handle-erase signal.
+ * @handle_init: Handler for the #Flash::handle-init signal.
+ * @handle_update_via_file: Handler for the #Flash::handle-update-via-file signal.
+ * @handle_update_via_http: Handler for the #Flash::handle-update-via-http signal.
+ * @updated: Handler for the #Flash::updated signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link>.
+ */
+
+typedef FlashIface FlashInterface;
+G_DEFINE_INTERFACE (Flash, flash, G_TYPE_OBJECT);
+
+static void
+flash_default_init (FlashIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * Flash::handle-update-via-file:
+ * @object: A #Flash.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_file: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Flash.updateViaFile">updateViaFile()</link> 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 flash_complete_update_via_file() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-update-via-file",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (FlashIface, handle_update_via_file),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
+
+ /**
+ * Flash::handle-update-via-http:
+ * @object: A #Flash.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_url: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Flash.updateViaHttp">updateViaHttp()</link> 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 flash_complete_update_via_http() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-update-via-http",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (FlashIface, handle_update_via_http),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
+
+ /**
+ * Flash::handle-erase:
+ * @object: A #Flash.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Flash.erase">erase()</link> 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 flash_complete_erase() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-erase",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (FlashIface, handle_erase),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * Flash::handle-init:
+ * @object: A #Flash.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Flash.init">init()</link> 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 flash_complete_init() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-init",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (FlashIface, handle_init),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * Flash::updated:
+ * @object: A #Flash.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-Flash.Updated">"Updated"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("updated",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (FlashIface, updated),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+}
+
+/**
+ * flash_emit_updated:
+ * @object: A #Flash.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-Flash.Updated">"Updated"</link> D-Bus signal.
+ */
+void
+flash_emit_updated (
+ Flash *object)
+{
+ g_signal_emit_by_name (object, "updated");
+}
+
+/**
+ * flash_call_update_via_file:
+ * @proxy: A #FlashProxy.
+ * @arg_file: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.updateViaFile">updateViaFile()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_call_update_via_file_finish() to get the result of the operation.
+ *
+ * See flash_call_update_via_file_sync() for the synchronous, blocking version of this method.
+ */
+void
+flash_call_update_via_file (
+ Flash *proxy,
+ const gchar *arg_file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "updateViaFile",
+ g_variant_new ("(s)",
+ arg_file),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * flash_call_update_via_file_finish:
+ * @proxy: A #FlashProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_call_update_via_file().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with flash_call_update_via_file().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_update_via_file_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_update_via_file_sync:
+ * @proxy: A #FlashProxy.
+ * @arg_file: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.updateViaFile">updateViaFile()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See flash_call_update_via_file() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_update_via_file_sync (
+ Flash *proxy,
+ const gchar *arg_file,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "updateViaFile",
+ g_variant_new ("(s)",
+ arg_file),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_update_via_http:
+ * @proxy: A #FlashProxy.
+ * @arg_url: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.updateViaHttp">updateViaHttp()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_call_update_via_http_finish() to get the result of the operation.
+ *
+ * See flash_call_update_via_http_sync() for the synchronous, blocking version of this method.
+ */
+void
+flash_call_update_via_http (
+ Flash *proxy,
+ const gchar *arg_url,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "updateViaHttp",
+ g_variant_new ("(s)",
+ arg_url),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * flash_call_update_via_http_finish:
+ * @proxy: A #FlashProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_call_update_via_http().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with flash_call_update_via_http().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_update_via_http_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_update_via_http_sync:
+ * @proxy: A #FlashProxy.
+ * @arg_url: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.updateViaHttp">updateViaHttp()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See flash_call_update_via_http() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_update_via_http_sync (
+ Flash *proxy,
+ const gchar *arg_url,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "updateViaHttp",
+ g_variant_new ("(s)",
+ arg_url),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_erase:
+ * @proxy: A #FlashProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.erase">erase()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_call_erase_finish() to get the result of the operation.
+ *
+ * See flash_call_erase_sync() for the synchronous, blocking version of this method.
+ */
+void
+flash_call_erase (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "erase",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * flash_call_erase_finish:
+ * @proxy: A #FlashProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_call_erase().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with flash_call_erase().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_erase_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_erase_sync:
+ * @proxy: A #FlashProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.erase">erase()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See flash_call_erase() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_erase_sync (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "erase",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_init:
+ * @proxy: A #FlashProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.init">init()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_call_init_finish() to get the result of the operation.
+ *
+ * See flash_call_init_sync() for the synchronous, blocking version of this method.
+ */
+void
+flash_call_init (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "init",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * flash_call_init_finish:
+ * @proxy: A #FlashProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_call_init().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with flash_call_init().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_init_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_call_init_sync:
+ * @proxy: A #FlashProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.init">init()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See flash_call_init() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_init_sync (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "init",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * flash_complete_update_via_file:
+ * @object: A #Flash.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Flash.updateViaFile">updateViaFile()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+flash_complete_update_via_file (
+ Flash *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * flash_complete_update_via_http:
+ * @object: A #Flash.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Flash.updateViaHttp">updateViaHttp()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+flash_complete_update_via_http (
+ Flash *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * flash_complete_erase:
+ * @object: A #Flash.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Flash.erase">erase()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+flash_complete_erase (
+ Flash *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * flash_complete_init:
+ * @object: A #Flash.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Flash.init">init()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+flash_complete_init (
+ Flash *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * FlashProxy:
+ *
+ * The #FlashProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * FlashProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #FlashProxy.
+ */
+
+struct _FlashProxyPrivate
+{
+ GData *qdata;
+};
+
+static void flash_proxy_iface_init (FlashIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (FlashProxy, flash_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (FlashProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_FLASH, flash_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (FlashProxy, flash_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_FLASH, flash_proxy_iface_init));
+
+#endif
+static void
+flash_proxy_finalize (GObject *object)
+{
+ FlashProxy *proxy = FLASH_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (flash_proxy_parent_class)->finalize (object);
+}
+
+static void
+flash_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+}
+
+static void
+flash_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+}
+
+static void
+flash_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_flash_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_FLASH);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_FLASH);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+flash_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ FlashProxy *proxy = FLASH_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_flash_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_flash_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static void
+flash_proxy_init (FlashProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = flash_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_FLASH_PROXY, FlashProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), flash_interface_info ());
+}
+
+static void
+flash_proxy_class_init (FlashProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = flash_proxy_finalize;
+ gobject_class->get_property = flash_proxy_get_property;
+ gobject_class->set_property = flash_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = flash_proxy_g_signal;
+ proxy_class->g_properties_changed = flash_proxy_g_properties_changed;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (FlashProxyPrivate));
+#endif
+}
+
+static void
+flash_proxy_iface_init (FlashIface *iface)
+{
+}
+
+/**
+ * flash_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_proxy_new_finish() to get the result of the operation.
+ *
+ * See flash_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+flash_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_FLASH_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.Flash", NULL);
+}
+
+/**
+ * flash_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with flash_proxy_new().
+ *
+ * Returns: (transfer full) (type FlashProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Flash *
+flash_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return FLASH (ret);
+ else
+ return NULL;
+}
+
+/**
+ * flash_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See flash_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type FlashProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Flash *
+flash_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_FLASH_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.Flash", NULL);
+ if (ret != NULL)
+ return FLASH (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * flash_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like flash_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See flash_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+flash_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_FLASH_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.Flash", NULL);
+}
+
+/**
+ * flash_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with flash_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type FlashProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Flash *
+flash_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return FLASH (ret);
+ else
+ return NULL;
+}
+
+/**
+ * flash_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like flash_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See flash_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type FlashProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Flash *
+flash_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_FLASH_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.Flash", NULL);
+ if (ret != NULL)
+ return FLASH (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * FlashSkeleton:
+ *
+ * The #FlashSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * FlashSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #FlashSkeleton.
+ */
+
+struct _FlashSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_flash_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ FlashSkeleton *skeleton = FLASH_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_FLASH);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_FLASH);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_flash_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ FlashSkeleton *skeleton = FLASH_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_flash_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_flash_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ FlashSkeleton *skeleton = FLASH_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_flash_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _flash_skeleton_vtable =
+{
+ _flash_skeleton_handle_method_call,
+ _flash_skeleton_handle_get_property,
+ _flash_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+flash_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return flash_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+flash_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_flash_skeleton_vtable;
+}
+
+static GVariant *
+flash_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ FlashSkeleton *skeleton = FLASH_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_flash_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _flash_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _flash_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _flash_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Flash", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static void
+flash_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+}
+
+static void
+_flash_on_signal_updated (
+ Flash *object)
+{
+ FlashSkeleton *skeleton = FLASH_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Flash", "Updated",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void flash_skeleton_iface_init (FlashIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (FlashSkeleton, flash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (FlashSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_FLASH, flash_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (FlashSkeleton, flash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_FLASH, flash_skeleton_iface_init));
+
+#endif
+static void
+flash_skeleton_finalize (GObject *object)
+{
+ FlashSkeleton *skeleton = FLASH_SKELETON (object);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (flash_skeleton_parent_class)->finalize (object);
+}
+
+static void
+flash_skeleton_init (FlashSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = flash_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_FLASH_SKELETON, FlashSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+}
+
+static void
+flash_skeleton_class_init (FlashSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = flash_skeleton_finalize;
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = flash_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = flash_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = flash_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = flash_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (FlashSkeletonPrivate));
+#endif
+}
+
+static void
+flash_skeleton_iface_init (FlashIface *iface)
+{
+ iface->updated = _flash_on_signal_updated;
+}
+
+/**
+ * flash_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link>.
+ *
+ * Returns: (transfer full) (type FlashSkeleton): The skeleton object.
+ */
+Flash *
+flash_skeleton_new (void)
+{
+ return FLASH (g_object_new (TYPE_FLASH_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:flash:
+ *
+ * The #Flash instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("flash", "flash", "flash", TYPE_FLASH, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_flash:
+ * @object: A #Object.
+ *
+ * Gets the #Flash instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #Flash that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+Flash *object_get_flash (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Flash");
+ if (ret == NULL)
+ return NULL;
+ return FLASH (ret);
+}
+
+
+/**
+ * object_peek_flash: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_flash() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #Flash or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+Flash *object_peek_flash (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Flash");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return FLASH (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Flash");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "flash");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_FLASH (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.Flash");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Flash");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "flash");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_flash:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #Flash or %NULL to clear the interface.
+ *
+ * Sets the #Flash instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Flash.top_of_page">org.openbmc.Flash</link> on @object.
+ */
+void object_skeleton_set_flash (ObjectSkeleton *object, Flash *interface_)
+{
+ g_object_set (G_OBJECT (object), "flash", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.Flash", GSIZE_TO_POINTER (TYPE_FLASH_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/flash.h b/interfaces/flash.h
new file mode 100644
index 0000000..9fd88ff
--- /dev/null
+++ b/interfaces/flash.h
@@ -0,0 +1,397 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_FLASH_H__
+#define __INTERFACES_FLASH_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.Flash */
+
+#define TYPE_FLASH (flash_get_type ())
+#define FLASH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_FLASH, Flash))
+#define IS_FLASH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_FLASH))
+#define FLASH_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_FLASH, FlashIface))
+
+struct _Flash;
+typedef struct _Flash Flash;
+typedef struct _FlashIface FlashIface;
+
+struct _FlashIface
+{
+ GTypeInterface parent_iface;
+
+
+ gboolean (*handle_erase) (
+ Flash *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_init) (
+ Flash *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_update_via_file) (
+ Flash *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_file);
+
+ gboolean (*handle_update_via_http) (
+ Flash *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *arg_url);
+
+ void (*updated) (
+ Flash *object);
+
+};
+
+GType flash_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *flash_interface_info (void);
+guint flash_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void flash_complete_update_via_file (
+ Flash *object,
+ GDBusMethodInvocation *invocation);
+
+void flash_complete_update_via_http (
+ Flash *object,
+ GDBusMethodInvocation *invocation);
+
+void flash_complete_erase (
+ Flash *object,
+ GDBusMethodInvocation *invocation);
+
+void flash_complete_init (
+ Flash *object,
+ GDBusMethodInvocation *invocation);
+
+
+
+/* D-Bus signal emissions functions: */
+void flash_emit_updated (
+ Flash *object);
+
+
+
+/* D-Bus method calls: */
+void flash_call_update_via_file (
+ Flash *proxy,
+ const gchar *arg_file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean flash_call_update_via_file_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean flash_call_update_via_file_sync (
+ Flash *proxy,
+ const gchar *arg_file,
+ GCancellable *cancellable,
+ GError **error);
+
+void flash_call_update_via_http (
+ Flash *proxy,
+ const gchar *arg_url,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean flash_call_update_via_http_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean flash_call_update_via_http_sync (
+ Flash *proxy,
+ const gchar *arg_url,
+ GCancellable *cancellable,
+ GError **error);
+
+void flash_call_erase (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean flash_call_erase_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean flash_call_erase_sync (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void flash_call_init (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean flash_call_init_finish (
+ Flash *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean flash_call_init_sync (
+ Flash *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* ---- */
+
+#define TYPE_FLASH_PROXY (flash_proxy_get_type ())
+#define FLASH_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_FLASH_PROXY, FlashProxy))
+#define FLASH_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_FLASH_PROXY, FlashProxyClass))
+#define FLASH_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_FLASH_PROXY, FlashProxyClass))
+#define IS_FLASH_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_FLASH_PROXY))
+#define IS_FLASH_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_FLASH_PROXY))
+
+typedef struct _FlashProxy FlashProxy;
+typedef struct _FlashProxyClass FlashProxyClass;
+typedef struct _FlashProxyPrivate FlashProxyPrivate;
+
+struct _FlashProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ FlashProxyPrivate *priv;
+};
+
+struct _FlashProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType flash_proxy_get_type (void) G_GNUC_CONST;
+
+void flash_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+Flash *flash_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+Flash *flash_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void flash_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+Flash *flash_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+Flash *flash_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_FLASH_SKELETON (flash_skeleton_get_type ())
+#define FLASH_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_FLASH_SKELETON, FlashSkeleton))
+#define FLASH_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_FLASH_SKELETON, FlashSkeletonClass))
+#define FLASH_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_FLASH_SKELETON, FlashSkeletonClass))
+#define IS_FLASH_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_FLASH_SKELETON))
+#define IS_FLASH_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_FLASH_SKELETON))
+
+typedef struct _FlashSkeleton FlashSkeleton;
+typedef struct _FlashSkeletonClass FlashSkeletonClass;
+typedef struct _FlashSkeletonPrivate FlashSkeletonPrivate;
+
+struct _FlashSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ FlashSkeletonPrivate *priv;
+};
+
+struct _FlashSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType flash_skeleton_get_type (void) G_GNUC_CONST;
+
+Flash *flash_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+Flash *object_get_flash (Object *object);
+Flash *object_peek_flash (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_flash (ObjectSkeleton *object, Flash *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_FLASH_H__ */
diff --git a/interfaces/host_control.c b/interfaces/host_control.c
new file mode 100644
index 0000000..2c43703
--- /dev/null
+++ b/interfaces/host_control.c
@@ -0,0 +1,1797 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/host_control.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.HostControl
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:HostControl
+ * @title: HostControl
+ * @short_description: Generated C code for the org.openbmc.HostControl D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.HostControl ---- */
+
+static const _ExtendedGDBusMethodInfo _host_control_method_info_boot =
+{
+ {
+ -1,
+ (gchar *) "boot",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-boot",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _host_control_method_info_shutdown =
+{
+ {
+ -1,
+ (gchar *) "shutdown",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-shutdown",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _host_control_method_info_pointers[] =
+{
+ &_host_control_method_info_boot,
+ &_host_control_method_info_shutdown,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _host_control_signal_info_booted =
+{
+ {
+ -1,
+ (gchar *) "booted",
+ NULL,
+ NULL
+ },
+ "booted"
+};
+
+static const _ExtendedGDBusSignalInfo * const _host_control_signal_info_pointers[] =
+{
+ &_host_control_signal_info_booted,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _host_control_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.HostControl",
+ (GDBusMethodInfo **) &_host_control_method_info_pointers,
+ (GDBusSignalInfo **) &_host_control_signal_info_pointers,
+ NULL,
+ NULL
+ },
+ "host-control",
+};
+
+
+/**
+ * host_control_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+host_control_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_host_control_interface_info.parent_struct;
+}
+
+/**
+ * host_control_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #HostControl interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+host_control_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * HostControl:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link>.
+ */
+
+/**
+ * HostControlIface:
+ * @parent_iface: The parent interface.
+ * @handle_boot: Handler for the #HostControl::handle-boot signal.
+ * @handle_shutdown: Handler for the #HostControl::handle-shutdown signal.
+ * @booted: Handler for the #HostControl::booted signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link>.
+ */
+
+typedef HostControlIface HostControlInterface;
+G_DEFINE_INTERFACE (HostControl, host_control, G_TYPE_OBJECT);
+
+static void
+host_control_default_init (HostControlIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * HostControl::handle-boot:
+ * @object: A #HostControl.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-HostControl.boot">boot()</link> 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 host_control_complete_boot() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-boot",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (HostControlIface, handle_boot),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * HostControl::handle-shutdown:
+ * @object: A #HostControl.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-HostControl.shutdown">shutdown()</link> 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 host_control_complete_shutdown() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-shutdown",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (HostControlIface, handle_shutdown),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * HostControl::booted:
+ * @object: A #HostControl.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-HostControl.booted">"booted"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("booted",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (HostControlIface, booted),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+}
+
+/**
+ * host_control_emit_booted:
+ * @object: A #HostControl.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-HostControl.booted">"booted"</link> D-Bus signal.
+ */
+void
+host_control_emit_booted (
+ HostControl *object)
+{
+ g_signal_emit_by_name (object, "booted");
+}
+
+/**
+ * host_control_call_boot:
+ * @proxy: A #HostControlProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-HostControl.boot">boot()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call host_control_call_boot_finish() to get the result of the operation.
+ *
+ * See host_control_call_boot_sync() for the synchronous, blocking version of this method.
+ */
+void
+host_control_call_boot (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "boot",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * host_control_call_boot_finish:
+ * @proxy: A #HostControlProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to host_control_call_boot().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with host_control_call_boot().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+host_control_call_boot_finish (
+ HostControl *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * host_control_call_boot_sync:
+ * @proxy: A #HostControlProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-HostControl.boot">boot()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See host_control_call_boot() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+host_control_call_boot_sync (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "boot",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * host_control_call_shutdown:
+ * @proxy: A #HostControlProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-HostControl.shutdown">shutdown()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call host_control_call_shutdown_finish() to get the result of the operation.
+ *
+ * See host_control_call_shutdown_sync() for the synchronous, blocking version of this method.
+ */
+void
+host_control_call_shutdown (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "shutdown",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * host_control_call_shutdown_finish:
+ * @proxy: A #HostControlProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to host_control_call_shutdown().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with host_control_call_shutdown().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+host_control_call_shutdown_finish (
+ HostControl *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * host_control_call_shutdown_sync:
+ * @proxy: A #HostControlProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-HostControl.shutdown">shutdown()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See host_control_call_shutdown() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+host_control_call_shutdown_sync (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "shutdown",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * host_control_complete_boot:
+ * @object: A #HostControl.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-HostControl.boot">boot()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+host_control_complete_boot (
+ HostControl *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * host_control_complete_shutdown:
+ * @object: A #HostControl.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-HostControl.shutdown">shutdown()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+host_control_complete_shutdown (
+ HostControl *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * HostControlProxy:
+ *
+ * The #HostControlProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * HostControlProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #HostControlProxy.
+ */
+
+struct _HostControlProxyPrivate
+{
+ GData *qdata;
+};
+
+static void host_control_proxy_iface_init (HostControlIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (HostControlProxy, host_control_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (HostControlProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_HOST_CONTROL, host_control_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (HostControlProxy, host_control_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_HOST_CONTROL, host_control_proxy_iface_init));
+
+#endif
+static void
+host_control_proxy_finalize (GObject *object)
+{
+ HostControlProxy *proxy = HOST_CONTROL_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (host_control_proxy_parent_class)->finalize (object);
+}
+
+static void
+host_control_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+}
+
+static void
+host_control_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+}
+
+static void
+host_control_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_host_control_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_HOST_CONTROL);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_HOST_CONTROL);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+host_control_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ HostControlProxy *proxy = HOST_CONTROL_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_host_control_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_host_control_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static void
+host_control_proxy_init (HostControlProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = host_control_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_HOST_CONTROL_PROXY, HostControlProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), host_control_interface_info ());
+}
+
+static void
+host_control_proxy_class_init (HostControlProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = host_control_proxy_finalize;
+ gobject_class->get_property = host_control_proxy_get_property;
+ gobject_class->set_property = host_control_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = host_control_proxy_g_signal;
+ proxy_class->g_properties_changed = host_control_proxy_g_properties_changed;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (HostControlProxyPrivate));
+#endif
+}
+
+static void
+host_control_proxy_iface_init (HostControlIface *iface)
+{
+}
+
+/**
+ * host_control_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call host_control_proxy_new_finish() to get the result of the operation.
+ *
+ * See host_control_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+host_control_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_HOST_CONTROL_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.HostControl", NULL);
+}
+
+/**
+ * host_control_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to host_control_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with host_control_proxy_new().
+ *
+ * Returns: (transfer full) (type HostControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+HostControl *
+host_control_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return HOST_CONTROL (ret);
+ else
+ return NULL;
+}
+
+/**
+ * host_control_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See host_control_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type HostControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+HostControl *
+host_control_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_HOST_CONTROL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.HostControl", NULL);
+ if (ret != NULL)
+ return HOST_CONTROL (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * host_control_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like host_control_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call host_control_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See host_control_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+host_control_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_HOST_CONTROL_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.HostControl", NULL);
+}
+
+/**
+ * host_control_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to host_control_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with host_control_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type HostControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+HostControl *
+host_control_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return HOST_CONTROL (ret);
+ else
+ return NULL;
+}
+
+/**
+ * host_control_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like host_control_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See host_control_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type HostControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+HostControl *
+host_control_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_HOST_CONTROL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.HostControl", NULL);
+ if (ret != NULL)
+ return HOST_CONTROL (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * HostControlSkeleton:
+ *
+ * The #HostControlSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * HostControlSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #HostControlSkeleton.
+ */
+
+struct _HostControlSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_host_control_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ HostControlSkeleton *skeleton = HOST_CONTROL_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_HOST_CONTROL);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_HOST_CONTROL);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_host_control_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ HostControlSkeleton *skeleton = HOST_CONTROL_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_host_control_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_host_control_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ HostControlSkeleton *skeleton = HOST_CONTROL_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_host_control_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _host_control_skeleton_vtable =
+{
+ _host_control_skeleton_handle_method_call,
+ _host_control_skeleton_handle_get_property,
+ _host_control_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+host_control_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return host_control_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+host_control_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_host_control_skeleton_vtable;
+}
+
+static GVariant *
+host_control_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ HostControlSkeleton *skeleton = HOST_CONTROL_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_host_control_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _host_control_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _host_control_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _host_control_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.HostControl", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static void
+host_control_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+}
+
+static void
+_host_control_on_signal_booted (
+ HostControl *object)
+{
+ HostControlSkeleton *skeleton = HOST_CONTROL_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.HostControl", "booted",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void host_control_skeleton_iface_init (HostControlIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (HostControlSkeleton, host_control_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (HostControlSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_HOST_CONTROL, host_control_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (HostControlSkeleton, host_control_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_HOST_CONTROL, host_control_skeleton_iface_init));
+
+#endif
+static void
+host_control_skeleton_finalize (GObject *object)
+{
+ HostControlSkeleton *skeleton = HOST_CONTROL_SKELETON (object);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (host_control_skeleton_parent_class)->finalize (object);
+}
+
+static void
+host_control_skeleton_init (HostControlSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = host_control_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_HOST_CONTROL_SKELETON, HostControlSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+}
+
+static void
+host_control_skeleton_class_init (HostControlSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = host_control_skeleton_finalize;
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = host_control_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = host_control_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = host_control_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = host_control_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (HostControlSkeletonPrivate));
+#endif
+}
+
+static void
+host_control_skeleton_iface_init (HostControlIface *iface)
+{
+ iface->booted = _host_control_on_signal_booted;
+}
+
+/**
+ * host_control_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link>.
+ *
+ * Returns: (transfer full) (type HostControlSkeleton): The skeleton object.
+ */
+HostControl *
+host_control_skeleton_new (void)
+{
+ return HOST_CONTROL (g_object_new (TYPE_HOST_CONTROL_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:host-control:
+ *
+ * The #HostControl instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("host-control", "host-control", "host-control", TYPE_HOST_CONTROL, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_host_control:
+ * @object: A #Object.
+ *
+ * Gets the #HostControl instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #HostControl that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+HostControl *object_get_host_control (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.HostControl");
+ if (ret == NULL)
+ return NULL;
+ return HOST_CONTROL (ret);
+}
+
+
+/**
+ * object_peek_host_control: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_host_control() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #HostControl or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+HostControl *object_peek_host_control (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.HostControl");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return HOST_CONTROL (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.HostControl");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "host-control");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_HOST_CONTROL (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.HostControl");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.HostControl");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "host-control");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_host_control:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #HostControl or %NULL to clear the interface.
+ *
+ * Sets the #HostControl instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-HostControl.top_of_page">org.openbmc.HostControl</link> on @object.
+ */
+void object_skeleton_set_host_control (ObjectSkeleton *object, HostControl *interface_)
+{
+ g_object_set (G_OBJECT (object), "host-control", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.HostControl", GSIZE_TO_POINTER (TYPE_HOST_CONTROL_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/host_control.h b/interfaces/host_control.h
new file mode 100644
index 0000000..ccbd7cf
--- /dev/null
+++ b/interfaces/host_control.h
@@ -0,0 +1,343 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_HOST_CONTROL_H__
+#define __INTERFACES_HOST_CONTROL_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.HostControl */
+
+#define TYPE_HOST_CONTROL (host_control_get_type ())
+#define HOST_CONTROL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_HOST_CONTROL, HostControl))
+#define IS_HOST_CONTROL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_HOST_CONTROL))
+#define HOST_CONTROL_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_HOST_CONTROL, HostControlIface))
+
+struct _HostControl;
+typedef struct _HostControl HostControl;
+typedef struct _HostControlIface HostControlIface;
+
+struct _HostControlIface
+{
+ GTypeInterface parent_iface;
+
+
+ gboolean (*handle_boot) (
+ HostControl *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_shutdown) (
+ HostControl *object,
+ GDBusMethodInvocation *invocation);
+
+ void (*booted) (
+ HostControl *object);
+
+};
+
+GType host_control_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *host_control_interface_info (void);
+guint host_control_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void host_control_complete_boot (
+ HostControl *object,
+ GDBusMethodInvocation *invocation);
+
+void host_control_complete_shutdown (
+ HostControl *object,
+ GDBusMethodInvocation *invocation);
+
+
+
+/* D-Bus signal emissions functions: */
+void host_control_emit_booted (
+ HostControl *object);
+
+
+
+/* D-Bus method calls: */
+void host_control_call_boot (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean host_control_call_boot_finish (
+ HostControl *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean host_control_call_boot_sync (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void host_control_call_shutdown (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean host_control_call_shutdown_finish (
+ HostControl *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean host_control_call_shutdown_sync (
+ HostControl *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* ---- */
+
+#define TYPE_HOST_CONTROL_PROXY (host_control_proxy_get_type ())
+#define HOST_CONTROL_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_HOST_CONTROL_PROXY, HostControlProxy))
+#define HOST_CONTROL_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_HOST_CONTROL_PROXY, HostControlProxyClass))
+#define HOST_CONTROL_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_HOST_CONTROL_PROXY, HostControlProxyClass))
+#define IS_HOST_CONTROL_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_HOST_CONTROL_PROXY))
+#define IS_HOST_CONTROL_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_HOST_CONTROL_PROXY))
+
+typedef struct _HostControlProxy HostControlProxy;
+typedef struct _HostControlProxyClass HostControlProxyClass;
+typedef struct _HostControlProxyPrivate HostControlProxyPrivate;
+
+struct _HostControlProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ HostControlProxyPrivate *priv;
+};
+
+struct _HostControlProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType host_control_proxy_get_type (void) G_GNUC_CONST;
+
+void host_control_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+HostControl *host_control_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+HostControl *host_control_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void host_control_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+HostControl *host_control_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+HostControl *host_control_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_HOST_CONTROL_SKELETON (host_control_skeleton_get_type ())
+#define HOST_CONTROL_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_HOST_CONTROL_SKELETON, HostControlSkeleton))
+#define HOST_CONTROL_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_HOST_CONTROL_SKELETON, HostControlSkeletonClass))
+#define HOST_CONTROL_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_HOST_CONTROL_SKELETON, HostControlSkeletonClass))
+#define IS_HOST_CONTROL_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_HOST_CONTROL_SKELETON))
+#define IS_HOST_CONTROL_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_HOST_CONTROL_SKELETON))
+
+typedef struct _HostControlSkeleton HostControlSkeleton;
+typedef struct _HostControlSkeletonClass HostControlSkeletonClass;
+typedef struct _HostControlSkeletonPrivate HostControlSkeletonPrivate;
+
+struct _HostControlSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ HostControlSkeletonPrivate *priv;
+};
+
+struct _HostControlSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType host_control_skeleton_get_type (void) G_GNUC_CONST;
+
+HostControl *host_control_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+HostControl *object_get_host_control (Object *object);
+HostControl *object_peek_host_control (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_host_control (ObjectSkeleton *object, HostControl *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_HOST_CONTROL_H__ */
diff --git a/interfaces/led.c b/interfaces/led.c
new file mode 100644
index 0000000..c1c23a2
--- /dev/null
+++ b/interfaces/led.c
@@ -0,0 +1,2432 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/led.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.Led
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Led
+ * @title: Led
+ * @short_description: Generated C code for the org.openbmc.Led D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.Led ---- */
+
+static const _ExtendedGDBusMethodInfo _led_method_info_set_on =
+{
+ {
+ -1,
+ (gchar *) "setOn",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-set-on",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _led_method_info_set_off =
+{
+ {
+ -1,
+ (gchar *) "setOff",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-set-off",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _led_method_info_set_blink_slow =
+{
+ {
+ -1,
+ (gchar *) "setBlinkSlow",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-set-blink-slow",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _led_method_info_set_blink_fast =
+{
+ {
+ -1,
+ (gchar *) "setBlinkFast",
+ NULL,
+ NULL,
+ NULL
+ },
+ "handle-set-blink-fast",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _led_method_info_pointers[] =
+{
+ &_led_method_info_set_on,
+ &_led_method_info_set_off,
+ &_led_method_info_set_blink_slow,
+ &_led_method_info_set_blink_fast,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _led_property_info_color =
+{
+ {
+ -1,
+ (gchar *) "color",
+ (gchar *) "i",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "color",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo _led_property_info_function =
+{
+ {
+ -1,
+ (gchar *) "function",
+ (gchar *) "s",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "function",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _led_property_info_pointers[] =
+{
+ &_led_property_info_color,
+ &_led_property_info_function,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _led_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.Led",
+ (GDBusMethodInfo **) &_led_method_info_pointers,
+ NULL,
+ (GDBusPropertyInfo **) &_led_property_info_pointers,
+ NULL
+ },
+ "led",
+};
+
+
+/**
+ * led_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+led_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_led_interface_info.parent_struct;
+}
+
+/**
+ * led_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #Led interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+led_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "color");
+ g_object_class_override_property (klass, property_id_begin++, "function");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * Led:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link>.
+ */
+
+/**
+ * LedIface:
+ * @parent_iface: The parent interface.
+ * @handle_set_blink_fast: Handler for the #Led::handle-set-blink-fast signal.
+ * @handle_set_blink_slow: Handler for the #Led::handle-set-blink-slow signal.
+ * @handle_set_off: Handler for the #Led::handle-set-off signal.
+ * @handle_set_on: Handler for the #Led::handle-set-on signal.
+ * @get_color: Getter for the #Led:color property.
+ * @get_function: Getter for the #Led:function property.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link>.
+ */
+
+typedef LedIface LedInterface;
+G_DEFINE_INTERFACE (Led, led, G_TYPE_OBJECT);
+
+static void
+led_default_init (LedIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * Led::handle-set-on:
+ * @object: A #Led.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Led.setOn">setOn()</link> 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 led_complete_set_on() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-on",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (LedIface, handle_set_on),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * Led::handle-set-off:
+ * @object: A #Led.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Led.setOff">setOff()</link> 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 led_complete_set_off() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-off",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (LedIface, handle_set_off),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * Led::handle-set-blink-slow:
+ * @object: A #Led.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Led.setBlinkSlow">setBlinkSlow()</link> 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 led_complete_set_blink_slow() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-blink-slow",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (LedIface, handle_set_blink_slow),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * Led::handle-set-blink-fast:
+ * @object: A #Led.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Led.setBlinkFast">setBlinkFast()</link> 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 led_complete_set_blink_fast() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-blink-fast",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (LedIface, handle_set_blink_fast),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * Led:color:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-Led.color">"color"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_int ("color", "color", "color", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * Led:function:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-Led.function">"function"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_string ("function", "function", "function", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * led_get_color: (skip)
+ * @object: A #Led.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-Led.color">"color"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gint
+led_get_color (Led *object)
+{
+ return LED_GET_IFACE (object)->get_color (object);
+}
+
+/**
+ * led_set_color: (skip)
+ * @object: A #Led.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-Led.color">"color"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+led_set_color (Led *object, gint value)
+{
+ g_object_set (G_OBJECT (object), "color", value, NULL);
+}
+
+/**
+ * led_get_function: (skip)
+ * @object: A #Led.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-Led.function">"function"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use led_dup_function() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
+ */
+const gchar *
+led_get_function (Led *object)
+{
+ return LED_GET_IFACE (object)->get_function (object);
+}
+
+/**
+ * led_dup_function: (skip)
+ * @object: A #Led.
+ *
+ * Gets a copy of the <link linkend="gdbus-property-org-openbmc-Led.function">"function"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
+ */
+gchar *
+led_dup_function (Led *object)
+{
+ gchar *value;
+ g_object_get (G_OBJECT (object), "function", &value, NULL);
+ return value;
+}
+
+/**
+ * led_set_function: (skip)
+ * @object: A #Led.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-Led.function">"function"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+led_set_function (Led *object, const gchar *value)
+{
+ g_object_set (G_OBJECT (object), "function", value, NULL);
+}
+
+/**
+ * led_call_set_on:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setOn">setOn()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call led_call_set_on_finish() to get the result of the operation.
+ *
+ * See led_call_set_on_sync() for the synchronous, blocking version of this method.
+ */
+void
+led_call_set_on (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "setOn",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * led_call_set_on_finish:
+ * @proxy: A #LedProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to led_call_set_on().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with led_call_set_on().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_on_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_on_sync:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setOn">setOn()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See led_call_set_on() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_on_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "setOn",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_off:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setOff">setOff()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call led_call_set_off_finish() to get the result of the operation.
+ *
+ * See led_call_set_off_sync() for the synchronous, blocking version of this method.
+ */
+void
+led_call_set_off (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "setOff",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * led_call_set_off_finish:
+ * @proxy: A #LedProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to led_call_set_off().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with led_call_set_off().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_off_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_off_sync:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setOff">setOff()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See led_call_set_off() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_off_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "setOff",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_blink_slow:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setBlinkSlow">setBlinkSlow()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call led_call_set_blink_slow_finish() to get the result of the operation.
+ *
+ * See led_call_set_blink_slow_sync() for the synchronous, blocking version of this method.
+ */
+void
+led_call_set_blink_slow (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "setBlinkSlow",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * led_call_set_blink_slow_finish:
+ * @proxy: A #LedProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to led_call_set_blink_slow().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with led_call_set_blink_slow().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_blink_slow_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_blink_slow_sync:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setBlinkSlow">setBlinkSlow()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See led_call_set_blink_slow() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_blink_slow_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "setBlinkSlow",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_blink_fast:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setBlinkFast">setBlinkFast()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call led_call_set_blink_fast_finish() to get the result of the operation.
+ *
+ * See led_call_set_blink_fast_sync() for the synchronous, blocking version of this method.
+ */
+void
+led_call_set_blink_fast (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "setBlinkFast",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * led_call_set_blink_fast_finish:
+ * @proxy: A #LedProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to led_call_set_blink_fast().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with led_call_set_blink_fast().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_blink_fast_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_call_set_blink_fast_sync:
+ * @proxy: A #LedProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Led.setBlinkFast">setBlinkFast()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See led_call_set_blink_fast() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+led_call_set_blink_fast_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "setBlinkFast",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * led_complete_set_on:
+ * @object: A #Led.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Led.setOn">setOn()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+led_complete_set_on (
+ Led *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * led_complete_set_off:
+ * @object: A #Led.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Led.setOff">setOff()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+led_complete_set_off (
+ Led *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * led_complete_set_blink_slow:
+ * @object: A #Led.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Led.setBlinkSlow">setBlinkSlow()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+led_complete_set_blink_slow (
+ Led *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * led_complete_set_blink_fast:
+ * @object: A #Led.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Led.setBlinkFast">setBlinkFast()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+led_complete_set_blink_fast (
+ Led *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * LedProxy:
+ *
+ * The #LedProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * LedProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #LedProxy.
+ */
+
+struct _LedProxyPrivate
+{
+ GData *qdata;
+};
+
+static void led_proxy_iface_init (LedIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (LedProxy, led_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (LedProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_LED, led_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (LedProxy, led_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_LED, led_proxy_iface_init));
+
+#endif
+static void
+led_proxy_finalize (GObject *object)
+{
+ LedProxy *proxy = LED_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (led_proxy_parent_class)->finalize (object);
+}
+
+static void
+led_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _led_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+led_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.Led: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+led_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _led_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.Led", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) led_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+led_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_led_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_LED);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_LED);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+led_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ LedProxy *proxy = LED_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_led_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_led_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static gint
+led_proxy_get_color (Led *object)
+{
+ LedProxy *proxy = LED_PROXY (object);
+ GVariant *variant;
+ gint value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "color");
+ if (variant != NULL)
+ {
+ value = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static const gchar *
+led_proxy_get_function (Led *object)
+{
+ LedProxy *proxy = LED_PROXY (object);
+ GVariant *variant;
+ const gchar *value = NULL;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "function");
+ if (variant != NULL)
+ {
+ value = g_variant_get_string (variant, NULL);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+led_proxy_init (LedProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = led_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_LED_PROXY, LedProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), led_interface_info ());
+}
+
+static void
+led_proxy_class_init (LedProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = led_proxy_finalize;
+ gobject_class->get_property = led_proxy_get_property;
+ gobject_class->set_property = led_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = led_proxy_g_signal;
+ proxy_class->g_properties_changed = led_proxy_g_properties_changed;
+
+ led_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (LedProxyPrivate));
+#endif
+}
+
+static void
+led_proxy_iface_init (LedIface *iface)
+{
+ iface->get_color = led_proxy_get_color;
+ iface->get_function = led_proxy_get_function;
+}
+
+/**
+ * led_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call led_proxy_new_finish() to get the result of the operation.
+ *
+ * See led_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+led_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_LED_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.Led", NULL);
+}
+
+/**
+ * led_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to led_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with led_proxy_new().
+ *
+ * Returns: (transfer full) (type LedProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Led *
+led_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return LED (ret);
+ else
+ return NULL;
+}
+
+/**
+ * led_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See led_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type LedProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Led *
+led_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_LED_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.Led", NULL);
+ if (ret != NULL)
+ return LED (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * led_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like led_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call led_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See led_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+led_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_LED_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.Led", NULL);
+}
+
+/**
+ * led_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to led_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with led_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type LedProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Led *
+led_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return LED (ret);
+ else
+ return NULL;
+}
+
+/**
+ * led_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like led_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See led_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type LedProxy): The constructed proxy object or %NULL if @error is set.
+ */
+Led *
+led_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_LED_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.Led", NULL);
+ if (ret != NULL)
+ return LED (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * LedSkeleton:
+ *
+ * The #LedSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * LedSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #LedSkeleton.
+ */
+
+struct _LedSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_led_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ LedSkeleton *skeleton = LED_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_LED);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_LED);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_led_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ LedSkeleton *skeleton = LED_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_led_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_led_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ LedSkeleton *skeleton = LED_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_led_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _led_skeleton_vtable =
+{
+ _led_skeleton_handle_method_call,
+ _led_skeleton_handle_get_property,
+ _led_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+led_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return led_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+led_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_led_skeleton_vtable;
+}
+
+static GVariant *
+led_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ LedSkeleton *skeleton = LED_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_led_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _led_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _led_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _led_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.Led", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _led_emit_changed (gpointer user_data);
+
+static void
+led_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ LedSkeleton *skeleton = LED_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _led_emit_changed (skeleton);
+}
+
+static void led_skeleton_iface_init (LedIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (LedSkeleton, led_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (LedSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_LED, led_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (LedSkeleton, led_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_LED, led_skeleton_iface_init));
+
+#endif
+static void
+led_skeleton_finalize (GObject *object)
+{
+ LedSkeleton *skeleton = LED_SKELETON (object);
+ guint n;
+ for (n = 0; n < 2; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (led_skeleton_parent_class)->finalize (object);
+}
+
+static void
+led_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ LedSkeleton *skeleton = LED_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_led_emit_changed (gpointer user_data)
+{
+ LedSkeleton *skeleton = LED_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.Led",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_led_schedule_emit_changed (LedSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+led_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ LedSkeleton *skeleton = LED_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _led_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+led_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ LedSkeleton *skeleton = LED_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _led_schedule_emit_changed (skeleton, _led_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+led_skeleton_init (LedSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = led_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_LED_SKELETON, LedSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 2);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_INT);
+ g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
+}
+
+static gint
+led_skeleton_get_color (Led *object)
+{
+ LedSkeleton *skeleton = LED_SKELETON (object);
+ gint value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_int (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static const gchar *
+led_skeleton_get_function (Led *object)
+{
+ LedSkeleton *skeleton = LED_SKELETON (object);
+ const gchar *value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_string (&(skeleton->priv->properties[1]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+led_skeleton_class_init (LedSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = led_skeleton_finalize;
+ gobject_class->get_property = led_skeleton_get_property;
+ gobject_class->set_property = led_skeleton_set_property;
+ gobject_class->notify = led_skeleton_notify;
+
+
+ led_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = led_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = led_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = led_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = led_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (LedSkeletonPrivate));
+#endif
+}
+
+static void
+led_skeleton_iface_init (LedIface *iface)
+{
+ iface->get_color = led_skeleton_get_color;
+ iface->get_function = led_skeleton_get_function;
+}
+
+/**
+ * led_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link>.
+ *
+ * Returns: (transfer full) (type LedSkeleton): The skeleton object.
+ */
+Led *
+led_skeleton_new (void)
+{
+ return LED (g_object_new (TYPE_LED_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:led:
+ *
+ * The #Led instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("led", "led", "led", TYPE_LED, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_led:
+ * @object: A #Object.
+ *
+ * Gets the #Led instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #Led that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+Led *object_get_led (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Led");
+ if (ret == NULL)
+ return NULL;
+ return LED (ret);
+}
+
+
+/**
+ * object_peek_led: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_led() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #Led or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+Led *object_peek_led (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Led");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return LED (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Led");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "led");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_LED (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.Led");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Led");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "led");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_led:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #Led or %NULL to clear the interface.
+ *
+ * Sets the #Led instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-Led.top_of_page">org.openbmc.Led</link> on @object.
+ */
+void object_skeleton_set_led (ObjectSkeleton *object, Led *interface_)
+{
+ g_object_set (G_OBJECT (object), "led", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.Led", GSIZE_TO_POINTER (TYPE_LED_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/led.h b/interfaces/led.h
new file mode 100644
index 0000000..6fb7b70
--- /dev/null
+++ b/interfaces/led.h
@@ -0,0 +1,395 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_LED_H__
+#define __INTERFACES_LED_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.Led */
+
+#define TYPE_LED (led_get_type ())
+#define LED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_LED, Led))
+#define IS_LED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_LED))
+#define LED_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_LED, LedIface))
+
+struct _Led;
+typedef struct _Led Led;
+typedef struct _LedIface LedIface;
+
+struct _LedIface
+{
+ GTypeInterface parent_iface;
+
+
+ gboolean (*handle_set_blink_fast) (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_set_blink_slow) (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_set_off) (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_set_on) (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+ gint (*get_color) (Led *object);
+
+ const gchar * (*get_function) (Led *object);
+
+};
+
+GType led_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *led_interface_info (void);
+guint led_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void led_complete_set_on (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+void led_complete_set_off (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+void led_complete_set_blink_slow (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+void led_complete_set_blink_fast (
+ Led *object,
+ GDBusMethodInvocation *invocation);
+
+
+
+/* D-Bus method calls: */
+void led_call_set_on (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean led_call_set_on_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean led_call_set_on_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void led_call_set_off (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean led_call_set_off_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean led_call_set_off_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void led_call_set_blink_slow (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean led_call_set_blink_slow_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean led_call_set_blink_slow_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+void led_call_set_blink_fast (
+ Led *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean led_call_set_blink_fast_finish (
+ Led *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean led_call_set_blink_fast_sync (
+ Led *proxy,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+gint led_get_color (Led *object);
+void led_set_color (Led *object, gint value);
+
+const gchar *led_get_function (Led *object);
+gchar *led_dup_function (Led *object);
+void led_set_function (Led *object, const gchar *value);
+
+
+/* ---- */
+
+#define TYPE_LED_PROXY (led_proxy_get_type ())
+#define LED_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_LED_PROXY, LedProxy))
+#define LED_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_LED_PROXY, LedProxyClass))
+#define LED_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_LED_PROXY, LedProxyClass))
+#define IS_LED_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_LED_PROXY))
+#define IS_LED_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_LED_PROXY))
+
+typedef struct _LedProxy LedProxy;
+typedef struct _LedProxyClass LedProxyClass;
+typedef struct _LedProxyPrivate LedProxyPrivate;
+
+struct _LedProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ LedProxyPrivate *priv;
+};
+
+struct _LedProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType led_proxy_get_type (void) G_GNUC_CONST;
+
+void led_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+Led *led_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+Led *led_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void led_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+Led *led_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+Led *led_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_LED_SKELETON (led_skeleton_get_type ())
+#define LED_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_LED_SKELETON, LedSkeleton))
+#define LED_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_LED_SKELETON, LedSkeletonClass))
+#define LED_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_LED_SKELETON, LedSkeletonClass))
+#define IS_LED_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_LED_SKELETON))
+#define IS_LED_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_LED_SKELETON))
+
+typedef struct _LedSkeleton LedSkeleton;
+typedef struct _LedSkeletonClass LedSkeletonClass;
+typedef struct _LedSkeletonPrivate LedSkeletonPrivate;
+
+struct _LedSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ LedSkeletonPrivate *priv;
+};
+
+struct _LedSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType led_skeleton_get_type (void) G_GNUC_CONST;
+
+Led *led_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+Led *object_get_led (Object *object);
+Led *object_peek_led (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_led (ObjectSkeleton *object, Led *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_LED_H__ */
diff --git a/interfaces/power_control.c b/interfaces/power_control.c
new file mode 100644
index 0000000..ea1ce08
--- /dev/null
+++ b/interfaces/power_control.c
@@ -0,0 +1,2308 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/power_control.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.PowerControl
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:PowerControl
+ * @title: PowerControl
+ * @short_description: Generated C code for the org.openbmc.PowerControl D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.PowerControl ---- */
+
+static const _ExtendedGDBusArgInfo _power_control_method_info_set_power_state_IN_ARG_state =
+{
+ {
+ -1,
+ (gchar *) "state",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _power_control_method_info_set_power_state_IN_ARG_pointers[] =
+{
+ &_power_control_method_info_set_power_state_IN_ARG_state,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _power_control_method_info_set_power_state =
+{
+ {
+ -1,
+ (gchar *) "setPowerState",
+ (GDBusArgInfo **) &_power_control_method_info_set_power_state_IN_ARG_pointers,
+ NULL,
+ NULL
+ },
+ "handle-set-power-state",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _power_control_method_info_get_power_state_OUT_ARG_state =
+{
+ {
+ -1,
+ (gchar *) "state",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _power_control_method_info_get_power_state_OUT_ARG_pointers[] =
+{
+ &_power_control_method_info_get_power_state_OUT_ARG_state,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _power_control_method_info_get_power_state =
+{
+ {
+ -1,
+ (gchar *) "getPowerState",
+ NULL,
+ (GDBusArgInfo **) &_power_control_method_info_get_power_state_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-power-state",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _power_control_method_info_pointers[] =
+{
+ &_power_control_method_info_set_power_state,
+ &_power_control_method_info_get_power_state,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _power_control_signal_info_power_good =
+{
+ {
+ -1,
+ (gchar *) "PowerGood",
+ NULL,
+ NULL
+ },
+ "power-good"
+};
+
+static const _ExtendedGDBusSignalInfo _power_control_signal_info_power_lost =
+{
+ {
+ -1,
+ (gchar *) "PowerLost",
+ NULL,
+ NULL
+ },
+ "power-lost"
+};
+
+static const _ExtendedGDBusSignalInfo * const _power_control_signal_info_pointers[] =
+{
+ &_power_control_signal_info_power_good,
+ &_power_control_signal_info_power_lost,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _power_control_property_info_pgood =
+{
+ {
+ -1,
+ (gchar *) "pgood",
+ (gchar *) "i",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "pgood",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo _power_control_property_info_state =
+{
+ {
+ -1,
+ (gchar *) "state",
+ (gchar *) "i",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "state",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _power_control_property_info_pointers[] =
+{
+ &_power_control_property_info_pgood,
+ &_power_control_property_info_state,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _power_control_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.PowerControl",
+ (GDBusMethodInfo **) &_power_control_method_info_pointers,
+ (GDBusSignalInfo **) &_power_control_signal_info_pointers,
+ (GDBusPropertyInfo **) &_power_control_property_info_pointers,
+ NULL
+ },
+ "power-control",
+};
+
+
+/**
+ * power_control_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+power_control_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_power_control_interface_info.parent_struct;
+}
+
+/**
+ * power_control_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #PowerControl interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+power_control_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "pgood");
+ g_object_class_override_property (klass, property_id_begin++, "state");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * PowerControl:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link>.
+ */
+
+/**
+ * PowerControlIface:
+ * @parent_iface: The parent interface.
+ * @handle_get_power_state: Handler for the #PowerControl::handle-get-power-state signal.
+ * @handle_set_power_state: Handler for the #PowerControl::handle-set-power-state signal.
+ * @get_pgood: Getter for the #PowerControl:pgood property.
+ * @get_state: Getter for the #PowerControl:state property.
+ * @power_good: Handler for the #PowerControl::power-good signal.
+ * @power_lost: Handler for the #PowerControl::power-lost signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link>.
+ */
+
+typedef PowerControlIface PowerControlInterface;
+G_DEFINE_INTERFACE (PowerControl, power_control, G_TYPE_OBJECT);
+
+static void
+power_control_default_init (PowerControlIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * PowerControl::handle-set-power-state:
+ * @object: A #PowerControl.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_state: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-PowerControl.setPowerState">setPowerState()</link> 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 power_control_complete_set_power_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-power-state",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (PowerControlIface, handle_set_power_state),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT);
+
+ /**
+ * PowerControl::handle-get-power-state:
+ * @object: A #PowerControl.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-PowerControl.getPowerState">getPowerState()</link> 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 power_control_complete_get_power_state() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-power-state",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (PowerControlIface, handle_get_power_state),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * PowerControl::power-good:
+ * @object: A #PowerControl.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-PowerControl.PowerGood">"PowerGood"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("power-good",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (PowerControlIface, power_good),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+ /**
+ * PowerControl::power-lost:
+ * @object: A #PowerControl.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-PowerControl.PowerLost">"PowerLost"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("power-lost",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (PowerControlIface, power_lost),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 0);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * PowerControl:pgood:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-PowerControl.pgood">"pgood"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_int ("pgood", "pgood", "pgood", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PowerControl:state:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-PowerControl.state">"state"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_int ("state", "state", "state", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * power_control_get_pgood: (skip)
+ * @object: A #PowerControl.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-PowerControl.pgood">"pgood"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gint
+power_control_get_pgood (PowerControl *object)
+{
+ return POWER_CONTROL_GET_IFACE (object)->get_pgood (object);
+}
+
+/**
+ * power_control_set_pgood: (skip)
+ * @object: A #PowerControl.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-PowerControl.pgood">"pgood"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+power_control_set_pgood (PowerControl *object, gint value)
+{
+ g_object_set (G_OBJECT (object), "pgood", value, NULL);
+}
+
+/**
+ * power_control_get_state: (skip)
+ * @object: A #PowerControl.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-PowerControl.state">"state"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gint
+power_control_get_state (PowerControl *object)
+{
+ return POWER_CONTROL_GET_IFACE (object)->get_state (object);
+}
+
+/**
+ * power_control_set_state: (skip)
+ * @object: A #PowerControl.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-PowerControl.state">"state"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+power_control_set_state (PowerControl *object, gint value)
+{
+ g_object_set (G_OBJECT (object), "state", value, NULL);
+}
+
+/**
+ * power_control_emit_power_good:
+ * @object: A #PowerControl.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-PowerControl.PowerGood">"PowerGood"</link> D-Bus signal.
+ */
+void
+power_control_emit_power_good (
+ PowerControl *object)
+{
+ g_signal_emit_by_name (object, "power-good");
+}
+
+/**
+ * power_control_emit_power_lost:
+ * @object: A #PowerControl.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-PowerControl.PowerLost">"PowerLost"</link> D-Bus signal.
+ */
+void
+power_control_emit_power_lost (
+ PowerControl *object)
+{
+ g_signal_emit_by_name (object, "power-lost");
+}
+
+/**
+ * power_control_call_set_power_state:
+ * @proxy: A #PowerControlProxy.
+ * @arg_state: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-PowerControl.setPowerState">setPowerState()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call power_control_call_set_power_state_finish() to get the result of the operation.
+ *
+ * See power_control_call_set_power_state_sync() for the synchronous, blocking version of this method.
+ */
+void
+power_control_call_set_power_state (
+ PowerControl *proxy,
+ gint arg_state,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "setPowerState",
+ g_variant_new ("(i)",
+ arg_state),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * power_control_call_set_power_state_finish:
+ * @proxy: A #PowerControlProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to power_control_call_set_power_state().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with power_control_call_set_power_state().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+power_control_call_set_power_state_finish (
+ PowerControl *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * power_control_call_set_power_state_sync:
+ * @proxy: A #PowerControlProxy.
+ * @arg_state: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-PowerControl.setPowerState">setPowerState()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See power_control_call_set_power_state() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+power_control_call_set_power_state_sync (
+ PowerControl *proxy,
+ gint arg_state,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "setPowerState",
+ g_variant_new ("(i)",
+ arg_state),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * power_control_call_get_power_state:
+ * @proxy: A #PowerControlProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-PowerControl.getPowerState">getPowerState()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call power_control_call_get_power_state_finish() to get the result of the operation.
+ *
+ * See power_control_call_get_power_state_sync() for the synchronous, blocking version of this method.
+ */
+void
+power_control_call_get_power_state (
+ PowerControl *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getPowerState",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * power_control_call_get_power_state_finish:
+ * @proxy: A #PowerControlProxy.
+ * @out_state: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to power_control_call_get_power_state().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with power_control_call_get_power_state().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+power_control_call_get_power_state_finish (
+ PowerControl *proxy,
+ gint *out_state,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_state);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * power_control_call_get_power_state_sync:
+ * @proxy: A #PowerControlProxy.
+ * @out_state: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-PowerControl.getPowerState">getPowerState()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See power_control_call_get_power_state() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+power_control_call_get_power_state_sync (
+ PowerControl *proxy,
+ gint *out_state,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getPowerState",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_state);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * power_control_complete_set_power_state:
+ * @object: A #PowerControl.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-PowerControl.setPowerState">setPowerState()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+power_control_complete_set_power_state (
+ PowerControl *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * power_control_complete_get_power_state:
+ * @object: A #PowerControl.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @state: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-PowerControl.getPowerState">getPowerState()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+power_control_complete_get_power_state (
+ PowerControl *object,
+ GDBusMethodInvocation *invocation,
+ gint state)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ state));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * PowerControlProxy:
+ *
+ * The #PowerControlProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * PowerControlProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #PowerControlProxy.
+ */
+
+struct _PowerControlProxyPrivate
+{
+ GData *qdata;
+};
+
+static void power_control_proxy_iface_init (PowerControlIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (PowerControlProxy, power_control_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (PowerControlProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_POWER_CONTROL, power_control_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (PowerControlProxy, power_control_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_POWER_CONTROL, power_control_proxy_iface_init));
+
+#endif
+static void
+power_control_proxy_finalize (GObject *object)
+{
+ PowerControlProxy *proxy = POWER_CONTROL_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (power_control_proxy_parent_class)->finalize (object);
+}
+
+static void
+power_control_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _power_control_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+power_control_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.PowerControl: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+power_control_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _power_control_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.PowerControl", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) power_control_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+power_control_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_power_control_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_POWER_CONTROL);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_POWER_CONTROL);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+power_control_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ PowerControlProxy *proxy = POWER_CONTROL_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_power_control_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_power_control_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static gint
+power_control_proxy_get_pgood (PowerControl *object)
+{
+ PowerControlProxy *proxy = POWER_CONTROL_PROXY (object);
+ GVariant *variant;
+ gint value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "pgood");
+ if (variant != NULL)
+ {
+ value = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static gint
+power_control_proxy_get_state (PowerControl *object)
+{
+ PowerControlProxy *proxy = POWER_CONTROL_PROXY (object);
+ GVariant *variant;
+ gint value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "state");
+ if (variant != NULL)
+ {
+ value = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+power_control_proxy_init (PowerControlProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = power_control_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_POWER_CONTROL_PROXY, PowerControlProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), power_control_interface_info ());
+}
+
+static void
+power_control_proxy_class_init (PowerControlProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = power_control_proxy_finalize;
+ gobject_class->get_property = power_control_proxy_get_property;
+ gobject_class->set_property = power_control_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = power_control_proxy_g_signal;
+ proxy_class->g_properties_changed = power_control_proxy_g_properties_changed;
+
+ power_control_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (PowerControlProxyPrivate));
+#endif
+}
+
+static void
+power_control_proxy_iface_init (PowerControlIface *iface)
+{
+ iface->get_pgood = power_control_proxy_get_pgood;
+ iface->get_state = power_control_proxy_get_state;
+}
+
+/**
+ * power_control_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call power_control_proxy_new_finish() to get the result of the operation.
+ *
+ * See power_control_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+power_control_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_POWER_CONTROL_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.PowerControl", NULL);
+}
+
+/**
+ * power_control_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to power_control_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with power_control_proxy_new().
+ *
+ * Returns: (transfer full) (type PowerControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+PowerControl *
+power_control_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return POWER_CONTROL (ret);
+ else
+ return NULL;
+}
+
+/**
+ * power_control_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See power_control_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type PowerControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+PowerControl *
+power_control_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_POWER_CONTROL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.PowerControl", NULL);
+ if (ret != NULL)
+ return POWER_CONTROL (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * power_control_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like power_control_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call power_control_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See power_control_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+power_control_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_POWER_CONTROL_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.PowerControl", NULL);
+}
+
+/**
+ * power_control_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to power_control_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with power_control_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type PowerControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+PowerControl *
+power_control_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return POWER_CONTROL (ret);
+ else
+ return NULL;
+}
+
+/**
+ * power_control_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like power_control_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See power_control_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type PowerControlProxy): The constructed proxy object or %NULL if @error is set.
+ */
+PowerControl *
+power_control_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_POWER_CONTROL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.PowerControl", NULL);
+ if (ret != NULL)
+ return POWER_CONTROL (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * PowerControlSkeleton:
+ *
+ * The #PowerControlSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * PowerControlSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #PowerControlSkeleton.
+ */
+
+struct _PowerControlSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_power_control_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_POWER_CONTROL);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_POWER_CONTROL);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_power_control_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_power_control_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_power_control_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_power_control_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _power_control_skeleton_vtable =
+{
+ _power_control_skeleton_handle_method_call,
+ _power_control_skeleton_handle_get_property,
+ _power_control_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+power_control_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return power_control_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+power_control_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_power_control_skeleton_vtable;
+}
+
+static GVariant *
+power_control_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_power_control_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _power_control_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _power_control_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _power_control_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.PowerControl", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _power_control_emit_changed (gpointer user_data);
+
+static void
+power_control_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _power_control_emit_changed (skeleton);
+}
+
+static void
+_power_control_on_signal_power_good (
+ PowerControl *object)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.PowerControl", "PowerGood",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void
+_power_control_on_signal_power_lost (
+ PowerControl *object)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("()"));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.PowerControl", "PowerLost",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void power_control_skeleton_iface_init (PowerControlIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (PowerControlSkeleton, power_control_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (PowerControlSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_POWER_CONTROL, power_control_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (PowerControlSkeleton, power_control_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_POWER_CONTROL, power_control_skeleton_iface_init));
+
+#endif
+static void
+power_control_skeleton_finalize (GObject *object)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+ guint n;
+ for (n = 0; n < 2; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (power_control_skeleton_parent_class)->finalize (object);
+}
+
+static void
+power_control_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_power_control_emit_changed (gpointer user_data)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.PowerControl",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_power_control_schedule_emit_changed (PowerControlSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+power_control_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _power_control_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+power_control_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _power_control_schedule_emit_changed (skeleton, _power_control_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+power_control_skeleton_init (PowerControlSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = power_control_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_POWER_CONTROL_SKELETON, PowerControlSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 2);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_INT);
+ g_value_init (&skeleton->priv->properties[1], G_TYPE_INT);
+}
+
+static gint
+power_control_skeleton_get_pgood (PowerControl *object)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+ gint value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_int (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static gint
+power_control_skeleton_get_state (PowerControl *object)
+{
+ PowerControlSkeleton *skeleton = POWER_CONTROL_SKELETON (object);
+ gint value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_int (&(skeleton->priv->properties[1]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+power_control_skeleton_class_init (PowerControlSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = power_control_skeleton_finalize;
+ gobject_class->get_property = power_control_skeleton_get_property;
+ gobject_class->set_property = power_control_skeleton_set_property;
+ gobject_class->notify = power_control_skeleton_notify;
+
+
+ power_control_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = power_control_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = power_control_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = power_control_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = power_control_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (PowerControlSkeletonPrivate));
+#endif
+}
+
+static void
+power_control_skeleton_iface_init (PowerControlIface *iface)
+{
+ iface->power_good = _power_control_on_signal_power_good;
+ iface->power_lost = _power_control_on_signal_power_lost;
+ iface->get_pgood = power_control_skeleton_get_pgood;
+ iface->get_state = power_control_skeleton_get_state;
+}
+
+/**
+ * power_control_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link>.
+ *
+ * Returns: (transfer full) (type PowerControlSkeleton): The skeleton object.
+ */
+PowerControl *
+power_control_skeleton_new (void)
+{
+ return POWER_CONTROL (g_object_new (TYPE_POWER_CONTROL_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:power-control:
+ *
+ * The #PowerControl instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("power-control", "power-control", "power-control", TYPE_POWER_CONTROL, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_power_control:
+ * @object: A #Object.
+ *
+ * Gets the #PowerControl instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #PowerControl that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+PowerControl *object_get_power_control (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.PowerControl");
+ if (ret == NULL)
+ return NULL;
+ return POWER_CONTROL (ret);
+}
+
+
+/**
+ * object_peek_power_control: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_power_control() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #PowerControl or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+PowerControl *object_peek_power_control (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.PowerControl");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return POWER_CONTROL (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.PowerControl");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "power-control");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_POWER_CONTROL (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.PowerControl");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.PowerControl");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "power-control");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_power_control:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #PowerControl or %NULL to clear the interface.
+ *
+ * Sets the #PowerControl instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-PowerControl.top_of_page">org.openbmc.PowerControl</link> on @object.
+ */
+void object_skeleton_set_power_control (ObjectSkeleton *object, PowerControl *interface_)
+{
+ g_object_set (G_OBJECT (object), "power-control", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.PowerControl", GSIZE_TO_POINTER (TYPE_POWER_CONTROL_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/power_control.h b/interfaces/power_control.h
new file mode 100644
index 0000000..1d2f748
--- /dev/null
+++ b/interfaces/power_control.h
@@ -0,0 +1,368 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_POWER_CONTROL_H__
+#define __INTERFACES_POWER_CONTROL_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.PowerControl */
+
+#define TYPE_POWER_CONTROL (power_control_get_type ())
+#define POWER_CONTROL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_POWER_CONTROL, PowerControl))
+#define IS_POWER_CONTROL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_POWER_CONTROL))
+#define POWER_CONTROL_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_POWER_CONTROL, PowerControlIface))
+
+struct _PowerControl;
+typedef struct _PowerControl PowerControl;
+typedef struct _PowerControlIface PowerControlIface;
+
+struct _PowerControlIface
+{
+ GTypeInterface parent_iface;
+
+
+
+ gboolean (*handle_get_power_state) (
+ PowerControl *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_set_power_state) (
+ PowerControl *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_state);
+
+ gint (*get_pgood) (PowerControl *object);
+
+ gint (*get_state) (PowerControl *object);
+
+ void (*power_good) (
+ PowerControl *object);
+
+ void (*power_lost) (
+ PowerControl *object);
+
+};
+
+GType power_control_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *power_control_interface_info (void);
+guint power_control_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void power_control_complete_set_power_state (
+ PowerControl *object,
+ GDBusMethodInvocation *invocation);
+
+void power_control_complete_get_power_state (
+ PowerControl *object,
+ GDBusMethodInvocation *invocation,
+ gint state);
+
+
+
+/* D-Bus signal emissions functions: */
+void power_control_emit_power_good (
+ PowerControl *object);
+
+void power_control_emit_power_lost (
+ PowerControl *object);
+
+
+
+/* D-Bus method calls: */
+void power_control_call_set_power_state (
+ PowerControl *proxy,
+ gint arg_state,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean power_control_call_set_power_state_finish (
+ PowerControl *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean power_control_call_set_power_state_sync (
+ PowerControl *proxy,
+ gint arg_state,
+ GCancellable *cancellable,
+ GError **error);
+
+void power_control_call_get_power_state (
+ PowerControl *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean power_control_call_get_power_state_finish (
+ PowerControl *proxy,
+ gint *out_state,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean power_control_call_get_power_state_sync (
+ PowerControl *proxy,
+ gint *out_state,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+gint power_control_get_pgood (PowerControl *object);
+void power_control_set_pgood (PowerControl *object, gint value);
+
+gint power_control_get_state (PowerControl *object);
+void power_control_set_state (PowerControl *object, gint value);
+
+
+/* ---- */
+
+#define TYPE_POWER_CONTROL_PROXY (power_control_proxy_get_type ())
+#define POWER_CONTROL_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_POWER_CONTROL_PROXY, PowerControlProxy))
+#define POWER_CONTROL_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_POWER_CONTROL_PROXY, PowerControlProxyClass))
+#define POWER_CONTROL_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_POWER_CONTROL_PROXY, PowerControlProxyClass))
+#define IS_POWER_CONTROL_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_POWER_CONTROL_PROXY))
+#define IS_POWER_CONTROL_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_POWER_CONTROL_PROXY))
+
+typedef struct _PowerControlProxy PowerControlProxy;
+typedef struct _PowerControlProxyClass PowerControlProxyClass;
+typedef struct _PowerControlProxyPrivate PowerControlProxyPrivate;
+
+struct _PowerControlProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ PowerControlProxyPrivate *priv;
+};
+
+struct _PowerControlProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType power_control_proxy_get_type (void) G_GNUC_CONST;
+
+void power_control_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+PowerControl *power_control_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+PowerControl *power_control_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void power_control_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+PowerControl *power_control_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+PowerControl *power_control_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_POWER_CONTROL_SKELETON (power_control_skeleton_get_type ())
+#define POWER_CONTROL_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_POWER_CONTROL_SKELETON, PowerControlSkeleton))
+#define POWER_CONTROL_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_POWER_CONTROL_SKELETON, PowerControlSkeletonClass))
+#define POWER_CONTROL_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_POWER_CONTROL_SKELETON, PowerControlSkeletonClass))
+#define IS_POWER_CONTROL_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_POWER_CONTROL_SKELETON))
+#define IS_POWER_CONTROL_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_POWER_CONTROL_SKELETON))
+
+typedef struct _PowerControlSkeleton PowerControlSkeleton;
+typedef struct _PowerControlSkeletonClass PowerControlSkeletonClass;
+typedef struct _PowerControlSkeletonPrivate PowerControlSkeletonPrivate;
+
+struct _PowerControlSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ PowerControlSkeletonPrivate *priv;
+};
+
+struct _PowerControlSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType power_control_skeleton_get_type (void) G_GNUC_CONST;
+
+PowerControl *power_control_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+PowerControl *object_get_power_control (Object *object);
+PowerControl *object_peek_power_control (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_power_control (ObjectSkeleton *object, PowerControl *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_POWER_CONTROL_H__ */
diff --git a/interfaces/sensor.c b/interfaces/sensor.c
new file mode 100644
index 0000000..6898f44
--- /dev/null
+++ b/interfaces/sensor.c
@@ -0,0 +1,5766 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "interfaces/sensor.h"
+
+#include <string.h>
+#ifdef G_OS_UNIX
+# include <gio/gunixfdlist.h>
+#endif
+
+typedef struct
+{
+ GDBusArgInfo parent_struct;
+ gboolean use_gvariant;
+} _ExtendedGDBusArgInfo;
+
+typedef struct
+{
+ GDBusMethodInfo parent_struct;
+ const gchar *signal_name;
+ gboolean pass_fdlist;
+} _ExtendedGDBusMethodInfo;
+
+typedef struct
+{
+ GDBusSignalInfo parent_struct;
+ const gchar *signal_name;
+} _ExtendedGDBusSignalInfo;
+
+typedef struct
+{
+ GDBusPropertyInfo parent_struct;
+ const gchar *hyphen_name;
+ gboolean use_gvariant;
+} _ExtendedGDBusPropertyInfo;
+
+typedef struct
+{
+ GDBusInterfaceInfo parent_struct;
+ const gchar *hyphen_name;
+} _ExtendedGDBusInterfaceInfo;
+
+typedef struct
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ guint prop_id;
+ GValue orig_value; /* the value before the change */
+} ChangedProperty;
+
+static void
+_changed_property_free (ChangedProperty *data)
+{
+ g_value_unset (&data->orig_value);
+ g_free (data);
+}
+
+static gboolean
+_g_strv_equal0 (gchar **a, gchar **b)
+{
+ gboolean ret = FALSE;
+ guint n;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ if (g_strv_length (a) != g_strv_length (b))
+ goto out;
+ for (n = 0; a[n] != NULL; n++)
+ if (g_strcmp0 (a[n], b[n]) != 0)
+ goto out;
+ ret = TRUE;
+out:
+ return ret;
+}
+
+static gboolean
+_g_variant_equal0 (GVariant *a, GVariant *b)
+{
+ gboolean ret = FALSE;
+ if (a == NULL && b == NULL)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ if (a == NULL || b == NULL)
+ goto out;
+ ret = g_variant_equal (a, b);
+out:
+ return ret;
+}
+
+G_GNUC_UNUSED static gboolean
+_g_value_equal (const GValue *a, const GValue *b)
+{
+ gboolean ret = FALSE;
+ g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
+ switch (G_VALUE_TYPE (a))
+ {
+ case G_TYPE_BOOLEAN:
+ ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
+ break;
+ case G_TYPE_UCHAR:
+ ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
+ break;
+ case G_TYPE_INT:
+ ret = (g_value_get_int (a) == g_value_get_int (b));
+ break;
+ case G_TYPE_UINT:
+ ret = (g_value_get_uint (a) == g_value_get_uint (b));
+ break;
+ case G_TYPE_INT64:
+ ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
+ break;
+ case G_TYPE_UINT64:
+ ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
+ break;
+ case G_TYPE_DOUBLE:
+ {
+ /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
+ gdouble da = g_value_get_double (a);
+ gdouble db = g_value_get_double (b);
+ ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
+ }
+ break;
+ case G_TYPE_STRING:
+ ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
+ break;
+ case G_TYPE_VARIANT:
+ ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
+ break;
+ default:
+ if (G_VALUE_TYPE (a) == G_TYPE_STRV)
+ ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
+ else
+ g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
+ break;
+ }
+ return ret;
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.SensorInteger
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:SensorInteger
+ * @title: SensorInteger
+ * @short_description: Generated C code for the org.openbmc.SensorInteger D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.SensorInteger ---- */
+
+static const _ExtendedGDBusArgInfo _sensor_integer_method_info_get_value_OUT_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_method_info_get_value_OUT_ARG_pointers[] =
+{
+ &_sensor_integer_method_info_get_value_OUT_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_integer_method_info_get_value =
+{
+ {
+ -1,
+ (gchar *) "getValue",
+ NULL,
+ (GDBusArgInfo **) &_sensor_integer_method_info_get_value_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-value",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _sensor_integer_method_info_get_units_OUT_ARG_units =
+{
+ {
+ -1,
+ (gchar *) "units",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_method_info_get_units_OUT_ARG_pointers[] =
+{
+ &_sensor_integer_method_info_get_units_OUT_ARG_units,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_integer_method_info_get_units =
+{
+ {
+ -1,
+ (gchar *) "getUnits",
+ NULL,
+ (GDBusArgInfo **) &_sensor_integer_method_info_get_units_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-units",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _sensor_integer_method_info_pointers[] =
+{
+ &_sensor_integer_method_info_get_value,
+ &_sensor_integer_method_info_get_units,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _sensor_integer_signal_info_changed_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_signal_info_changed_ARG_pointers[] =
+{
+ &_sensor_integer_signal_info_changed_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _sensor_integer_signal_info_changed =
+{
+ {
+ -1,
+ (gchar *) "Changed",
+ (GDBusArgInfo **) &_sensor_integer_signal_info_changed_ARG_pointers,
+ NULL
+ },
+ "changed"
+};
+
+static const _ExtendedGDBusSignalInfo * const _sensor_integer_signal_info_pointers[] =
+{
+ &_sensor_integer_signal_info_changed,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _sensor_integer_property_info_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "value",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo _sensor_integer_property_info_units =
+{
+ {
+ -1,
+ (gchar *) "units",
+ (gchar *) "s",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "units",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _sensor_integer_property_info_pointers[] =
+{
+ &_sensor_integer_property_info_value,
+ &_sensor_integer_property_info_units,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _sensor_integer_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.SensorInteger",
+ (GDBusMethodInfo **) &_sensor_integer_method_info_pointers,
+ (GDBusSignalInfo **) &_sensor_integer_signal_info_pointers,
+ (GDBusPropertyInfo **) &_sensor_integer_property_info_pointers,
+ NULL
+ },
+ "sensor-integer",
+};
+
+
+/**
+ * sensor_integer_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+sensor_integer_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_sensor_integer_interface_info.parent_struct;
+}
+
+/**
+ * sensor_integer_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #SensorInteger interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+sensor_integer_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "value");
+ g_object_class_override_property (klass, property_id_begin++, "units");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * SensorInteger:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link>.
+ */
+
+/**
+ * SensorIntegerIface:
+ * @parent_iface: The parent interface.
+ * @handle_get_units: Handler for the #SensorInteger::handle-get-units signal.
+ * @handle_get_value: Handler for the #SensorInteger::handle-get-value signal.
+ * @get_units: Getter for the #SensorInteger:units property.
+ * @get_value: Getter for the #SensorInteger:value property.
+ * @changed: Handler for the #SensorInteger::changed signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link>.
+ */
+
+typedef SensorIntegerIface SensorIntegerInterface;
+G_DEFINE_INTERFACE (SensorInteger, sensor_integer, G_TYPE_OBJECT);
+
+static void
+sensor_integer_default_init (SensorIntegerIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * SensorInteger::handle-get-value:
+ * @object: A #SensorInteger.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorInteger.getValue">getValue()</link> 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 sensor_integer_complete_get_value() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-value",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerIface, handle_get_value),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * SensorInteger::handle-get-units:
+ * @object: A #SensorInteger.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorInteger.getUnits">getUnits()</link> 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 sensor_integer_complete_get_units() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-units",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerIface, handle_get_units),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * SensorInteger::changed:
+ * @object: A #SensorInteger.
+ * @arg_value: Argument.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-SensorInteger.Changed">"Changed"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("changed",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerIface, changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 1, G_TYPE_INT);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * SensorInteger:value:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorInteger.value">"value"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_int ("value", "value", "value", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * SensorInteger:units:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorInteger.units">"units"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_string ("units", "units", "units", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * sensor_integer_get_value: (skip)
+ * @object: A #SensorInteger.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorInteger.value">"value"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gint
+sensor_integer_get_value (SensorInteger *object)
+{
+ return SENSOR_INTEGER_GET_IFACE (object)->get_value (object);
+}
+
+/**
+ * sensor_integer_set_value: (skip)
+ * @object: A #SensorInteger.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-SensorInteger.value">"value"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+sensor_integer_set_value (SensorInteger *object, gint value)
+{
+ g_object_set (G_OBJECT (object), "value", value, NULL);
+}
+
+/**
+ * sensor_integer_get_units: (skip)
+ * @object: A #SensorInteger.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorInteger.units">"units"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use sensor_integer_dup_units() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
+ */
+const gchar *
+sensor_integer_get_units (SensorInteger *object)
+{
+ return SENSOR_INTEGER_GET_IFACE (object)->get_units (object);
+}
+
+/**
+ * sensor_integer_dup_units: (skip)
+ * @object: A #SensorInteger.
+ *
+ * Gets a copy of the <link linkend="gdbus-property-org-openbmc-SensorInteger.units">"units"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
+ */
+gchar *
+sensor_integer_dup_units (SensorInteger *object)
+{
+ gchar *value;
+ g_object_get (G_OBJECT (object), "units", &value, NULL);
+ return value;
+}
+
+/**
+ * sensor_integer_set_units: (skip)
+ * @object: A #SensorInteger.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-SensorInteger.units">"units"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+sensor_integer_set_units (SensorInteger *object, const gchar *value)
+{
+ g_object_set (G_OBJECT (object), "units", value, NULL);
+}
+
+/**
+ * sensor_integer_emit_changed:
+ * @object: A #SensorInteger.
+ * @arg_value: Argument to pass with the signal.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-SensorInteger.Changed">"Changed"</link> D-Bus signal.
+ */
+void
+sensor_integer_emit_changed (
+ SensorInteger *object,
+ gint arg_value)
+{
+ g_signal_emit_by_name (object, "changed", arg_value);
+}
+
+/**
+ * sensor_integer_call_get_value:
+ * @proxy: A #SensorIntegerProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorInteger.getValue">getValue()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_call_get_value_finish() to get the result of the operation.
+ *
+ * See sensor_integer_call_get_value_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_integer_call_get_value (
+ SensorInteger *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getValue",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_integer_call_get_value_finish:
+ * @proxy: A #SensorIntegerProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_call_get_value().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_integer_call_get_value().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_call_get_value_finish (
+ SensorInteger *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_call_get_value_sync:
+ * @proxy: A #SensorIntegerProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorInteger.getValue">getValue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_call_get_value() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_call_get_value_sync (
+ SensorInteger *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getValue",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_call_get_units:
+ * @proxy: A #SensorIntegerProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorInteger.getUnits">getUnits()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_call_get_units_finish() to get the result of the operation.
+ *
+ * See sensor_integer_call_get_units_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_integer_call_get_units (
+ SensorInteger *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getUnits",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_integer_call_get_units_finish:
+ * @proxy: A #SensorIntegerProxy.
+ * @out_units: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_call_get_units().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_integer_call_get_units().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_call_get_units_finish (
+ SensorInteger *proxy,
+ gchar **out_units,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_units);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_call_get_units_sync:
+ * @proxy: A #SensorIntegerProxy.
+ * @out_units: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorInteger.getUnits">getUnits()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_call_get_units() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_call_get_units_sync (
+ SensorInteger *proxy,
+ gchar **out_units,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getUnits",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_units);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_complete_get_value:
+ * @object: A #SensorInteger.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @value: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorInteger.getValue">getValue()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_integer_complete_get_value (
+ SensorInteger *object,
+ GDBusMethodInvocation *invocation,
+ gint value)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ value));
+}
+
+/**
+ * sensor_integer_complete_get_units:
+ * @object: A #SensorInteger.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @units: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorInteger.getUnits">getUnits()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_integer_complete_get_units (
+ SensorInteger *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *units)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(s)",
+ units));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * SensorIntegerProxy:
+ *
+ * The #SensorIntegerProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * SensorIntegerProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #SensorIntegerProxy.
+ */
+
+struct _SensorIntegerProxyPrivate
+{
+ GData *qdata;
+};
+
+static void sensor_integer_proxy_iface_init (SensorIntegerIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerProxy, sensor_integer_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (SensorIntegerProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER, sensor_integer_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerProxy, sensor_integer_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER, sensor_integer_proxy_iface_init));
+
+#endif
+static void
+sensor_integer_proxy_finalize (GObject *object)
+{
+ SensorIntegerProxy *proxy = SENSOR_INTEGER_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (sensor_integer_proxy_parent_class)->finalize (object);
+}
+
+static void
+sensor_integer_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _sensor_integer_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+sensor_integer_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.SensorInteger: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+sensor_integer_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _sensor_integer_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.SensorInteger", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) sensor_integer_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+sensor_integer_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sensor_integer_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_SENSOR_INTEGER);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_INTEGER);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+sensor_integer_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ SensorIntegerProxy *proxy = SENSOR_INTEGER_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static gint
+sensor_integer_proxy_get_value (SensorInteger *object)
+{
+ SensorIntegerProxy *proxy = SENSOR_INTEGER_PROXY (object);
+ GVariant *variant;
+ gint value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "value");
+ if (variant != NULL)
+ {
+ value = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static const gchar *
+sensor_integer_proxy_get_units (SensorInteger *object)
+{
+ SensorIntegerProxy *proxy = SENSOR_INTEGER_PROXY (object);
+ GVariant *variant;
+ const gchar *value = NULL;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "units");
+ if (variant != NULL)
+ {
+ value = g_variant_get_string (variant, NULL);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+sensor_integer_proxy_init (SensorIntegerProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = sensor_integer_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SENSOR_INTEGER_PROXY, SensorIntegerProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sensor_integer_interface_info ());
+}
+
+static void
+sensor_integer_proxy_class_init (SensorIntegerProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = sensor_integer_proxy_finalize;
+ gobject_class->get_property = sensor_integer_proxy_get_property;
+ gobject_class->set_property = sensor_integer_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = sensor_integer_proxy_g_signal;
+ proxy_class->g_properties_changed = sensor_integer_proxy_g_properties_changed;
+
+ sensor_integer_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (SensorIntegerProxyPrivate));
+#endif
+}
+
+static void
+sensor_integer_proxy_iface_init (SensorIntegerIface *iface)
+{
+ iface->get_value = sensor_integer_proxy_get_value;
+ iface->get_units = sensor_integer_proxy_get_units;
+}
+
+/**
+ * sensor_integer_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_proxy_new_finish() to get the result of the operation.
+ *
+ * See sensor_integer_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+sensor_integer_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_SENSOR_INTEGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorInteger", NULL);
+}
+
+/**
+ * sensor_integer_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with sensor_integer_proxy_new().
+ *
+ * Returns: (transfer full) (type SensorIntegerProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorInteger *
+sensor_integer_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return SENSOR_INTEGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * sensor_integer_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type SensorIntegerProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorInteger *
+sensor_integer_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_SENSOR_INTEGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorInteger", NULL);
+ if (ret != NULL)
+ return SENSOR_INTEGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * sensor_integer_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like sensor_integer_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See sensor_integer_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+sensor_integer_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_SENSOR_INTEGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorInteger", NULL);
+}
+
+/**
+ * sensor_integer_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with sensor_integer_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type SensorIntegerProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorInteger *
+sensor_integer_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return SENSOR_INTEGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * sensor_integer_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like sensor_integer_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type SensorIntegerProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorInteger *
+sensor_integer_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_SENSOR_INTEGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorInteger", NULL);
+ if (ret != NULL)
+ return SENSOR_INTEGER (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * SensorIntegerSkeleton:
+ *
+ * The #SensorIntegerSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * SensorIntegerSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #SensorIntegerSkeleton.
+ */
+
+struct _SensorIntegerSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_sensor_integer_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_SENSOR_INTEGER);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_INTEGER);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_sensor_integer_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_sensor_integer_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _sensor_integer_skeleton_vtable =
+{
+ _sensor_integer_skeleton_handle_method_call,
+ _sensor_integer_skeleton_handle_get_property,
+ _sensor_integer_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+sensor_integer_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return sensor_integer_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+sensor_integer_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_sensor_integer_skeleton_vtable;
+}
+
+static GVariant *
+sensor_integer_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_sensor_integer_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _sensor_integer_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _sensor_integer_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _sensor_integer_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorInteger", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _sensor_integer_emit_changed (gpointer user_data);
+
+static void
+sensor_integer_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _sensor_integer_emit_changed (skeleton);
+}
+
+static void
+_sensor_integer_on_signal_changed (
+ SensorInteger *object,
+ gint arg_value)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("(i)",
+ arg_value));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorInteger", "Changed",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void sensor_integer_skeleton_iface_init (SensorIntegerIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerSkeleton, sensor_integer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (SensorIntegerSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER, sensor_integer_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerSkeleton, sensor_integer_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER, sensor_integer_skeleton_iface_init));
+
+#endif
+static void
+sensor_integer_skeleton_finalize (GObject *object)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+ guint n;
+ for (n = 0; n < 2; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (sensor_integer_skeleton_parent_class)->finalize (object);
+}
+
+static void
+sensor_integer_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_sensor_integer_emit_changed (gpointer user_data)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.SensorInteger",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_sensor_integer_schedule_emit_changed (SensorIntegerSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+sensor_integer_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _sensor_integer_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+sensor_integer_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _sensor_integer_schedule_emit_changed (skeleton, _sensor_integer_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+sensor_integer_skeleton_init (SensorIntegerSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = sensor_integer_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SENSOR_INTEGER_SKELETON, SensorIntegerSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 2);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_INT);
+ g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
+}
+
+static gint
+sensor_integer_skeleton_get_value (SensorInteger *object)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+ gint value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_int (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static const gchar *
+sensor_integer_skeleton_get_units (SensorInteger *object)
+{
+ SensorIntegerSkeleton *skeleton = SENSOR_INTEGER_SKELETON (object);
+ const gchar *value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_string (&(skeleton->priv->properties[1]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+sensor_integer_skeleton_class_init (SensorIntegerSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = sensor_integer_skeleton_finalize;
+ gobject_class->get_property = sensor_integer_skeleton_get_property;
+ gobject_class->set_property = sensor_integer_skeleton_set_property;
+ gobject_class->notify = sensor_integer_skeleton_notify;
+
+
+ sensor_integer_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = sensor_integer_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = sensor_integer_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = sensor_integer_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = sensor_integer_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (SensorIntegerSkeletonPrivate));
+#endif
+}
+
+static void
+sensor_integer_skeleton_iface_init (SensorIntegerIface *iface)
+{
+ iface->changed = _sensor_integer_on_signal_changed;
+ iface->get_value = sensor_integer_skeleton_get_value;
+ iface->get_units = sensor_integer_skeleton_get_units;
+}
+
+/**
+ * sensor_integer_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link>.
+ *
+ * Returns: (transfer full) (type SensorIntegerSkeleton): The skeleton object.
+ */
+SensorInteger *
+sensor_integer_skeleton_new (void)
+{
+ return SENSOR_INTEGER (g_object_new (TYPE_SENSOR_INTEGER_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.SensorString
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:SensorString
+ * @title: SensorString
+ * @short_description: Generated C code for the org.openbmc.SensorString D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.SensorString ---- */
+
+static const _ExtendedGDBusArgInfo _sensor_string_method_info_get_value_OUT_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_string_method_info_get_value_OUT_ARG_pointers[] =
+{
+ &_sensor_string_method_info_get_value_OUT_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_string_method_info_get_value =
+{
+ {
+ -1,
+ (gchar *) "getValue",
+ NULL,
+ (GDBusArgInfo **) &_sensor_string_method_info_get_value_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-value",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _sensor_string_method_info_get_units_OUT_ARG_units =
+{
+ {
+ -1,
+ (gchar *) "units",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_string_method_info_get_units_OUT_ARG_pointers[] =
+{
+ &_sensor_string_method_info_get_units_OUT_ARG_units,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_string_method_info_get_units =
+{
+ {
+ -1,
+ (gchar *) "getUnits",
+ NULL,
+ (GDBusArgInfo **) &_sensor_string_method_info_get_units_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-units",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _sensor_string_method_info_pointers[] =
+{
+ &_sensor_string_method_info_get_value,
+ &_sensor_string_method_info_get_units,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _sensor_string_signal_info_changed_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_string_signal_info_changed_ARG_pointers[] =
+{
+ &_sensor_string_signal_info_changed_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _sensor_string_signal_info_changed =
+{
+ {
+ -1,
+ (gchar *) "Changed",
+ (GDBusArgInfo **) &_sensor_string_signal_info_changed_ARG_pointers,
+ NULL
+ },
+ "changed"
+};
+
+static const _ExtendedGDBusSignalInfo * const _sensor_string_signal_info_pointers[] =
+{
+ &_sensor_string_signal_info_changed,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _sensor_string_property_info_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "value",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo _sensor_string_property_info_units =
+{
+ {
+ -1,
+ (gchar *) "units",
+ (gchar *) "s",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "units",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _sensor_string_property_info_pointers[] =
+{
+ &_sensor_string_property_info_value,
+ &_sensor_string_property_info_units,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _sensor_string_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.SensorString",
+ (GDBusMethodInfo **) &_sensor_string_method_info_pointers,
+ (GDBusSignalInfo **) &_sensor_string_signal_info_pointers,
+ (GDBusPropertyInfo **) &_sensor_string_property_info_pointers,
+ NULL
+ },
+ "sensor-string",
+};
+
+
+/**
+ * sensor_string_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+sensor_string_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_sensor_string_interface_info.parent_struct;
+}
+
+/**
+ * sensor_string_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #SensorString interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+sensor_string_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "value");
+ g_object_class_override_property (klass, property_id_begin++, "units");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * SensorString:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link>.
+ */
+
+/**
+ * SensorStringIface:
+ * @parent_iface: The parent interface.
+ * @handle_get_units: Handler for the #SensorString::handle-get-units signal.
+ * @handle_get_value: Handler for the #SensorString::handle-get-value signal.
+ * @get_units: Getter for the #SensorString:units property.
+ * @get_value: Getter for the #SensorString:value property.
+ * @changed: Handler for the #SensorString::changed signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link>.
+ */
+
+typedef SensorStringIface SensorStringInterface;
+G_DEFINE_INTERFACE (SensorString, sensor_string, G_TYPE_OBJECT);
+
+static void
+sensor_string_default_init (SensorStringIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * SensorString::handle-get-value:
+ * @object: A #SensorString.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorString.getValue">getValue()</link> 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 sensor_string_complete_get_value() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-value",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorStringIface, handle_get_value),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * SensorString::handle-get-units:
+ * @object: A #SensorString.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorString.getUnits">getUnits()</link> 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 sensor_string_complete_get_units() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-units",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorStringIface, handle_get_units),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * SensorString::changed:
+ * @object: A #SensorString.
+ * @arg_value: Argument.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-SensorString.Changed">"Changed"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("changed",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorStringIface, changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 1, G_TYPE_STRING);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * SensorString:value:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorString.value">"value"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_int ("value", "value", "value", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * SensorString:units:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorString.units">"units"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_string ("units", "units", "units", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * sensor_string_get_value: (skip)
+ * @object: A #SensorString.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorString.value">"value"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gint
+sensor_string_get_value (SensorString *object)
+{
+ return SENSOR_STRING_GET_IFACE (object)->get_value (object);
+}
+
+/**
+ * sensor_string_set_value: (skip)
+ * @object: A #SensorString.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-SensorString.value">"value"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+sensor_string_set_value (SensorString *object, gint value)
+{
+ g_object_set (G_OBJECT (object), "value", value, NULL);
+}
+
+/**
+ * sensor_string_get_units: (skip)
+ * @object: A #SensorString.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorString.units">"units"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use sensor_string_dup_units() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
+ */
+const gchar *
+sensor_string_get_units (SensorString *object)
+{
+ return SENSOR_STRING_GET_IFACE (object)->get_units (object);
+}
+
+/**
+ * sensor_string_dup_units: (skip)
+ * @object: A #SensorString.
+ *
+ * Gets a copy of the <link linkend="gdbus-property-org-openbmc-SensorString.units">"units"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
+ */
+gchar *
+sensor_string_dup_units (SensorString *object)
+{
+ gchar *value;
+ g_object_get (G_OBJECT (object), "units", &value, NULL);
+ return value;
+}
+
+/**
+ * sensor_string_set_units: (skip)
+ * @object: A #SensorString.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-SensorString.units">"units"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+sensor_string_set_units (SensorString *object, const gchar *value)
+{
+ g_object_set (G_OBJECT (object), "units", value, NULL);
+}
+
+/**
+ * sensor_string_emit_changed:
+ * @object: A #SensorString.
+ * @arg_value: Argument to pass with the signal.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-SensorString.Changed">"Changed"</link> D-Bus signal.
+ */
+void
+sensor_string_emit_changed (
+ SensorString *object,
+ const gchar *arg_value)
+{
+ g_signal_emit_by_name (object, "changed", arg_value);
+}
+
+/**
+ * sensor_string_call_get_value:
+ * @proxy: A #SensorStringProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorString.getValue">getValue()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_string_call_get_value_finish() to get the result of the operation.
+ *
+ * See sensor_string_call_get_value_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_string_call_get_value (
+ SensorString *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getValue",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_string_call_get_value_finish:
+ * @proxy: A #SensorStringProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_string_call_get_value().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_string_call_get_value().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_string_call_get_value_finish (
+ SensorString *proxy,
+ gchar **out_value,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_string_call_get_value_sync:
+ * @proxy: A #SensorStringProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorString.getValue">getValue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_string_call_get_value() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_string_call_get_value_sync (
+ SensorString *proxy,
+ gchar **out_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getValue",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_string_call_get_units:
+ * @proxy: A #SensorStringProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorString.getUnits">getUnits()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_string_call_get_units_finish() to get the result of the operation.
+ *
+ * See sensor_string_call_get_units_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_string_call_get_units (
+ SensorString *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getUnits",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_string_call_get_units_finish:
+ * @proxy: A #SensorStringProxy.
+ * @out_units: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_string_call_get_units().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_string_call_get_units().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_string_call_get_units_finish (
+ SensorString *proxy,
+ gchar **out_units,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_units);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_string_call_get_units_sync:
+ * @proxy: A #SensorStringProxy.
+ * @out_units: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorString.getUnits">getUnits()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_string_call_get_units() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_string_call_get_units_sync (
+ SensorString *proxy,
+ gchar **out_units,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getUnits",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_units);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_string_complete_get_value:
+ * @object: A #SensorString.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @value: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorString.getValue">getValue()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_string_complete_get_value (
+ SensorString *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *value)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(s)",
+ value));
+}
+
+/**
+ * sensor_string_complete_get_units:
+ * @object: A #SensorString.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @units: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorString.getUnits">getUnits()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_string_complete_get_units (
+ SensorString *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *units)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(s)",
+ units));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * SensorStringProxy:
+ *
+ * The #SensorStringProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * SensorStringProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #SensorStringProxy.
+ */
+
+struct _SensorStringProxyPrivate
+{
+ GData *qdata;
+};
+
+static void sensor_string_proxy_iface_init (SensorStringIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (SensorStringProxy, sensor_string_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (SensorStringProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_STRING, sensor_string_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (SensorStringProxy, sensor_string_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_STRING, sensor_string_proxy_iface_init));
+
+#endif
+static void
+sensor_string_proxy_finalize (GObject *object)
+{
+ SensorStringProxy *proxy = SENSOR_STRING_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (sensor_string_proxy_parent_class)->finalize (object);
+}
+
+static void
+sensor_string_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _sensor_string_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+sensor_string_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.SensorString: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+sensor_string_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _sensor_string_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.SensorString", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) sensor_string_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+sensor_string_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sensor_string_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_SENSOR_STRING);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_STRING);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+sensor_string_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ SensorStringProxy *proxy = SENSOR_STRING_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_string_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_string_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static gint
+sensor_string_proxy_get_value (SensorString *object)
+{
+ SensorStringProxy *proxy = SENSOR_STRING_PROXY (object);
+ GVariant *variant;
+ gint value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "value");
+ if (variant != NULL)
+ {
+ value = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static const gchar *
+sensor_string_proxy_get_units (SensorString *object)
+{
+ SensorStringProxy *proxy = SENSOR_STRING_PROXY (object);
+ GVariant *variant;
+ const gchar *value = NULL;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "units");
+ if (variant != NULL)
+ {
+ value = g_variant_get_string (variant, NULL);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+sensor_string_proxy_init (SensorStringProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = sensor_string_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SENSOR_STRING_PROXY, SensorStringProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sensor_string_interface_info ());
+}
+
+static void
+sensor_string_proxy_class_init (SensorStringProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = sensor_string_proxy_finalize;
+ gobject_class->get_property = sensor_string_proxy_get_property;
+ gobject_class->set_property = sensor_string_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = sensor_string_proxy_g_signal;
+ proxy_class->g_properties_changed = sensor_string_proxy_g_properties_changed;
+
+ sensor_string_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (SensorStringProxyPrivate));
+#endif
+}
+
+static void
+sensor_string_proxy_iface_init (SensorStringIface *iface)
+{
+ iface->get_value = sensor_string_proxy_get_value;
+ iface->get_units = sensor_string_proxy_get_units;
+}
+
+/**
+ * sensor_string_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_string_proxy_new_finish() to get the result of the operation.
+ *
+ * See sensor_string_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+sensor_string_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_SENSOR_STRING_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorString", NULL);
+}
+
+/**
+ * sensor_string_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_string_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with sensor_string_proxy_new().
+ *
+ * Returns: (transfer full) (type SensorStringProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorString *
+sensor_string_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return SENSOR_STRING (ret);
+ else
+ return NULL;
+}
+
+/**
+ * sensor_string_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See sensor_string_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type SensorStringProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorString *
+sensor_string_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_SENSOR_STRING_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorString", NULL);
+ if (ret != NULL)
+ return SENSOR_STRING (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * sensor_string_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like sensor_string_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_string_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See sensor_string_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+sensor_string_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_SENSOR_STRING_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorString", NULL);
+}
+
+/**
+ * sensor_string_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_string_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with sensor_string_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type SensorStringProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorString *
+sensor_string_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return SENSOR_STRING (ret);
+ else
+ return NULL;
+}
+
+/**
+ * sensor_string_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like sensor_string_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See sensor_string_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type SensorStringProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorString *
+sensor_string_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_SENSOR_STRING_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorString", NULL);
+ if (ret != NULL)
+ return SENSOR_STRING (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * SensorStringSkeleton:
+ *
+ * The #SensorStringSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * SensorStringSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #SensorStringSkeleton.
+ */
+
+struct _SensorStringSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_sensor_string_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_SENSOR_STRING);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_STRING);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_sensor_string_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_string_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_sensor_string_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_string_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _sensor_string_skeleton_vtable =
+{
+ _sensor_string_skeleton_handle_method_call,
+ _sensor_string_skeleton_handle_get_property,
+ _sensor_string_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+sensor_string_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return sensor_string_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+sensor_string_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_sensor_string_skeleton_vtable;
+}
+
+static GVariant *
+sensor_string_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_sensor_string_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _sensor_string_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _sensor_string_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _sensor_string_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorString", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _sensor_string_emit_changed (gpointer user_data);
+
+static void
+sensor_string_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _sensor_string_emit_changed (skeleton);
+}
+
+static void
+_sensor_string_on_signal_changed (
+ SensorString *object,
+ const gchar *arg_value)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
+ arg_value));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorString", "Changed",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void sensor_string_skeleton_iface_init (SensorStringIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (SensorStringSkeleton, sensor_string_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (SensorStringSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_STRING, sensor_string_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (SensorStringSkeleton, sensor_string_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_STRING, sensor_string_skeleton_iface_init));
+
+#endif
+static void
+sensor_string_skeleton_finalize (GObject *object)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+ guint n;
+ for (n = 0; n < 2; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (sensor_string_skeleton_parent_class)->finalize (object);
+}
+
+static void
+sensor_string_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_sensor_string_emit_changed (gpointer user_data)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.SensorString",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_sensor_string_schedule_emit_changed (SensorStringSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+sensor_string_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _sensor_string_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+sensor_string_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _sensor_string_schedule_emit_changed (skeleton, _sensor_string_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+sensor_string_skeleton_init (SensorStringSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = sensor_string_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SENSOR_STRING_SKELETON, SensorStringSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 2);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_INT);
+ g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
+}
+
+static gint
+sensor_string_skeleton_get_value (SensorString *object)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+ gint value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_int (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static const gchar *
+sensor_string_skeleton_get_units (SensorString *object)
+{
+ SensorStringSkeleton *skeleton = SENSOR_STRING_SKELETON (object);
+ const gchar *value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_string (&(skeleton->priv->properties[1]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+sensor_string_skeleton_class_init (SensorStringSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = sensor_string_skeleton_finalize;
+ gobject_class->get_property = sensor_string_skeleton_get_property;
+ gobject_class->set_property = sensor_string_skeleton_set_property;
+ gobject_class->notify = sensor_string_skeleton_notify;
+
+
+ sensor_string_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = sensor_string_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = sensor_string_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = sensor_string_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = sensor_string_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (SensorStringSkeletonPrivate));
+#endif
+}
+
+static void
+sensor_string_skeleton_iface_init (SensorStringIface *iface)
+{
+ iface->changed = _sensor_string_on_signal_changed;
+ iface->get_value = sensor_string_skeleton_get_value;
+ iface->get_units = sensor_string_skeleton_get_units;
+}
+
+/**
+ * sensor_string_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link>.
+ *
+ * Returns: (transfer full) (type SensorStringSkeleton): The skeleton object.
+ */
+SensorString *
+sensor_string_skeleton_new (void)
+{
+ return SENSOR_STRING (g_object_new (TYPE_SENSOR_STRING_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for interface org.openbmc.SensorIntegerSettable
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:SensorIntegerSettable
+ * @title: SensorIntegerSettable
+ * @short_description: Generated C code for the org.openbmc.SensorIntegerSettable D-Bus interface
+ *
+ * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link> D-Bus interface in C.
+ */
+
+/* ---- Introspection data for org.openbmc.SensorIntegerSettable ---- */
+
+static const _ExtendedGDBusArgInfo _sensor_integer_settable_method_info_get_value_OUT_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_settable_method_info_get_value_OUT_ARG_pointers[] =
+{
+ &_sensor_integer_settable_method_info_get_value_OUT_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_integer_settable_method_info_get_value =
+{
+ {
+ -1,
+ (gchar *) "getValue",
+ NULL,
+ (GDBusArgInfo **) &_sensor_integer_settable_method_info_get_value_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-value",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _sensor_integer_settable_method_info_set_value_IN_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_settable_method_info_set_value_IN_ARG_pointers[] =
+{
+ &_sensor_integer_settable_method_info_set_value_IN_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_integer_settable_method_info_set_value =
+{
+ {
+ -1,
+ (gchar *) "setValue",
+ (GDBusArgInfo **) &_sensor_integer_settable_method_info_set_value_IN_ARG_pointers,
+ NULL,
+ NULL
+ },
+ "handle-set-value",
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo _sensor_integer_settable_method_info_get_units_OUT_ARG_units =
+{
+ {
+ -1,
+ (gchar *) "units",
+ (gchar *) "s",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_settable_method_info_get_units_OUT_ARG_pointers[] =
+{
+ &_sensor_integer_settable_method_info_get_units_OUT_ARG_units,
+ NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_integer_settable_method_info_get_units =
+{
+ {
+ -1,
+ (gchar *) "getUnits",
+ NULL,
+ (GDBusArgInfo **) &_sensor_integer_settable_method_info_get_units_OUT_ARG_pointers,
+ NULL
+ },
+ "handle-get-units",
+ FALSE
+};
+
+static const _ExtendedGDBusMethodInfo * const _sensor_integer_settable_method_info_pointers[] =
+{
+ &_sensor_integer_settable_method_info_get_value,
+ &_sensor_integer_settable_method_info_set_value,
+ &_sensor_integer_settable_method_info_get_units,
+ NULL
+};
+
+static const _ExtendedGDBusArgInfo _sensor_integer_settable_signal_info_changed_ARG_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ NULL
+ },
+ FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_integer_settable_signal_info_changed_ARG_pointers[] =
+{
+ &_sensor_integer_settable_signal_info_changed_ARG_value,
+ NULL
+};
+
+static const _ExtendedGDBusSignalInfo _sensor_integer_settable_signal_info_changed =
+{
+ {
+ -1,
+ (gchar *) "Changed",
+ (GDBusArgInfo **) &_sensor_integer_settable_signal_info_changed_ARG_pointers,
+ NULL
+ },
+ "changed"
+};
+
+static const _ExtendedGDBusSignalInfo * const _sensor_integer_settable_signal_info_pointers[] =
+{
+ &_sensor_integer_settable_signal_info_changed,
+ NULL
+};
+
+static const _ExtendedGDBusPropertyInfo _sensor_integer_settable_property_info_value =
+{
+ {
+ -1,
+ (gchar *) "value",
+ (gchar *) "i",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "value",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo _sensor_integer_settable_property_info_units =
+{
+ {
+ -1,
+ (gchar *) "units",
+ (gchar *) "s",
+ G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+ NULL
+ },
+ "units",
+ FALSE
+};
+
+static const _ExtendedGDBusPropertyInfo * const _sensor_integer_settable_property_info_pointers[] =
+{
+ &_sensor_integer_settable_property_info_value,
+ &_sensor_integer_settable_property_info_units,
+ NULL
+};
+
+static const _ExtendedGDBusInterfaceInfo _sensor_integer_settable_interface_info =
+{
+ {
+ -1,
+ (gchar *) "org.openbmc.SensorIntegerSettable",
+ (GDBusMethodInfo **) &_sensor_integer_settable_method_info_pointers,
+ (GDBusSignalInfo **) &_sensor_integer_settable_signal_info_pointers,
+ (GDBusPropertyInfo **) &_sensor_integer_settable_property_info_pointers,
+ NULL
+ },
+ "sensor-integer-settable",
+};
+
+
+/**
+ * sensor_integer_settable_interface_info:
+ *
+ * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link> D-Bus interface.
+ *
+ * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
+ */
+GDBusInterfaceInfo *
+sensor_integer_settable_interface_info (void)
+{
+ return (GDBusInterfaceInfo *) &_sensor_integer_settable_interface_info.parent_struct;
+}
+
+/**
+ * sensor_integer_settable_override_properties:
+ * @klass: The class structure for a #GObject<!-- -->-derived class.
+ * @property_id_begin: The property id to assign to the first overridden property.
+ *
+ * Overrides all #GObject properties in the #SensorIntegerSettable interface for a concrete class.
+ * The properties are overridden in the order they are defined.
+ *
+ * Returns: The last property id.
+ */
+guint
+sensor_integer_settable_override_properties (GObjectClass *klass, guint property_id_begin)
+{
+ g_object_class_override_property (klass, property_id_begin++, "value");
+ g_object_class_override_property (klass, property_id_begin++, "units");
+ return property_id_begin - 1;
+}
+
+
+
+/**
+ * SensorIntegerSettable:
+ *
+ * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link>.
+ */
+
+/**
+ * SensorIntegerSettableIface:
+ * @parent_iface: The parent interface.
+ * @handle_get_units: Handler for the #SensorIntegerSettable::handle-get-units signal.
+ * @handle_get_value: Handler for the #SensorIntegerSettable::handle-get-value signal.
+ * @handle_set_value: Handler for the #SensorIntegerSettable::handle-set-value signal.
+ * @get_units: Getter for the #SensorIntegerSettable:units property.
+ * @get_value: Getter for the #SensorIntegerSettable:value property.
+ * @changed: Handler for the #SensorIntegerSettable::changed signal.
+ *
+ * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link>.
+ */
+
+typedef SensorIntegerSettableIface SensorIntegerSettableInterface;
+G_DEFINE_INTERFACE (SensorIntegerSettable, sensor_integer_settable, G_TYPE_OBJECT);
+
+static void
+sensor_integer_settable_default_init (SensorIntegerSettableIface *iface)
+{
+ /* GObject signals for incoming D-Bus method calls: */
+ /**
+ * SensorIntegerSettable::handle-get-value:
+ * @object: A #SensorIntegerSettable.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getValue">getValue()</link> 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 sensor_integer_settable_complete_get_value() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-value",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerSettableIface, handle_get_value),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /**
+ * SensorIntegerSettable::handle-set-value:
+ * @object: A #SensorIntegerSettable.
+ * @invocation: A #GDBusMethodInvocation.
+ * @arg_value: Argument passed by remote caller.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.setValue">setValue()</link> 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 sensor_integer_settable_complete_set_value() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-set-value",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerSettableIface, handle_set_value),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_INT);
+
+ /**
+ * SensorIntegerSettable::handle-get-units:
+ * @object: A #SensorIntegerSettable.
+ * @invocation: A #GDBusMethodInvocation.
+ *
+ * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getUnits">getUnits()</link> 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 sensor_integer_settable_complete_get_units() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+ *
+ * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+ */
+ g_signal_new ("handle-get-units",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerSettableIface, handle_get_units),
+ g_signal_accumulator_true_handled,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
+
+ /* GObject signals for received D-Bus signals: */
+ /**
+ * SensorIntegerSettable::changed:
+ * @object: A #SensorIntegerSettable.
+ * @arg_value: Argument.
+ *
+ * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-openbmc-SensorIntegerSettable.Changed">"Changed"</link> is received.
+ *
+ * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
+ */
+ g_signal_new ("changed",
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SensorIntegerSettableIface, changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 1, G_TYPE_INT);
+
+ /* GObject properties for D-Bus properties: */
+ /**
+ * SensorIntegerSettable:value:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.value">"value"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_int ("value", "value", "value", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * SensorIntegerSettable:units:
+ *
+ * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.units">"units"</link>.
+ *
+ * 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.
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_string ("units", "units", "units", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+}
+
+/**
+ * sensor_integer_settable_get_value: (skip)
+ * @object: A #SensorIntegerSettable.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.value">"value"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: The property value.
+ */
+gint
+sensor_integer_settable_get_value (SensorIntegerSettable *object)
+{
+ return SENSOR_INTEGER_SETTABLE_GET_IFACE (object)->get_value (object);
+}
+
+/**
+ * sensor_integer_settable_set_value: (skip)
+ * @object: A #SensorIntegerSettable.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.value">"value"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+sensor_integer_settable_set_value (SensorIntegerSettable *object, gint value)
+{
+ g_object_set (G_OBJECT (object), "value", value, NULL);
+}
+
+/**
+ * sensor_integer_settable_get_units: (skip)
+ * @object: A #SensorIntegerSettable.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.units">"units"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use sensor_integer_settable_dup_units() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
+ */
+const gchar *
+sensor_integer_settable_get_units (SensorIntegerSettable *object)
+{
+ return SENSOR_INTEGER_SETTABLE_GET_IFACE (object)->get_units (object);
+}
+
+/**
+ * sensor_integer_settable_dup_units: (skip)
+ * @object: A #SensorIntegerSettable.
+ *
+ * Gets a copy of the <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.units">"units"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
+ */
+gchar *
+sensor_integer_settable_dup_units (SensorIntegerSettable *object)
+{
+ gchar *value;
+ g_object_get (G_OBJECT (object), "units", &value, NULL);
+ return value;
+}
+
+/**
+ * sensor_integer_settable_set_units: (skip)
+ * @object: A #SensorIntegerSettable.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-SensorIntegerSettable.units">"units"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+sensor_integer_settable_set_units (SensorIntegerSettable *object, const gchar *value)
+{
+ g_object_set (G_OBJECT (object), "units", value, NULL);
+}
+
+/**
+ * sensor_integer_settable_emit_changed:
+ * @object: A #SensorIntegerSettable.
+ * @arg_value: Argument to pass with the signal.
+ *
+ * Emits the <link linkend="gdbus-signal-org-openbmc-SensorIntegerSettable.Changed">"Changed"</link> D-Bus signal.
+ */
+void
+sensor_integer_settable_emit_changed (
+ SensorIntegerSettable *object,
+ gint arg_value)
+{
+ g_signal_emit_by_name (object, "changed", arg_value);
+}
+
+/**
+ * sensor_integer_settable_call_get_value:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getValue">getValue()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_settable_call_get_value_finish() to get the result of the operation.
+ *
+ * See sensor_integer_settable_call_get_value_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_integer_settable_call_get_value (
+ SensorIntegerSettable *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getValue",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_integer_settable_call_get_value_finish:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_settable_call_get_value().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_integer_settable_call_get_value().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_settable_call_get_value_finish (
+ SensorIntegerSettable *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_settable_call_get_value_sync:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @out_value: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getValue">getValue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_settable_call_get_value() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_settable_call_get_value_sync (
+ SensorIntegerSettable *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getValue",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(i)",
+ out_value);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_settable_call_set_value:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @arg_value: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.setValue">setValue()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_settable_call_set_value_finish() to get the result of the operation.
+ *
+ * See sensor_integer_settable_call_set_value_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_integer_settable_call_set_value (
+ SensorIntegerSettable *proxy,
+ gint arg_value,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "setValue",
+ g_variant_new ("(i)",
+ arg_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_integer_settable_call_set_value_finish:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_settable_call_set_value().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_integer_settable_call_set_value().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_settable_call_set_value_finish (
+ SensorIntegerSettable *proxy,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_settable_call_set_value_sync:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @arg_value: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.setValue">setValue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_settable_call_set_value() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_settable_call_set_value_sync (
+ SensorIntegerSettable *proxy,
+ gint arg_value,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "setValue",
+ g_variant_new ("(i)",
+ arg_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "()");
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_settable_call_get_units:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getUnits">getUnits()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_settable_call_get_units_finish() to get the result of the operation.
+ *
+ * See sensor_integer_settable_call_get_units_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_integer_settable_call_get_units (
+ SensorIntegerSettable *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+ "getUnits",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * sensor_integer_settable_call_get_units_finish:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @out_units: (out): Return location for return parameter or %NULL to ignore.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_settable_call_get_units().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_integer_settable_call_get_units().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_settable_call_get_units_finish (
+ SensorIntegerSettable *proxy,
+ gchar **out_units,
+ GAsyncResult *res,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_units);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_settable_call_get_units_sync:
+ * @proxy: A #SensorIntegerSettableProxy.
+ * @out_units: (out): Return location for return parameter or %NULL to ignore.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getUnits">getUnits()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_settable_call_get_units() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_integer_settable_call_get_units_sync (
+ SensorIntegerSettable *proxy,
+ gchar **out_units,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GVariant *_ret;
+ _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+ "getUnits",
+ g_variant_new ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ cancellable,
+ error);
+ if (_ret == NULL)
+ goto _out;
+ g_variant_get (_ret,
+ "(s)",
+ out_units);
+ g_variant_unref (_ret);
+_out:
+ return _ret != NULL;
+}
+
+/**
+ * sensor_integer_settable_complete_get_value:
+ * @object: A #SensorIntegerSettable.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @value: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getValue">getValue()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_integer_settable_complete_get_value (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation,
+ gint value)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(i)",
+ value));
+}
+
+/**
+ * sensor_integer_settable_complete_set_value:
+ * @object: A #SensorIntegerSettable.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.setValue">setValue()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_integer_settable_complete_set_value (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("()"));
+}
+
+/**
+ * sensor_integer_settable_complete_get_units:
+ * @object: A #SensorIntegerSettable.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ * @units: Parameter to return.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorIntegerSettable.getUnits">getUnits()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_integer_settable_complete_get_units (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *units)
+{
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("(s)",
+ units));
+}
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * SensorIntegerSettableProxy:
+ *
+ * The #SensorIntegerSettableProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * SensorIntegerSettableProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #SensorIntegerSettableProxy.
+ */
+
+struct _SensorIntegerSettableProxyPrivate
+{
+ GData *qdata;
+};
+
+static void sensor_integer_settable_proxy_iface_init (SensorIntegerSettableIface *iface);
+
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerSettableProxy, sensor_integer_settable_proxy, G_TYPE_DBUS_PROXY,
+ G_ADD_PRIVATE (SensorIntegerSettableProxy)
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER_SETTABLE, sensor_integer_settable_proxy_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerSettableProxy, sensor_integer_settable_proxy, G_TYPE_DBUS_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER_SETTABLE, sensor_integer_settable_proxy_iface_init));
+
+#endif
+static void
+sensor_integer_settable_proxy_finalize (GObject *object)
+{
+ SensorIntegerSettableProxy *proxy = SENSOR_INTEGER_SETTABLE_PROXY (object);
+ g_datalist_clear (&proxy->priv->qdata);
+ G_OBJECT_CLASS (sensor_integer_settable_proxy_parent_class)->finalize (object);
+}
+
+static void
+sensor_integer_settable_proxy_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _sensor_integer_settable_property_info_pointers[prop_id - 1];
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
+ if (info->use_gvariant)
+ {
+ g_value_set_variant (value, variant);
+ }
+ else
+ {
+ if (variant != NULL)
+ g_dbus_gvariant_to_gvalue (variant, value);
+ }
+ if (variant != NULL)
+ g_variant_unref (variant);
+}
+
+static void
+sensor_integer_settable_proxy_set_property_cb (GDBusProxy *proxy,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ const _ExtendedGDBusPropertyInfo *info = user_data;
+ GError *error;
+ GVariant *_ret;
+ error = NULL;
+ _ret = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!_ret)
+ {
+ g_warning ("Error setting property '%s' on interface org.openbmc.SensorIntegerSettable: %s (%s, %d)",
+ info->parent_struct.name,
+ error->message, g_quark_to_string (error->domain), error->code);
+ g_error_free (error);
+ }
+ else
+ {
+ g_variant_unref (_ret);
+ }
+}
+
+static void
+sensor_integer_settable_proxy_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ const _ExtendedGDBusPropertyInfo *info;
+ GVariant *variant;
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ info = _sensor_integer_settable_property_info_pointers[prop_id - 1];
+ variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_dbus_proxy_call (G_DBUS_PROXY (object),
+ "org.freedesktop.DBus.Properties.Set",
+ g_variant_new ("(ssv)", "org.openbmc.SensorIntegerSettable", info->parent_struct.name, variant),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL, (GAsyncReadyCallback) sensor_integer_settable_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
+ g_variant_unref (variant);
+}
+
+static void
+sensor_integer_settable_proxy_g_signal (GDBusProxy *proxy,
+ const gchar *sender_name G_GNUC_UNUSED,
+ const gchar *signal_name,
+ GVariant *parameters)
+{
+ _ExtendedGDBusSignalInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint n;
+ guint signal_id;
+ info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sensor_integer_settable_interface_info.parent_struct, signal_name);
+ if (info == NULL)
+ return;
+ num_params = g_variant_n_children (parameters);
+ paramv = g_new0 (GValue, num_params + 1);
+ g_value_init (¶mv[0], TYPE_SENSOR_INTEGER_SETTABLE);
+ g_value_set_object (¶mv[0], proxy);
+ g_variant_iter_init (&iter, parameters);
+ n = 1;
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_INTEGER_SETTABLE);
+ g_signal_emitv (paramv, signal_id, 0, NULL);
+ for (n = 0; n < num_params + 1; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static void
+sensor_integer_settable_proxy_g_properties_changed (GDBusProxy *_proxy,
+ GVariant *changed_properties,
+ const gchar *const *invalidated_properties)
+{
+ SensorIntegerSettableProxy *proxy = SENSOR_INTEGER_SETTABLE_PROXY (_proxy);
+ guint n;
+ const gchar *key;
+ GVariantIter *iter;
+ _ExtendedGDBusPropertyInfo *info;
+ g_variant_get (changed_properties, "a{sv}", &iter);
+ while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_settable_interface_info.parent_struct, key);
+ g_datalist_remove_data (&proxy->priv->qdata, key);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+ g_variant_iter_free (iter);
+ for (n = 0; invalidated_properties[n] != NULL; n++)
+ {
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_settable_interface_info.parent_struct, invalidated_properties[n]);
+ g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
+ if (info != NULL)
+ g_object_notify (G_OBJECT (proxy), info->hyphen_name);
+ }
+}
+
+static gint
+sensor_integer_settable_proxy_get_value (SensorIntegerSettable *object)
+{
+ SensorIntegerSettableProxy *proxy = SENSOR_INTEGER_SETTABLE_PROXY (object);
+ GVariant *variant;
+ gint value = 0;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "value");
+ if (variant != NULL)
+ {
+ value = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static const gchar *
+sensor_integer_settable_proxy_get_units (SensorIntegerSettable *object)
+{
+ SensorIntegerSettableProxy *proxy = SENSOR_INTEGER_SETTABLE_PROXY (object);
+ GVariant *variant;
+ const gchar *value = NULL;
+ variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "units");
+ if (variant != NULL)
+ {
+ value = g_variant_get_string (variant, NULL);
+ g_variant_unref (variant);
+ }
+ return value;
+}
+
+static void
+sensor_integer_settable_proxy_init (SensorIntegerSettableProxy *proxy)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ proxy->priv = sensor_integer_settable_proxy_get_instance_private (proxy);
+#else
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SENSOR_INTEGER_SETTABLE_PROXY, SensorIntegerSettableProxyPrivate);
+#endif
+
+ g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sensor_integer_settable_interface_info ());
+}
+
+static void
+sensor_integer_settable_proxy_class_init (SensorIntegerSettableProxyClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusProxyClass *proxy_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = sensor_integer_settable_proxy_finalize;
+ gobject_class->get_property = sensor_integer_settable_proxy_get_property;
+ gobject_class->set_property = sensor_integer_settable_proxy_set_property;
+
+ proxy_class = G_DBUS_PROXY_CLASS (klass);
+ proxy_class->g_signal = sensor_integer_settable_proxy_g_signal;
+ proxy_class->g_properties_changed = sensor_integer_settable_proxy_g_properties_changed;
+
+ sensor_integer_settable_override_properties (gobject_class, 1);
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (SensorIntegerSettableProxyPrivate));
+#endif
+}
+
+static void
+sensor_integer_settable_proxy_iface_init (SensorIntegerSettableIface *iface)
+{
+ iface->get_value = sensor_integer_settable_proxy_get_value;
+ iface->get_units = sensor_integer_settable_proxy_get_units;
+}
+
+/**
+ * sensor_integer_settable_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link>. See g_dbus_proxy_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_settable_proxy_new_finish() to get the result of the operation.
+ *
+ * See sensor_integer_settable_proxy_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+sensor_integer_settable_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_SENSOR_INTEGER_SETTABLE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIntegerSettable", NULL);
+}
+
+/**
+ * sensor_integer_settable_proxy_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_settable_proxy_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with sensor_integer_settable_proxy_new().
+ *
+ * Returns: (transfer full) (type SensorIntegerSettableProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorIntegerSettable *
+sensor_integer_settable_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return SENSOR_INTEGER_SETTABLE (ret);
+ else
+ return NULL;
+}
+
+/**
+ * sensor_integer_settable_proxy_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link>. See g_dbus_proxy_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_settable_proxy_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type SensorIntegerSettableProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorIntegerSettable *
+sensor_integer_settable_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_SENSOR_INTEGER_SETTABLE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIntegerSettable", NULL);
+ if (ret != NULL)
+ return SENSOR_INTEGER_SETTABLE (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * sensor_integer_settable_proxy_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like sensor_integer_settable_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_integer_settable_proxy_new_for_bus_finish() to get the result of the operation.
+ *
+ * See sensor_integer_settable_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+sensor_integer_settable_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_SENSOR_INTEGER_SETTABLE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIntegerSettable", NULL);
+}
+
+/**
+ * sensor_integer_settable_proxy_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_integer_settable_proxy_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with sensor_integer_settable_proxy_new_for_bus().
+ *
+ * Returns: (transfer full) (type SensorIntegerSettableProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorIntegerSettable *
+sensor_integer_settable_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return SENSOR_INTEGER_SETTABLE (ret);
+ else
+ return NULL;
+}
+
+/**
+ * sensor_integer_settable_proxy_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusProxyFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like sensor_integer_settable_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See sensor_integer_settable_proxy_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type SensorIntegerSettableProxy): The constructed proxy object or %NULL if @error is set.
+ */
+SensorIntegerSettable *
+sensor_integer_settable_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_SENSOR_INTEGER_SETTABLE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIntegerSettable", NULL);
+ if (ret != NULL)
+ return SENSOR_INTEGER_SETTABLE (ret);
+ else
+ return NULL;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
+/**
+ * SensorIntegerSettableSkeleton:
+ *
+ * The #SensorIntegerSettableSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * SensorIntegerSettableSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #SensorIntegerSettableSkeleton.
+ */
+
+struct _SensorIntegerSettableSkeletonPrivate
+{
+ GValue *properties;
+ GList *changed_properties;
+ GSource *changed_properties_idle_source;
+ GMainContext *context;
+ GMutex lock;
+};
+
+static void
+_sensor_integer_settable_skeleton_handle_method_call (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (user_data);
+ _ExtendedGDBusMethodInfo *info;
+ GVariantIter iter;
+ GVariant *child;
+ GValue *paramv;
+ guint num_params;
+ guint num_extra;
+ guint n;
+ guint signal_id;
+ GValue return_value = G_VALUE_INIT;
+ info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
+ g_assert (info != NULL);
+ num_params = g_variant_n_children (parameters);
+ num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
+ n = 0;
+ g_value_init (¶mv[n], TYPE_SENSOR_INTEGER_SETTABLE);
+ g_value_set_object (¶mv[n++], skeleton);
+ g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
+ g_value_set_object (¶mv[n++], invocation);
+ if (info->pass_fdlist)
+ {
+#ifdef G_OS_UNIX
+ g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
+ g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ g_variant_iter_init (&iter, parameters);
+ while ((child = g_variant_iter_next_value (&iter)) != NULL)
+ {
+ _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
+ if (arg_info->use_gvariant)
+ {
+ g_value_init (¶mv[n], G_TYPE_VARIANT);
+ g_value_set_variant (¶mv[n], child);
+ n++;
+ }
+ else
+ g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
+ g_variant_unref (child);
+ }
+ signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_INTEGER_SETTABLE);
+ g_value_init (&return_value, G_TYPE_BOOLEAN);
+ g_signal_emitv (paramv, signal_id, 0, &return_value);
+ if (!g_value_get_boolean (&return_value))
+ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
+ g_value_unset (&return_value);
+ for (n = 0; n < num_params + num_extra; n++)
+ g_value_unset (¶mv[n]);
+ g_free (paramv);
+}
+
+static GVariant *
+_sensor_integer_settable_skeleton_handle_get_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ GVariant *ret;
+ ret = NULL;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_settable_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ g_value_init (&value, pspec->value_type);
+ g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
+ g_value_unset (&value);
+ }
+ return ret;
+}
+
+static gboolean
+_sensor_integer_settable_skeleton_handle_set_property (
+ GDBusConnection *connection G_GNUC_UNUSED,
+ const gchar *sender G_GNUC_UNUSED,
+ const gchar *object_path G_GNUC_UNUSED,
+ const gchar *interface_name G_GNUC_UNUSED,
+ const gchar *property_name,
+ GVariant *variant,
+ GError **error,
+ gpointer user_data)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (user_data);
+ GValue value = G_VALUE_INIT;
+ GParamSpec *pspec;
+ _ExtendedGDBusPropertyInfo *info;
+ gboolean ret;
+ ret = FALSE;
+ info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_integer_settable_interface_info.parent_struct, property_name);
+ g_assert (info != NULL);
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
+ if (pspec == NULL)
+ {
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
+ }
+ else
+ {
+ if (info->use_gvariant)
+ g_value_set_variant (&value, variant);
+ else
+ g_dbus_gvariant_to_gvalue (variant, &value);
+ g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
+ g_value_unset (&value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+static const GDBusInterfaceVTable _sensor_integer_settable_skeleton_vtable =
+{
+ _sensor_integer_settable_skeleton_handle_method_call,
+ _sensor_integer_settable_skeleton_handle_get_property,
+ _sensor_integer_settable_skeleton_handle_set_property,
+ {NULL}
+};
+
+static GDBusInterfaceInfo *
+sensor_integer_settable_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return sensor_integer_settable_interface_info ();
+}
+
+static GDBusInterfaceVTable *
+sensor_integer_settable_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
+{
+ return (GDBusInterfaceVTable *) &_sensor_integer_settable_skeleton_vtable;
+}
+
+static GVariant *
+sensor_integer_settable_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (_skeleton);
+
+ GVariantBuilder builder;
+ guint n;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ if (_sensor_integer_settable_interface_info.parent_struct.properties == NULL)
+ goto out;
+ for (n = 0; _sensor_integer_settable_interface_info.parent_struct.properties[n] != NULL; n++)
+ {
+ GDBusPropertyInfo *info = _sensor_integer_settable_interface_info.parent_struct.properties[n];
+ if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
+ {
+ GVariant *value;
+ value = _sensor_integer_settable_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorIntegerSettable", info->name, NULL, skeleton);
+ if (value != NULL)
+ {
+ g_variant_take_ref (value);
+ g_variant_builder_add (&builder, "{sv}", info->name, value);
+ g_variant_unref (value);
+ }
+ }
+ }
+out:
+ return g_variant_builder_end (&builder);
+}
+
+static gboolean _sensor_integer_settable_emit_changed (gpointer user_data);
+
+static void
+sensor_integer_settable_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (_skeleton);
+ gboolean emit_changed = FALSE;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ {
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ skeleton->priv->changed_properties_idle_source = NULL;
+ emit_changed = TRUE;
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+
+ if (emit_changed)
+ _sensor_integer_settable_emit_changed (skeleton);
+}
+
+static void
+_sensor_integer_settable_on_signal_changed (
+ SensorIntegerSettable *object,
+ gint arg_value)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+
+ GList *connections, *l;
+ GVariant *signal_variant;
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+
+ signal_variant = g_variant_ref_sink (g_variant_new ("(i)",
+ arg_value));
+ for (l = connections; l != NULL; l = l->next)
+ {
+ GDBusConnection *connection = l->data;
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorIntegerSettable", "Changed",
+ signal_variant, NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+}
+
+static void sensor_integer_settable_skeleton_iface_init (SensorIntegerSettableIface *iface);
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerSettableSkeleton, sensor_integer_settable_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_ADD_PRIVATE (SensorIntegerSettableSkeleton)
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER_SETTABLE, sensor_integer_settable_skeleton_iface_init));
+
+#else
+G_DEFINE_TYPE_WITH_CODE (SensorIntegerSettableSkeleton, sensor_integer_settable_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_SENSOR_INTEGER_SETTABLE, sensor_integer_settable_skeleton_iface_init));
+
+#endif
+static void
+sensor_integer_settable_skeleton_finalize (GObject *object)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+ guint n;
+ for (n = 0; n < 2; n++)
+ g_value_unset (&skeleton->priv->properties[n]);
+ g_free (skeleton->priv->properties);
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ if (skeleton->priv->changed_properties_idle_source != NULL)
+ g_source_destroy (skeleton->priv->changed_properties_idle_source);
+ g_main_context_unref (skeleton->priv->context);
+ g_mutex_clear (&skeleton->priv->lock);
+ G_OBJECT_CLASS (sensor_integer_settable_skeleton_parent_class)->finalize (object);
+}
+
+static void
+sensor_integer_settable_skeleton_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static gboolean
+_sensor_integer_settable_emit_changed (gpointer user_data)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (user_data);
+ GList *l;
+ GVariantBuilder builder;
+ GVariantBuilder invalidated_builder;
+ guint num_changes;
+
+ g_mutex_lock (&skeleton->priv->lock);
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
+ for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
+ {
+ ChangedProperty *cp = l->data;
+ GVariant *variant;
+ const GValue *cur_value;
+
+ cur_value = &skeleton->priv->properties[cp->prop_id - 1];
+ if (!_g_value_equal (cur_value, &cp->orig_value))
+ {
+ variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
+ g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
+ g_variant_unref (variant);
+ num_changes++;
+ }
+ }
+ if (num_changes > 0)
+ {
+ GList *connections, *ll;
+ GVariant *signal_variant;
+ signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.SensorIntegerSettable",
+ &builder, &invalidated_builder));
+ connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
+ for (ll = connections; ll != NULL; ll = ll->next)
+ {
+ GDBusConnection *connection = ll->data;
+
+ g_dbus_connection_emit_signal (connection,
+ NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
+ "org.freedesktop.DBus.Properties",
+ "PropertiesChanged",
+ signal_variant,
+ NULL);
+ }
+ g_variant_unref (signal_variant);
+ g_list_free_full (connections, g_object_unref);
+ }
+ else
+ {
+ g_variant_builder_clear (&builder);
+ g_variant_builder_clear (&invalidated_builder);
+ }
+ g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
+ skeleton->priv->changed_properties = NULL;
+ skeleton->priv->changed_properties_idle_source = NULL;
+ g_mutex_unlock (&skeleton->priv->lock);
+ return FALSE;
+}
+
+static void
+_sensor_integer_settable_schedule_emit_changed (SensorIntegerSettableSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
+{
+ ChangedProperty *cp;
+ GList *l;
+ cp = NULL;
+ for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
+ {
+ ChangedProperty *i_cp = l->data;
+ if (i_cp->info == info)
+ {
+ cp = i_cp;
+ break;
+ }
+ }
+ if (cp == NULL)
+ {
+ cp = g_new0 (ChangedProperty, 1);
+ cp->prop_id = prop_id;
+ cp->info = info;
+ skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
+ g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
+ g_value_copy (orig_value, &cp->orig_value);
+ }
+}
+
+static void
+sensor_integer_settable_skeleton_notify (GObject *object,
+ GParamSpec *pspec G_GNUC_UNUSED)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+ g_mutex_lock (&skeleton->priv->lock);
+ if (skeleton->priv->changed_properties != NULL &&
+ skeleton->priv->changed_properties_idle_source == NULL)
+ {
+ skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
+ g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (skeleton->priv->changed_properties_idle_source, _sensor_integer_settable_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
+ g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
+ g_source_unref (skeleton->priv->changed_properties_idle_source);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+}
+
+static void
+sensor_integer_settable_skeleton_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+ g_assert (prop_id != 0 && prop_id - 1 < 2);
+ g_mutex_lock (&skeleton->priv->lock);
+ g_object_freeze_notify (object);
+ if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
+ {
+ if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
+ _sensor_integer_settable_schedule_emit_changed (skeleton, _sensor_integer_settable_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
+ g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
+ g_object_notify_by_pspec (object, pspec);
+ }
+ g_mutex_unlock (&skeleton->priv->lock);
+ g_object_thaw_notify (object);
+}
+
+static void
+sensor_integer_settable_skeleton_init (SensorIntegerSettableSkeleton *skeleton)
+{
+#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
+ skeleton->priv = sensor_integer_settable_skeleton_get_instance_private (skeleton);
+#else
+ skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SENSOR_INTEGER_SETTABLE_SKELETON, SensorIntegerSettableSkeletonPrivate);
+#endif
+
+ g_mutex_init (&skeleton->priv->lock);
+ skeleton->priv->context = g_main_context_ref_thread_default ();
+ skeleton->priv->properties = g_new0 (GValue, 2);
+ g_value_init (&skeleton->priv->properties[0], G_TYPE_INT);
+ g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
+}
+
+static gint
+sensor_integer_settable_skeleton_get_value (SensorIntegerSettable *object)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+ gint value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_int (&(skeleton->priv->properties[0]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static const gchar *
+sensor_integer_settable_skeleton_get_units (SensorIntegerSettable *object)
+{
+ SensorIntegerSettableSkeleton *skeleton = SENSOR_INTEGER_SETTABLE_SKELETON (object);
+ const gchar *value;
+ g_mutex_lock (&skeleton->priv->lock);
+ value = g_value_get_string (&(skeleton->priv->properties[1]));
+ g_mutex_unlock (&skeleton->priv->lock);
+ return value;
+}
+
+static void
+sensor_integer_settable_skeleton_class_init (SensorIntegerSettableSkeletonClass *klass)
+{
+ GObjectClass *gobject_class;
+ GDBusInterfaceSkeletonClass *skeleton_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = sensor_integer_settable_skeleton_finalize;
+ gobject_class->get_property = sensor_integer_settable_skeleton_get_property;
+ gobject_class->set_property = sensor_integer_settable_skeleton_set_property;
+ gobject_class->notify = sensor_integer_settable_skeleton_notify;
+
+
+ sensor_integer_settable_override_properties (gobject_class, 1);
+
+ skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
+ skeleton_class->get_info = sensor_integer_settable_skeleton_dbus_interface_get_info;
+ skeleton_class->get_properties = sensor_integer_settable_skeleton_dbus_interface_get_properties;
+ skeleton_class->flush = sensor_integer_settable_skeleton_dbus_interface_flush;
+ skeleton_class->get_vtable = sensor_integer_settable_skeleton_dbus_interface_get_vtable;
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
+ g_type_class_add_private (klass, sizeof (SensorIntegerSettableSkeletonPrivate));
+#endif
+}
+
+static void
+sensor_integer_settable_skeleton_iface_init (SensorIntegerSettableIface *iface)
+{
+ iface->changed = _sensor_integer_settable_on_signal_changed;
+ iface->get_value = sensor_integer_settable_skeleton_get_value;
+ iface->get_units = sensor_integer_settable_skeleton_get_units;
+}
+
+/**
+ * sensor_integer_settable_skeleton_new:
+ *
+ * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link>.
+ *
+ * Returns: (transfer full) (type SensorIntegerSettableSkeleton): The skeleton object.
+ */
+SensorIntegerSettable *
+sensor_integer_settable_skeleton_new (void)
+{
+ return SENSOR_INTEGER_SETTABLE (g_object_new (TYPE_SENSOR_INTEGER_SETTABLE_SKELETON, NULL));
+}
+
+/* ------------------------------------------------------------------------
+ * Code for Object, ObjectProxy and ObjectSkeleton
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:Object
+ * @title: Object
+ * @short_description: Specialized GDBusObject types
+ *
+ * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
+ */
+
+/**
+ * Object:
+ *
+ * The #Object type is a specialized container of interfaces.
+ */
+
+/**
+ * ObjectIface:
+ * @parent_iface: The parent interface.
+ *
+ * Virtual table for the #Object interface.
+ */
+
+typedef ObjectIface ObjectInterface;
+G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
+
+static void
+object_default_init (ObjectIface *iface)
+{
+ /**
+ * Object:sensor-integer:
+ *
+ * The #SensorInteger instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("sensor-integer", "sensor-integer", "sensor-integer", TYPE_SENSOR_INTEGER, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+ /**
+ * Object:sensor-string:
+ *
+ * The #SensorString instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("sensor-string", "sensor-string", "sensor-string", TYPE_SENSOR_STRING, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+ /**
+ * Object:sensor-integer-settable:
+ *
+ * The #SensorIntegerSettable instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link>, if any.
+ *
+ * Connect to the #GObject::notify signal to get informed of property changes.
+ */
+ g_object_interface_install_property (iface, g_param_spec_object ("sensor-integer-settable", "sensor-integer-settable", "sensor-integer-settable", TYPE_SENSOR_INTEGER_SETTABLE, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
+
+}
+
+/**
+ * object_get_sensor_integer:
+ * @object: A #Object.
+ *
+ * Gets the #SensorInteger instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #SensorInteger that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+SensorInteger *object_get_sensor_integer (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorInteger");
+ if (ret == NULL)
+ return NULL;
+ return SENSOR_INTEGER (ret);
+}
+
+/**
+ * object_get_sensor_string:
+ * @object: A #Object.
+ *
+ * Gets the #SensorString instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #SensorString that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+SensorString *object_get_sensor_string (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorString");
+ if (ret == NULL)
+ return NULL;
+ return SENSOR_STRING (ret);
+}
+
+/**
+ * object_get_sensor_integer_settable:
+ * @object: A #Object.
+ *
+ * Gets the #SensorIntegerSettable instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link> on @object, if any.
+ *
+ * Returns: (transfer full): A #SensorIntegerSettable that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
+ */
+SensorIntegerSettable *object_get_sensor_integer_settable (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIntegerSettable");
+ if (ret == NULL)
+ return NULL;
+ return SENSOR_INTEGER_SETTABLE (ret);
+}
+
+
+/**
+ * object_peek_sensor_integer: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_sensor_integer() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #SensorInteger or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+SensorInteger *object_peek_sensor_integer (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorInteger");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return SENSOR_INTEGER (ret);
+}
+
+/**
+ * object_peek_sensor_string: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_sensor_string() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #SensorString or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+SensorString *object_peek_sensor_string (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorString");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return SENSOR_STRING (ret);
+}
+
+/**
+ * object_peek_sensor_integer_settable: (skip)
+ * @object: A #Object.
+ *
+ * Like object_get_sensor_integer_settable() but doesn't increase the reference count on the returned object.
+ *
+ * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
+ *
+ * Returns: (transfer none): A #SensorIntegerSettable or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
+ */
+SensorIntegerSettable *object_peek_sensor_integer_settable (Object *object)
+{
+ GDBusInterface *ret;
+ ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIntegerSettable");
+ if (ret == NULL)
+ return NULL;
+ g_object_unref (ret);
+ return SENSOR_INTEGER_SETTABLE (ret);
+}
+
+
+static void
+object_notify (GDBusObject *object, GDBusInterface *interface)
+{
+ _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
+ /* info can be NULL if the other end is using a D-Bus interface we don't know
+ * anything about, for example old generated code in this process talking to
+ * newer generated code in the other process. */
+ if (info != NULL)
+ g_object_notify (G_OBJECT (object), info->hyphen_name);
+}
+
+/**
+ * ObjectProxy:
+ *
+ * The #ObjectProxy structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectProxyClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectProxy.
+ */
+
+static void
+object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init));
+
+static void
+object_proxy_init (ObjectProxy *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_proxy_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value G_GNUC_UNUSED,
+ GParamSpec *pspec)
+{
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+}
+
+static void
+object_proxy_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectProxy *object = OBJECT_PROXY (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorInteger");
+ g_value_take_object (value, interface);
+ break;
+
+ case 2:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorString");
+ g_value_take_object (value, interface);
+ break;
+
+ case 3:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIntegerSettable");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_proxy_class_init (ObjectProxyClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_proxy_set_property;
+ gobject_class->get_property = object_proxy_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "sensor-integer");
+ g_object_class_override_property (gobject_class, 2, "sensor-string");
+ g_object_class_override_property (gobject_class, 3, "sensor-integer-settable");
+}
+
+/**
+ * object_proxy_new:
+ * @connection: A #GDBusConnection.
+ * @object_path: An object path.
+ *
+ * Creates a new proxy object.
+ *
+ * Returns: (transfer full): The proxy object.
+ */
+ObjectProxy *
+object_proxy_new (GDBusConnection *connection,
+ const gchar *object_path)
+{
+ g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
+}
+
+/**
+ * ObjectSkeleton:
+ *
+ * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectSkeletonClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectSkeleton.
+ */
+
+static void
+object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED)
+{
+}
+
+
+static void
+object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
+{
+ iface->interface_added = object_notify;
+ iface->interface_removed = object_notify;
+}
+
+G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
+ G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init));
+
+static void
+object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED)
+{
+}
+
+static void
+object_skeleton_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterfaceSkeleton *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_SENSOR_INTEGER (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.SensorInteger");
+ }
+ break;
+
+ case 2:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_SENSOR_STRING (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.SensorString");
+ }
+ break;
+
+ case 3:
+ interface = g_value_get_object (value);
+ if (interface != NULL)
+ {
+ g_warn_if_fail (IS_SENSOR_INTEGER_SETTABLE (interface));
+ g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
+ }
+ else
+ {
+ g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.SensorIntegerSettable");
+ }
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ObjectSkeleton *object = OBJECT_SKELETON (gobject);
+ GDBusInterface *interface;
+
+ switch (prop_id)
+ {
+ case 1:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorInteger");
+ g_value_take_object (value, interface);
+ break;
+
+ case 2:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorString");
+ g_value_take_object (value, interface);
+ break;
+
+ case 3:
+ interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIntegerSettable");
+ g_value_take_object (value, interface);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+object_skeleton_class_init (ObjectSkeletonClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = object_skeleton_set_property;
+ gobject_class->get_property = object_skeleton_get_property;
+
+ g_object_class_override_property (gobject_class, 1, "sensor-integer");
+ g_object_class_override_property (gobject_class, 2, "sensor-string");
+ g_object_class_override_property (gobject_class, 3, "sensor-integer-settable");
+}
+
+/**
+ * object_skeleton_new:
+ * @object_path: An object path.
+ *
+ * Creates a new skeleton object.
+ *
+ * Returns: (transfer full): The skeleton object.
+ */
+ObjectSkeleton *
+object_skeleton_new (const gchar *object_path)
+{
+ g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
+ return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
+}
+
+/**
+ * object_skeleton_set_sensor_integer:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #SensorInteger or %NULL to clear the interface.
+ *
+ * Sets the #SensorInteger instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorInteger.top_of_page">org.openbmc.SensorInteger</link> on @object.
+ */
+void object_skeleton_set_sensor_integer (ObjectSkeleton *object, SensorInteger *interface_)
+{
+ g_object_set (G_OBJECT (object), "sensor-integer", interface_, NULL);
+}
+
+/**
+ * object_skeleton_set_sensor_string:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #SensorString or %NULL to clear the interface.
+ *
+ * Sets the #SensorString instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorString.top_of_page">org.openbmc.SensorString</link> on @object.
+ */
+void object_skeleton_set_sensor_string (ObjectSkeleton *object, SensorString *interface_)
+{
+ g_object_set (G_OBJECT (object), "sensor-string", interface_, NULL);
+}
+
+/**
+ * object_skeleton_set_sensor_integer_settable:
+ * @object: A #ObjectSkeleton.
+ * @interface_: (allow-none): A #SensorIntegerSettable or %NULL to clear the interface.
+ *
+ * Sets the #SensorIntegerSettable instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIntegerSettable.top_of_page">org.openbmc.SensorIntegerSettable</link> on @object.
+ */
+void object_skeleton_set_sensor_integer_settable (ObjectSkeleton *object, SensorIntegerSettable *interface_)
+{
+ g_object_set (G_OBJECT (object), "sensor-integer-settable", interface_, NULL);
+}
+
+
+/* ------------------------------------------------------------------------
+ * Code for ObjectManager client
+ * ------------------------------------------------------------------------
+ */
+
+/**
+ * SECTION:ObjectManagerClient
+ * @title: ObjectManagerClient
+ * @short_description: Generated GDBusObjectManagerClient type
+ *
+ * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
+ */
+
+/**
+ * ObjectManagerClient:
+ *
+ * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API.
+ */
+
+/**
+ * ObjectManagerClientClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #ObjectManagerClient.
+ */
+
+G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
+
+static void
+object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED)
+{
+}
+
+static void
+object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED)
+{
+}
+
+/**
+ * object_manager_client_get_proxy_type:
+ * @manager: A #GDBusObjectManagerClient.
+ * @object_path: The object path of the remote object (unused).
+ * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
+ * @user_data: User data (unused).
+ *
+ * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
+ *
+ * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy.
+ */
+GType
+object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
+{
+ static gsize once_init_value = 0;
+ static GHashTable *lookup_hash;
+ GType ret;
+
+ if (interface_name == NULL)
+ return TYPE_OBJECT_PROXY;
+ if (g_once_init_enter (&once_init_value))
+ {
+ lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorInteger", GSIZE_TO_POINTER (TYPE_SENSOR_INTEGER_PROXY));
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorString", GSIZE_TO_POINTER (TYPE_SENSOR_STRING_PROXY));
+ g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorIntegerSettable", GSIZE_TO_POINTER (TYPE_SENSOR_INTEGER_SETTABLE_PROXY));
+ g_once_init_leave (&once_init_value, 1);
+ }
+ ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
+ if (ret == (GType) 0)
+ ret = G_TYPE_DBUS_PROXY;
+ return ret;
+}
+
+/**
+ * object_manager_client_new:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_sync:
+ * @connection: A #GDBusConnection.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
+/**
+ * object_manager_client_new_for_bus:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: User data to pass to @callback.
+ *
+ * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation.
+ *
+ * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
+ */
+void
+object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+}
+
+/**
+ * object_manager_client_new_for_bus_finish:
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus().
+ * @error: Return location for error or %NULL
+ *
+ * Finishes an operation started with object_manager_client_new_for_bus().
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error)
+{
+ GObject *ret;
+ GObject *source_object;
+ source_object = g_async_result_get_source_object (res);
+ ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
+ g_object_unref (source_object);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+/**
+ * object_manager_client_new_for_bus_sync:
+ * @bus_type: A #GBusType.
+ * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
+ * @name: A bus name (well-known or unique).
+ * @object_path: An object path.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL
+ *
+ * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
+ *
+ * The calling thread is blocked until a reply is received.
+ *
+ * See object_manager_client_new_for_bus() for the asynchronous version of this constructor.
+ *
+ * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set.
+ */
+GDBusObjectManager *
+object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GInitable *ret;
+ ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL);
+ if (ret != NULL)
+ return G_DBUS_OBJECT_MANAGER (ret);
+ else
+ return NULL;
+}
+
+
diff --git a/interfaces/sensor.h b/interfaces/sensor.h
new file mode 100644
index 0000000..b648409
--- /dev/null
+++ b/interfaces/sensor.h
@@ -0,0 +1,810 @@
+/*
+ * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
+ *
+ * The license of this code is the same as for the source it was derived from.
+ */
+
+#ifndef __INTERFACES_SENSOR_H__
+#define __INTERFACES_SENSOR_H__
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.SensorInteger */
+
+#define TYPE_SENSOR_INTEGER (sensor_integer_get_type ())
+#define SENSOR_INTEGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_INTEGER, SensorInteger))
+#define IS_SENSOR_INTEGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_INTEGER))
+#define SENSOR_INTEGER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SENSOR_INTEGER, SensorIntegerIface))
+
+struct _SensorInteger;
+typedef struct _SensorInteger SensorInteger;
+typedef struct _SensorIntegerIface SensorIntegerIface;
+
+struct _SensorIntegerIface
+{
+ GTypeInterface parent_iface;
+
+
+
+ gboolean (*handle_get_units) (
+ SensorInteger *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_value) (
+ SensorInteger *object,
+ GDBusMethodInvocation *invocation);
+
+ const gchar * (*get_units) (SensorInteger *object);
+
+ gint (*get_value) (SensorInteger *object);
+
+ void (*changed) (
+ SensorInteger *object,
+ gint arg_value);
+
+};
+
+GType sensor_integer_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *sensor_integer_interface_info (void);
+guint sensor_integer_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void sensor_integer_complete_get_value (
+ SensorInteger *object,
+ GDBusMethodInvocation *invocation,
+ gint value);
+
+void sensor_integer_complete_get_units (
+ SensorInteger *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *units);
+
+
+
+/* D-Bus signal emissions functions: */
+void sensor_integer_emit_changed (
+ SensorInteger *object,
+ gint arg_value);
+
+
+
+/* D-Bus method calls: */
+void sensor_integer_call_get_value (
+ SensorInteger *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_integer_call_get_value_finish (
+ SensorInteger *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_integer_call_get_value_sync (
+ SensorInteger *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_integer_call_get_units (
+ SensorInteger *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_integer_call_get_units_finish (
+ SensorInteger *proxy,
+ gchar **out_units,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_integer_call_get_units_sync (
+ SensorInteger *proxy,
+ gchar **out_units,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+gint sensor_integer_get_value (SensorInteger *object);
+void sensor_integer_set_value (SensorInteger *object, gint value);
+
+const gchar *sensor_integer_get_units (SensorInteger *object);
+gchar *sensor_integer_dup_units (SensorInteger *object);
+void sensor_integer_set_units (SensorInteger *object, const gchar *value);
+
+
+/* ---- */
+
+#define TYPE_SENSOR_INTEGER_PROXY (sensor_integer_proxy_get_type ())
+#define SENSOR_INTEGER_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_INTEGER_PROXY, SensorIntegerProxy))
+#define SENSOR_INTEGER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_INTEGER_PROXY, SensorIntegerProxyClass))
+#define SENSOR_INTEGER_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_INTEGER_PROXY, SensorIntegerProxyClass))
+#define IS_SENSOR_INTEGER_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_INTEGER_PROXY))
+#define IS_SENSOR_INTEGER_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_INTEGER_PROXY))
+
+typedef struct _SensorIntegerProxy SensorIntegerProxy;
+typedef struct _SensorIntegerProxyClass SensorIntegerProxyClass;
+typedef struct _SensorIntegerProxyPrivate SensorIntegerProxyPrivate;
+
+struct _SensorIntegerProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ SensorIntegerProxyPrivate *priv;
+};
+
+struct _SensorIntegerProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType sensor_integer_proxy_get_type (void) G_GNUC_CONST;
+
+void sensor_integer_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+SensorInteger *sensor_integer_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+SensorInteger *sensor_integer_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_integer_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+SensorInteger *sensor_integer_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+SensorInteger *sensor_integer_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_SENSOR_INTEGER_SKELETON (sensor_integer_skeleton_get_type ())
+#define SENSOR_INTEGER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_INTEGER_SKELETON, SensorIntegerSkeleton))
+#define SENSOR_INTEGER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_INTEGER_SKELETON, SensorIntegerSkeletonClass))
+#define SENSOR_INTEGER_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_INTEGER_SKELETON, SensorIntegerSkeletonClass))
+#define IS_SENSOR_INTEGER_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_INTEGER_SKELETON))
+#define IS_SENSOR_INTEGER_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_INTEGER_SKELETON))
+
+typedef struct _SensorIntegerSkeleton SensorIntegerSkeleton;
+typedef struct _SensorIntegerSkeletonClass SensorIntegerSkeletonClass;
+typedef struct _SensorIntegerSkeletonPrivate SensorIntegerSkeletonPrivate;
+
+struct _SensorIntegerSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ SensorIntegerSkeletonPrivate *priv;
+};
+
+struct _SensorIntegerSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType sensor_integer_skeleton_get_type (void) G_GNUC_CONST;
+
+SensorInteger *sensor_integer_skeleton_new (void);
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.SensorString */
+
+#define TYPE_SENSOR_STRING (sensor_string_get_type ())
+#define SENSOR_STRING(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_STRING, SensorString))
+#define IS_SENSOR_STRING(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_STRING))
+#define SENSOR_STRING_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SENSOR_STRING, SensorStringIface))
+
+struct _SensorString;
+typedef struct _SensorString SensorString;
+typedef struct _SensorStringIface SensorStringIface;
+
+struct _SensorStringIface
+{
+ GTypeInterface parent_iface;
+
+
+
+ gboolean (*handle_get_units) (
+ SensorString *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_value) (
+ SensorString *object,
+ GDBusMethodInvocation *invocation);
+
+ const gchar * (*get_units) (SensorString *object);
+
+ gint (*get_value) (SensorString *object);
+
+ void (*changed) (
+ SensorString *object,
+ const gchar *arg_value);
+
+};
+
+GType sensor_string_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *sensor_string_interface_info (void);
+guint sensor_string_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void sensor_string_complete_get_value (
+ SensorString *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *value);
+
+void sensor_string_complete_get_units (
+ SensorString *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *units);
+
+
+
+/* D-Bus signal emissions functions: */
+void sensor_string_emit_changed (
+ SensorString *object,
+ const gchar *arg_value);
+
+
+
+/* D-Bus method calls: */
+void sensor_string_call_get_value (
+ SensorString *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_string_call_get_value_finish (
+ SensorString *proxy,
+ gchar **out_value,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_string_call_get_value_sync (
+ SensorString *proxy,
+ gchar **out_value,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_string_call_get_units (
+ SensorString *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_string_call_get_units_finish (
+ SensorString *proxy,
+ gchar **out_units,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_string_call_get_units_sync (
+ SensorString *proxy,
+ gchar **out_units,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+gint sensor_string_get_value (SensorString *object);
+void sensor_string_set_value (SensorString *object, gint value);
+
+const gchar *sensor_string_get_units (SensorString *object);
+gchar *sensor_string_dup_units (SensorString *object);
+void sensor_string_set_units (SensorString *object, const gchar *value);
+
+
+/* ---- */
+
+#define TYPE_SENSOR_STRING_PROXY (sensor_string_proxy_get_type ())
+#define SENSOR_STRING_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_STRING_PROXY, SensorStringProxy))
+#define SENSOR_STRING_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_STRING_PROXY, SensorStringProxyClass))
+#define SENSOR_STRING_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_STRING_PROXY, SensorStringProxyClass))
+#define IS_SENSOR_STRING_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_STRING_PROXY))
+#define IS_SENSOR_STRING_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_STRING_PROXY))
+
+typedef struct _SensorStringProxy SensorStringProxy;
+typedef struct _SensorStringProxyClass SensorStringProxyClass;
+typedef struct _SensorStringProxyPrivate SensorStringProxyPrivate;
+
+struct _SensorStringProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ SensorStringProxyPrivate *priv;
+};
+
+struct _SensorStringProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType sensor_string_proxy_get_type (void) G_GNUC_CONST;
+
+void sensor_string_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+SensorString *sensor_string_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+SensorString *sensor_string_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_string_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+SensorString *sensor_string_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+SensorString *sensor_string_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_SENSOR_STRING_SKELETON (sensor_string_skeleton_get_type ())
+#define SENSOR_STRING_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_STRING_SKELETON, SensorStringSkeleton))
+#define SENSOR_STRING_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_STRING_SKELETON, SensorStringSkeletonClass))
+#define SENSOR_STRING_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_STRING_SKELETON, SensorStringSkeletonClass))
+#define IS_SENSOR_STRING_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_STRING_SKELETON))
+#define IS_SENSOR_STRING_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_STRING_SKELETON))
+
+typedef struct _SensorStringSkeleton SensorStringSkeleton;
+typedef struct _SensorStringSkeletonClass SensorStringSkeletonClass;
+typedef struct _SensorStringSkeletonPrivate SensorStringSkeletonPrivate;
+
+struct _SensorStringSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ SensorStringSkeletonPrivate *priv;
+};
+
+struct _SensorStringSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType sensor_string_skeleton_get_type (void) G_GNUC_CONST;
+
+SensorString *sensor_string_skeleton_new (void);
+
+
+/* ------------------------------------------------------------------------ */
+/* Declarations for org.openbmc.SensorIntegerSettable */
+
+#define TYPE_SENSOR_INTEGER_SETTABLE (sensor_integer_settable_get_type ())
+#define SENSOR_INTEGER_SETTABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_INTEGER_SETTABLE, SensorIntegerSettable))
+#define IS_SENSOR_INTEGER_SETTABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_INTEGER_SETTABLE))
+#define SENSOR_INTEGER_SETTABLE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SENSOR_INTEGER_SETTABLE, SensorIntegerSettableIface))
+
+struct _SensorIntegerSettable;
+typedef struct _SensorIntegerSettable SensorIntegerSettable;
+typedef struct _SensorIntegerSettableIface SensorIntegerSettableIface;
+
+struct _SensorIntegerSettableIface
+{
+ GTypeInterface parent_iface;
+
+
+
+ gboolean (*handle_get_units) (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_get_value) (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation);
+
+ gboolean (*handle_set_value) (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation,
+ gint arg_value);
+
+ const gchar * (*get_units) (SensorIntegerSettable *object);
+
+ gint (*get_value) (SensorIntegerSettable *object);
+
+ void (*changed) (
+ SensorIntegerSettable *object,
+ gint arg_value);
+
+};
+
+GType sensor_integer_settable_get_type (void) G_GNUC_CONST;
+
+GDBusInterfaceInfo *sensor_integer_settable_interface_info (void);
+guint sensor_integer_settable_override_properties (GObjectClass *klass, guint property_id_begin);
+
+
+/* D-Bus method call completion functions: */
+void sensor_integer_settable_complete_get_value (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation,
+ gint value);
+
+void sensor_integer_settable_complete_set_value (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation);
+
+void sensor_integer_settable_complete_get_units (
+ SensorIntegerSettable *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *units);
+
+
+
+/* D-Bus signal emissions functions: */
+void sensor_integer_settable_emit_changed (
+ SensorIntegerSettable *object,
+ gint arg_value);
+
+
+
+/* D-Bus method calls: */
+void sensor_integer_settable_call_get_value (
+ SensorIntegerSettable *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_integer_settable_call_get_value_finish (
+ SensorIntegerSettable *proxy,
+ gint *out_value,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_integer_settable_call_get_value_sync (
+ SensorIntegerSettable *proxy,
+ gint *out_value,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_integer_settable_call_set_value (
+ SensorIntegerSettable *proxy,
+ gint arg_value,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_integer_settable_call_set_value_finish (
+ SensorIntegerSettable *proxy,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_integer_settable_call_set_value_sync (
+ SensorIntegerSettable *proxy,
+ gint arg_value,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_integer_settable_call_get_units (
+ SensorIntegerSettable *proxy,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean sensor_integer_settable_call_get_units_finish (
+ SensorIntegerSettable *proxy,
+ gchar **out_units,
+ GAsyncResult *res,
+ GError **error);
+
+gboolean sensor_integer_settable_call_get_units_sync (
+ SensorIntegerSettable *proxy,
+ gchar **out_units,
+ GCancellable *cancellable,
+ GError **error);
+
+
+
+/* D-Bus property accessors: */
+gint sensor_integer_settable_get_value (SensorIntegerSettable *object);
+void sensor_integer_settable_set_value (SensorIntegerSettable *object, gint value);
+
+const gchar *sensor_integer_settable_get_units (SensorIntegerSettable *object);
+gchar *sensor_integer_settable_dup_units (SensorIntegerSettable *object);
+void sensor_integer_settable_set_units (SensorIntegerSettable *object, const gchar *value);
+
+
+/* ---- */
+
+#define TYPE_SENSOR_INTEGER_SETTABLE_PROXY (sensor_integer_settable_proxy_get_type ())
+#define SENSOR_INTEGER_SETTABLE_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_INTEGER_SETTABLE_PROXY, SensorIntegerSettableProxy))
+#define SENSOR_INTEGER_SETTABLE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_INTEGER_SETTABLE_PROXY, SensorIntegerSettableProxyClass))
+#define SENSOR_INTEGER_SETTABLE_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_INTEGER_SETTABLE_PROXY, SensorIntegerSettableProxyClass))
+#define IS_SENSOR_INTEGER_SETTABLE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_INTEGER_SETTABLE_PROXY))
+#define IS_SENSOR_INTEGER_SETTABLE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_INTEGER_SETTABLE_PROXY))
+
+typedef struct _SensorIntegerSettableProxy SensorIntegerSettableProxy;
+typedef struct _SensorIntegerSettableProxyClass SensorIntegerSettableProxyClass;
+typedef struct _SensorIntegerSettableProxyPrivate SensorIntegerSettableProxyPrivate;
+
+struct _SensorIntegerSettableProxy
+{
+ /*< private >*/
+ GDBusProxy parent_instance;
+ SensorIntegerSettableProxyPrivate *priv;
+};
+
+struct _SensorIntegerSettableProxyClass
+{
+ GDBusProxyClass parent_class;
+};
+
+GType sensor_integer_settable_proxy_get_type (void) G_GNUC_CONST;
+
+void sensor_integer_settable_proxy_new (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+SensorIntegerSettable *sensor_integer_settable_proxy_new_finish (
+ GAsyncResult *res,
+ GError **error);
+SensorIntegerSettable *sensor_integer_settable_proxy_new_sync (
+ GDBusConnection *connection,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void sensor_integer_settable_proxy_new_for_bus (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+SensorIntegerSettable *sensor_integer_settable_proxy_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+SensorIntegerSettable *sensor_integer_settable_proxy_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusProxyFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+/* ---- */
+
+#define TYPE_SENSOR_INTEGER_SETTABLE_SKELETON (sensor_integer_settable_skeleton_get_type ())
+#define SENSOR_INTEGER_SETTABLE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_INTEGER_SETTABLE_SKELETON, SensorIntegerSettableSkeleton))
+#define SENSOR_INTEGER_SETTABLE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_INTEGER_SETTABLE_SKELETON, SensorIntegerSettableSkeletonClass))
+#define SENSOR_INTEGER_SETTABLE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_INTEGER_SETTABLE_SKELETON, SensorIntegerSettableSkeletonClass))
+#define IS_SENSOR_INTEGER_SETTABLE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_INTEGER_SETTABLE_SKELETON))
+#define IS_SENSOR_INTEGER_SETTABLE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_INTEGER_SETTABLE_SKELETON))
+
+typedef struct _SensorIntegerSettableSkeleton SensorIntegerSettableSkeleton;
+typedef struct _SensorIntegerSettableSkeletonClass SensorIntegerSettableSkeletonClass;
+typedef struct _SensorIntegerSettableSkeletonPrivate SensorIntegerSettableSkeletonPrivate;
+
+struct _SensorIntegerSettableSkeleton
+{
+ /*< private >*/
+ GDBusInterfaceSkeleton parent_instance;
+ SensorIntegerSettableSkeletonPrivate *priv;
+};
+
+struct _SensorIntegerSettableSkeletonClass
+{
+ GDBusInterfaceSkeletonClass parent_class;
+};
+
+GType sensor_integer_settable_skeleton_get_type (void) G_GNUC_CONST;
+
+SensorIntegerSettable *sensor_integer_settable_skeleton_new (void);
+
+
+/* ---- */
+
+#define TYPE_OBJECT (object_get_type ())
+#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
+#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
+#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))
+
+struct _Object;
+typedef struct _Object Object;
+typedef struct _ObjectIface ObjectIface;
+
+struct _ObjectIface
+{
+ GTypeInterface parent_iface;
+};
+
+GType object_get_type (void) G_GNUC_CONST;
+
+SensorInteger *object_get_sensor_integer (Object *object);
+SensorString *object_get_sensor_string (Object *object);
+SensorIntegerSettable *object_get_sensor_integer_settable (Object *object);
+SensorInteger *object_peek_sensor_integer (Object *object);
+SensorString *object_peek_sensor_string (Object *object);
+SensorIntegerSettable *object_peek_sensor_integer_settable (Object *object);
+
+#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
+#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
+#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
+#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
+#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))
+
+typedef struct _ObjectProxy ObjectProxy;
+typedef struct _ObjectProxyClass ObjectProxyClass;
+typedef struct _ObjectProxyPrivate ObjectProxyPrivate;
+
+struct _ObjectProxy
+{
+ /*< private >*/
+ GDBusObjectProxy parent_instance;
+ ObjectProxyPrivate *priv;
+};
+
+struct _ObjectProxyClass
+{
+ GDBusObjectProxyClass parent_class;
+};
+
+GType object_proxy_get_type (void) G_GNUC_CONST;
+ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);
+
+#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
+#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
+#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
+#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
+#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))
+
+typedef struct _ObjectSkeleton ObjectSkeleton;
+typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
+typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;
+
+struct _ObjectSkeleton
+{
+ /*< private >*/
+ GDBusObjectSkeleton parent_instance;
+ ObjectSkeletonPrivate *priv;
+};
+
+struct _ObjectSkeletonClass
+{
+ GDBusObjectSkeletonClass parent_class;
+};
+
+GType object_skeleton_get_type (void) G_GNUC_CONST;
+ObjectSkeleton *object_skeleton_new (const gchar *object_path);
+void object_skeleton_set_sensor_integer (ObjectSkeleton *object, SensorInteger *interface_);
+void object_skeleton_set_sensor_string (ObjectSkeleton *object, SensorString *interface_);
+void object_skeleton_set_sensor_integer_settable (ObjectSkeleton *object, SensorIntegerSettable *interface_);
+
+/* ---- */
+
+#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
+#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
+#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
+#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
+#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))
+
+typedef struct _ObjectManagerClient ObjectManagerClient;
+typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
+typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;
+
+struct _ObjectManagerClient
+{
+ /*< private >*/
+ GDBusObjectManagerClient parent_instance;
+ ObjectManagerClientPrivate *priv;
+};
+
+struct _ObjectManagerClientClass
+{
+ GDBusObjectManagerClientClass parent_class;
+};
+
+GType object_manager_client_get_type (void) G_GNUC_CONST;
+
+GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
+
+void object_manager_client_new (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_sync (
+ GDBusConnection *connection,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+void object_manager_client_new_for_bus (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDBusObjectManager *object_manager_client_new_for_bus_finish (
+ GAsyncResult *res,
+ GError **error);
+GDBusObjectManager *object_manager_client_new_for_bus_sync (
+ GBusType bus_type,
+ GDBusObjectManagerClientFlags flags,
+ const gchar *name,
+ const gchar *object_path,
+ GCancellable *cancellable,
+ GError **error);
+
+
+G_END_DECLS
+
+#endif /* __INTERFACES_SENSOR_H__ */
diff --git a/obj/button.o b/obj/button.o
new file mode 100644
index 0000000..87c1c7f
--- /dev/null
+++ b/obj/button.o
Binary files differ
diff --git a/obj/button_power_obj.o b/obj/button_power_obj.o
new file mode 100644
index 0000000..0341dba
--- /dev/null
+++ b/obj/button_power_obj.o
Binary files differ
diff --git a/obj/chassis_identify_obj.o b/obj/chassis_identify_obj.o
new file mode 100644
index 0000000..bad4a9b
--- /dev/null
+++ b/obj/chassis_identify_obj.o
Binary files differ
diff --git a/obj/flash.o b/obj/flash.o
new file mode 100644
index 0000000..fa5e7b8
--- /dev/null
+++ b/obj/flash.o
Binary files differ
diff --git a/obj/flash_bios_obj.o b/obj/flash_bios_obj.o
new file mode 100644
index 0000000..c63608d
--- /dev/null
+++ b/obj/flash_bios_obj.o
Binary files differ
diff --git a/obj/host_control.o b/obj/host_control.o
new file mode 100644
index 0000000..621b666
--- /dev/null
+++ b/obj/host_control.o
Binary files differ
diff --git a/obj/host_control_obj.o b/obj/host_control_obj.o
new file mode 100644
index 0000000..e23ab66
--- /dev/null
+++ b/obj/host_control_obj.o
Binary files differ
diff --git a/obj/led.o b/obj/led.o
new file mode 100644
index 0000000..1c87619
--- /dev/null
+++ b/obj/led.o
Binary files differ
diff --git a/obj/pflash.o b/obj/pflash.o
new file mode 100644
index 0000000..9fbecc2
--- /dev/null
+++ b/obj/pflash.o
Binary files differ
diff --git a/obj/power_control.o b/obj/power_control.o
new file mode 100644
index 0000000..a6e117f
--- /dev/null
+++ b/obj/power_control.o
Binary files differ
diff --git a/obj/power_control_obj.o b/obj/power_control_obj.o
new file mode 100644
index 0000000..98b9ed8
--- /dev/null
+++ b/obj/power_control_obj.o
Binary files differ
diff --git a/obj/sensor.o b/obj/sensor.o
new file mode 100644
index 0000000..8fddd38
--- /dev/null
+++ b/obj/sensor.o
Binary files differ
diff --git a/obj/sensor_host_status_obj.o b/obj/sensor_host_status_obj.o
new file mode 100644
index 0000000..2c9ed7e
--- /dev/null
+++ b/obj/sensor_host_status_obj.o
Binary files differ
diff --git a/obj/sensor_temperature_ambient_obj.o b/obj/sensor_temperature_ambient_obj.o
new file mode 100644
index 0000000..c32103f
--- /dev/null
+++ b/obj/sensor_temperature_ambient_obj.o
Binary files differ
diff --git a/objects/button_power_obj.c b/objects/button_power_obj.c
new file mode 100644
index 0000000..f0583dd
--- /dev/null
+++ b/objects/button_power_obj.c
@@ -0,0 +1,113 @@
+#include "interfaces/button.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+static Button *button = NULL;
+static const int gpio = 12;
+
+static gboolean
+on_is_on (Button *btn,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ gboolean btn_state=button_get_state(btn);
+ button_complete_is_on(btn,invocation,btn_state);
+ return TRUE;
+
+}
+
+static gboolean
+on_sim_button_press (Button *btn,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ g_print("Simulating button pressed\n");
+ button_emit_button_pressed(btn);
+ button_complete_sim_button_press(btn,invocation);
+ return TRUE;
+
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/buttons/ButtonPower");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/buttons/ButtonPower/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+
+ button = button_skeleton_new ();
+ object_skeleton_set_button (object, button);
+ g_object_unref (button);
+
+ //define method callbacks
+ g_signal_connect (button,
+ "handle-is-on",
+ G_CALLBACK (on_is_on),
+ NULL); /* user_data */
+ g_signal_connect (button,
+ "handle-sim-button-press",
+ G_CALLBACK (on_sim_button_press),
+ NULL); /* user_data */
+
+
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.buttons.ButtonPower",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/objects/chassis_identify_obj.c b/objects/chassis_identify_obj.c
new file mode 100644
index 0000000..a4bc735
--- /dev/null
+++ b/objects/chassis_identify_obj.c
@@ -0,0 +1,116 @@
+#include "interfaces/led.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+//static Led *led = NULL;
+static uint gpio = 12;
+
+static gboolean
+on_set_on (Led *led,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ g_print("Turn on chassis identify led\n");
+ //TODO: implement in hardware
+ led_complete_set_on(led,invocation);
+ return TRUE;
+
+}
+
+static gboolean
+on_set_off (Led *led,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ g_print("Turn off chassis identify led\n");
+ //TODO: implement in hardware
+ led_complete_set_off(led,invocation);
+ return TRUE;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ Led *led;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/ChassisIdentify");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/ChassisIdentify/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+
+ led = led_skeleton_new ();
+ object_skeleton_set_led (object, led);
+ g_object_unref (led);
+
+ //define method callbacks
+ g_signal_connect (led,
+ "handle-set-on",
+ G_CALLBACK (on_set_on),
+ NULL); /* user_data */
+ g_signal_connect (led,
+ "handle-set-off",
+ G_CALLBACK (on_set_off),
+ NULL);
+
+ led_set_color(led,0);
+ led_set_function(led,"CHASSIS_IDENTIFY");
+
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.ChassisIdentify",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/objects/flash_bios_obj.c b/objects/flash_bios_obj.c
new file mode 100644
index 0000000..90c67c8
--- /dev/null
+++ b/objects/flash_bios_obj.c
@@ -0,0 +1,107 @@
+#include "interfaces/flash.h"
+#include "pflash/pflash.c"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+static Flash *flash = NULL;
+
+static gboolean
+on_update_via_file (Flash *f,
+ GDBusMethodInvocation *invocation,
+ gchar* write_file,
+ gpointer user_data)
+{
+ g_print("Flashing BIOS from file\n");
+ // get size from file
+ struct stat stbuf;
+ uint32_t address = 0, read_size = 0, write_size = 0;
+
+ if (stat(write_file, &stbuf))
+ {
+ g_print("Failed to get file size");
+ //TODO: Error handling
+ }
+ write_size = stbuf.st_size;
+ erase_chip();
+ program_file(write_file, address, write_size);
+ flash_complete_update_via_file(f,invocation);
+ return TRUE;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/Flash/BIOS");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/Flash/BIOS/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+
+ flash = flash_skeleton_new ();
+ object_skeleton_set_flash (object, flash);
+ g_object_unref (flash);
+
+ //define method callbacks here
+ g_signal_connect (flash,
+ "handle-update-via-file",
+ G_CALLBACK (on_update_via_file),
+ NULL); /* user_data */
+
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.Flash.BIOS",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/objects/host_control_obj.c b/objects/host_control_obj.c
new file mode 100644
index 0000000..1b52590
--- /dev/null
+++ b/objects/host_control_obj.c
@@ -0,0 +1,97 @@
+#include "interfaces/host_control.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+static HostControl *host_control = NULL;
+
+static guint gpio_fsiclk = 27;
+static guint gpio_fsidat = 28;
+
+static gboolean
+on_boot (HostControl *host,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ // TODO: Implement gpio toggling
+ g_print("Boot");
+ host_control_complete_boot(host,invocation);
+ host_control_emit_booted(host);
+ return TRUE;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/HostControl");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/HostControl/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+ host_control = host_control_skeleton_new ();
+ object_skeleton_set_host_control (object, host_control);
+ g_object_unref (host_control);
+
+ //define method callbacks here
+ g_signal_connect (host_control,
+ "handle-boot",
+ G_CALLBACK (on_boot),
+ NULL); /* user_data */
+
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.HostControl",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/objects/pflash b/objects/pflash
new file mode 160000
index 0000000..8be47d0
--- /dev/null
+++ b/objects/pflash
@@ -0,0 +1 @@
+Subproject commit 8be47d0ca4dccf0cdd68930a597dc830237f6732
diff --git a/objects/power_control_obj.c b/objects/power_control_obj.c
new file mode 100644
index 0000000..e2560c4
--- /dev/null
+++ b/objects/power_control_obj.c
@@ -0,0 +1,169 @@
+#include "interfaces/power_control.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+static PowerControl *power_control = NULL;
+
+static guint gpio_power = 26;
+static guint gpio_fsiclk = 27;
+static guint gpio_fsidat = 28;
+static guint gpio_pgood = 21;
+
+static guint tmp_pgood = 0;
+
+static gboolean
+on_set_power_state (PowerControl *pwr,
+ GDBusMethodInvocation *invocation,
+ guint state,
+ gpointer user_data)
+{
+ if (state > 1)
+ {
+ g_dbus_method_invocation_return_dbus_error (invocation,
+ "org.openbmc.PowerControl.Error.Failed",
+ "Invalid power state");
+ return TRUE;
+ }
+ if (state == power_control_get_state(pwr))
+ {
+ g_dbus_method_invocation_return_dbus_error (invocation,
+ "org.openbmc.PowerControl.Error.Failed",
+ "Power Control is already at requested state");
+ return TRUE;
+ }
+
+ // TODO: Implement gpio toggling
+ g_print("Set power state: %d\n",state);
+ if (state==1)
+ {
+ g_print("Turn on\n");
+ tmp_pgood=1;
+ }
+ else
+ {
+ g_print("Turn off\n");
+ tmp_pgood=0;
+ }
+ power_control_set_state(pwr,state);
+ power_control_complete_set_power_state(pwr,invocation);
+ return TRUE;
+}
+
+static gboolean
+on_get_power_state (PowerControl *pwr,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ guint pgood = power_control_get_pgood(pwr);
+ power_control_complete_get_power_state(pwr,invocation,pgood);
+ return TRUE;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/PowerControl");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/PowerControl/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+
+ power_control = power_control_skeleton_new ();
+ object_skeleton_set_power_control (object, power_control);
+ g_object_unref (power_control);
+
+ //define method callbacks here
+ g_signal_connect (power_control,
+ "handle-set-power-state",
+ G_CALLBACK (on_set_power_state),
+ NULL); /* user_data */
+
+ g_signal_connect (power_control,
+ "handle-get-power-state",
+ G_CALLBACK (on_get_power_state),
+ NULL); /* user_data */
+
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+static gboolean
+poll_pgood()
+{
+ guint pgood = power_control_get_pgood(power_control);
+ //TOOD: Change to actually read gpio
+ guint gpio = tmp_pgood;
+
+ g_print("Polling pgood: %d\n",gpio);
+
+ //if changed, set property and emit signal
+ if (gpio != power_control_get_pgood(power_control))
+ {
+ power_control_set_pgood(power_control,gpio);
+ if (gpio==0)
+ {
+ power_control_emit_power_lost(power_control);
+ }
+ else
+ {
+ power_control_emit_power_good(power_control);
+ }
+ }
+ return TRUE;
+}
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.PowerControl",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+
+ g_timeout_add(5000, poll_pgood, NULL);
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/objects/sensor_host_status_obj.c b/objects/sensor_host_status_obj.c
new file mode 100644
index 0000000..fea3e5c
--- /dev/null
+++ b/objects/sensor_host_status_obj.c
@@ -0,0 +1,122 @@
+#include "interfaces/sensor.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+static SensorIntegerSettable *sensor = NULL;
+
+static gboolean
+on_get_units (SensorIntegerSettable *sen,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ const gchar* val = sensor_integer_settable_get_units(sen);
+ sensor_integer_settable_complete_get_units(sen,invocation,val);
+ return TRUE;
+}
+
+static gboolean
+on_get (SensorIntegerSettable *sen,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ guint val = sensor_integer_settable_get_value(sen);
+ sensor_integer_settable_complete_get_value(sen,invocation,val);
+ return TRUE;
+}
+static gboolean
+on_set (SensorIntegerSettable *sen,
+ GDBusMethodInvocation *invocation,
+ guint value,
+ gpointer user_data)
+{
+ sensor_integer_settable_set_value(sen,value);
+ sensor_integer_settable_complete_set_value(sen,invocation);
+ sensor_integer_settable_emit_changed(sen,value);
+ return TRUE;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/Sensors/HostStatus");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/Sensors/HostStatus/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+
+ sensor = sensor_integer_settable_skeleton_new ();
+ object_skeleton_set_sensor_integer_settable (object, sensor);
+ g_object_unref (sensor);
+
+ //define method callbacks here
+ g_signal_connect (sensor,
+ "handle-get-value",
+ G_CALLBACK (on_get),
+ NULL); /* user_data */
+ g_signal_connect (sensor,
+ "handle-set-value",
+ G_CALLBACK (on_set),
+ NULL); /* user_data */
+ g_signal_connect (sensor,
+ "handle-get-units",
+ G_CALLBACK (on_get_units),
+ NULL); /* user_data */
+
+ sensor_integer_settable_set_units(sensor,"");
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.Sensors.HostStatus",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/objects/sensor_temperature_ambient_obj.c b/objects/sensor_temperature_ambient_obj.c
new file mode 100644
index 0000000..a16cbb1
--- /dev/null
+++ b/objects/sensor_temperature_ambient_obj.c
@@ -0,0 +1,129 @@
+#include "interfaces/sensor.h"
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GDBusObjectManagerServer *manager = NULL;
+static SensorInteger *sensor = NULL;
+
+static guint i2c_bus = 1;
+
+static gboolean
+on_get_units (SensorInteger *sen,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ const gchar* val = sensor_integer_get_units(sen);
+ sensor_integer_complete_get_units(sen,invocation,val);
+ return TRUE;
+}
+
+static gboolean
+on_get (SensorInteger *sen,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ guint reading = sensor_integer_get_value(sen);
+ sensor_integer_complete_get_value(sen,invocation,reading);
+ return TRUE;
+}
+
+static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ObjectSkeleton *object;
+ guint n;
+
+ g_print ("Acquired a message bus connection: %s\n",name);
+
+ manager = g_dbus_object_manager_server_new ("/org/openbmc/Sensors/Temperature/Ambient");
+
+ gchar *s;
+ s = g_strdup_printf ("/org/openbmc/Sensors/Temperature/Ambient/0");
+ object = object_skeleton_new (s);
+ g_free (s);
+
+ sensor = sensor_integer_skeleton_new ();
+ object_skeleton_set_sensor_integer (object, sensor);
+ g_object_unref (sensor);
+
+ sensor_integer_set_units(sensor,"C");
+ //define method callbacks here
+ g_signal_connect (sensor,
+ "handle-get-value",
+ G_CALLBACK (on_get),
+ NULL); /* user_data */
+ g_signal_connect (sensor,
+ "handle-get-units",
+ G_CALLBACK (on_get_units),
+ NULL); /* user_data */
+
+
+ /* Export the object (@manager takes its own reference to @object) */
+ g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
+ g_object_unref (object);
+
+ /* Export all objects */
+ g_dbus_object_manager_server_set_connection (manager, connection);
+}
+
+static void
+on_name_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Acquired the name %s\n", name);
+}
+
+static void
+on_name_lost (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_print ("Lost the name %s\n", name);
+}
+
+static gboolean
+poll_sensor()
+{
+ guint value = sensor_integer_get_value(sensor);
+ //TOOD: Change to actually read sensor
+
+ g_print("Polling sensor: %d\n",value);
+
+ //if changed, set property and emit signal
+ if (value != sensor_integer_get_value(sensor))
+ {
+ sensor_integer_set_value(sensor,value);
+ sensor_integer_emit_changed(sensor,value);
+ }
+ return TRUE;
+}
+
+gint
+main (gint argc, gchar *argv[])
+{
+ GMainLoop *loop;
+
+ guint id;
+ //g_type_init ();
+ loop = g_main_loop_new (NULL, FALSE);
+
+ id = g_bus_own_name (G_BUS_TYPE_SESSION,
+ "org.openbmc.Sensors.Temperature.Ambient",
+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired,
+ on_name_lost,
+ loop,
+ NULL);
+
+ g_timeout_add(5000, poll_sensor, NULL);
+ g_main_loop_run (loop);
+
+ g_bus_unown_name (id);
+ g_main_loop_unref (loop);
+ return 0;
+}
diff --git a/start_services b/start_services
new file mode 100644
index 0000000..cd839bd
--- /dev/null
+++ b/start_services
@@ -0,0 +1,7 @@
+./bin/power_control &
+./bin/chassis_identify &
+./bin/sensor_ambient &
+./bin/button_power &
+./bin/sensor_host_status &
+./bin/host_control &
+./bin/flash_bios &
diff --git a/stop_services b/stop_services
new file mode 100644
index 0000000..8f5e026
--- /dev/null
+++ b/stop_services
@@ -0,0 +1,6 @@
+killall -9 power_control
+killall -9 chassis_identify
+killall -9 sensor_ambient
+killall -9 button_power
+killall -9 sensor_host_status
+killall -9 host_control
diff --git a/xml/apps.txt b/xml/apps.txt
new file mode 100644
index 0000000..dba983b
--- /dev/null
+++ b/xml/apps.txt
@@ -0,0 +1,45 @@
+sensor.xml
+ ambient_sensor
+ altitude_sensor
+ apss_sensors
+ power_capp
+ occ
+
+fan.xml
+ fan
+
+chassis_control.xml
+ chassis_control
+
+button.xml
+ power_button
+ identify_button
+
+led_control.xml
+ identify_led
+ fault_led
+ power_led
+
+watchdog.xml
+ bmc_watchdog
+ host_watchdog
+
+psu.xml
+ psu
+
+ipmi.xml
+ ipmid
+
+parameter.xml
+ parameter_database
+
+flash.xml
+ bmc_flash
+ bios_flash
+ cpld_flash
+
+
+(no interface)
+ fan_control (uses fan and sensors)
+
+
diff --git a/xml/button.xml b/xml/button.xml
new file mode 100644
index 0000000..699038a
--- /dev/null
+++ b/xml/button.xml
@@ -0,0 +1,14 @@
+<node>
+ <interface name="org.openbmc.Button">
+ <method name="isOn">
+ <arg name="state" type="b" direction="out"/>
+ </method>
+ <method name="simButtonPress"/>
+ <method name="simButtonLongPress"/>
+
+ <property name="state" type="b" access="read"/>
+ <signal name="ButtonRelease"/>
+ <signal name="ButtonPressed"/>
+ <signal name="ButtonPressedLong"/>
+ </interface>
+</node>
diff --git a/xml/chassis_control.xml b/xml/chassis_control.xml
new file mode 100644
index 0000000..c7e4980
--- /dev/null
+++ b/xml/chassis_control.xml
@@ -0,0 +1,30 @@
+<node>
+ <!--
+ @short_description: Chassis Control
+
+ - Power on
+ - Power off
+ - Put in debug mode (Cronus mode for POWER systems)
+ - If power is shutdown for hardware reasons,
+ app will fire state change signal
+ -->
+ <interface name="org.openbmc.ChassisControl">
+ <method name="getID">
+ <arg name="id" type="s" direction="out"/>
+ </method>
+ <method name="setIdentify"/>
+ <method name="clearIdentify"/>
+
+ <method name="setPowerState">
+ <arg name="state" type="i" direction="in"/>
+ </method>
+ <method name="getPowerState">
+ <arg name="state" type="i" direction="out"/>
+ </method>
+ <method name="setDebugMode">
+ </method>
+ <method name="setPowerPolicy">
+ <arg name="policy" type="i" direction="in"/>
+ </method>
+ </interface>
+</node>
diff --git a/xml/eventlog.xml b/xml/eventlog.xml
new file mode 100644
index 0000000..a859c19
--- /dev/null
+++ b/xml/eventlog.xml
@@ -0,0 +1,11 @@
+<node>
+ <interface name="org.openbmc.EventLog">
+ <method name="error">
+ <arg name="message" type="s" direction="in"/>
+ </method>
+ <property name="message" type="s" access="read"/>
+ <signal name="ErrorEvent">
+ <arg name="message" type="s"/>
+ </signal>
+ </interface>
+</node>
diff --git a/xml/fan.xml b/xml/fan.xml
new file mode 100644
index 0000000..f4aeeb2
--- /dev/null
+++ b/xml/fan.xml
@@ -0,0 +1,25 @@
+<node>
+ <!--
+ org.openbmc.Fan:
+ @short_description:
+ -->
+ <interface name="org.openbmc.Fan">
+ <method name="setCoolingZone">
+ <arg name="cooling_zone" type="i" direction="in"/>
+ </method>
+ <method name="getSpeed">
+ <arg name="speed" type="i" direction="out"/>
+ </method>
+ <method name="setSpeed">
+ <arg name="speed" type="i" direction="in"/>
+ </method>
+ <method name="setPwmConfig">
+ <arg name="pwm_num" type="i" direction="in"/>
+ </method>
+ <signal name="SpeedChanged">
+ <arg name="speed" type="i"/>
+ </signal>
+ <signal name="TachError"/>
+ </interface>
+</node>
+
diff --git a/xml/flash.xml b/xml/flash.xml
new file mode 100644
index 0000000..b1046d2
--- /dev/null
+++ b/xml/flash.xml
@@ -0,0 +1,18 @@
+<node>
+ <!--
+ org.openbmc.Flash:
+ @short_description:
+ -->
+ <interface name="org.openbmc.Flash">
+ <method name="updateViaFile">
+ <arg name="file" type="s" direction="in"/>
+ </method>
+ <method name="updateViaHttp">
+ <arg name="url" type="s" direction="in"/>
+ </method>
+ <method name="erase"/>
+ <method name="init"/>
+ <signal name="Updated"/>
+ </interface>
+</node>
+
diff --git a/xml/fru.xml b/xml/fru.xml
new file mode 100644
index 0000000..17b59a1
--- /dev/null
+++ b/xml/fru.xml
@@ -0,0 +1,19 @@
+<node>
+ <!--
+ org.openbmc.Fru:
+ @short_description:
+ -->
+ <interface name="org.openbmc.Fru">
+ <method name="setState">
+ <arg name="state" type="i" direction="in"/>
+ </method>
+ <method name="getState">
+ <arg name="state" type="i" direction="out"/>
+ </method>
+ <method name="addEventLog">
+ <arg name="entry" type="s" direction="in"/>
+ </method>
+ <signal name="Changed"/>
+ </interface>
+</node>
+
diff --git a/xml/host_control.xml b/xml/host_control.xml
new file mode 100644
index 0000000..30fa990
--- /dev/null
+++ b/xml/host_control.xml
@@ -0,0 +1,7 @@
+<node>
+ <interface name="org.openbmc.HostControl">
+ <method name="boot"/>
+ <method name="shutdown"/>
+ <signal name="booted"/>
+ </interface>
+</node>
diff --git a/xml/ipmi.xml b/xml/ipmi.xml
new file mode 100644
index 0000000..2112343
--- /dev/null
+++ b/xml/ipmi.xml
@@ -0,0 +1,30 @@
+<node>
+ <!--
+ org.openbmc.HostIpmi:
+ @short_description: Watches BT or KCS Interface
+
+ Abstracts IPMI events
+ -->
+ <interface name="org.openbmc.HostIpmi">
+ <method name="sendRawMessage">
+ <arg name="message" type="s" direction="in"/>
+ </method>
+ <signal name="HostStatus">
+ <arg name="status" type="i"/>
+ </signal>
+ <signal name="FirmwareBootStatus">
+ <arg name="status" type="i"/>
+ </signal>
+ <signal name="FruUpdate">
+ <arg name="id" type="i"/>
+ <arg name="state" type="i"/>
+ </signal>
+ <signal name="FunctionalSensorUpdate">
+ <arg name="name" type="s"/>
+ <arg name="state" type="i"/>
+ </signal>
+ <signal name="PowerManagementState">
+ <arg name="state" type="i"/>
+ </signal>
+ </interface>
+</node>
diff --git a/xml/led.xml b/xml/led.xml
new file mode 100644
index 0000000..5519bc2
--- /dev/null
+++ b/xml/led.xml
@@ -0,0 +1,12 @@
+<node>
+ <interface name="org.openbmc.Led">
+ <method name="setOn"/>
+ <method name="setOff"/>
+ <method name="setBlinkSlow"/>
+ <method name="setBlinkFast"/>
+
+ <property name="color" type="i" access="read"/>
+ <property name="function" type="s" access="read"/>
+
+ </interface>
+</node>
diff --git a/xml/parameter.xml b/xml/parameter.xml
new file mode 100644
index 0000000..fb94f38
--- /dev/null
+++ b/xml/parameter.xml
@@ -0,0 +1,25 @@
+<node>
+ <interface name="org.openbmc.Parameters">
+ <!--
+ key/value pairs stored in NVRAM
+ Examples: MAC, power policy, boot order
+ -->
+ <method name="setParameterInt">
+ <arg name="key" type="s" direction="in"/>
+ <arg name="value" type="i" direction="in"/>
+ </method>
+ <method name="getParameterInt">
+ <arg name="key" type="s" direction="in"/>
+ <arg name="value" type="i" direction="out"/>
+ </method>
+ <method name="setParameterString">
+ <arg name="key" type="s" direction="in"/>
+ <arg name="value" type="s" direction="in"/>
+ </method>
+ <method name="getParameterString">
+ <arg name="key" type="s" direction="in"/>
+ <arg name="value" type="s" direction="out"/>
+ </method>
+ <method name="flush"/>
+ </interface>
+</node>
diff --git a/xml/power_control.xml b/xml/power_control.xml
new file mode 100644
index 0000000..480d83b
--- /dev/null
+++ b/xml/power_control.xml
@@ -0,0 +1,20 @@
+<node>
+ <interface name="org.openbmc.PowerControl">
+ <method name="setPowerState">
+ <arg name="trans_id" type="i" direction="in"/>
+ <arg name="state" type="i" direction="in"/>
+ </method>
+ <method name="getPowerState">
+ <arg name="trans_id" type="i" direction="in"/>
+ <arg name="state" type="i" direction="out"/>
+ </method>
+ <signal name="PowerGood">
+ <arg name="trans_id" type="i"/>
+ </signal>
+ <signal name="PowerLost"/>
+ <arg name="trans_id" type="i"/>
+ </signal>
+ <property name="pgood" type="i" access="read"/>
+ <property name="state" type="i" access="read"/>
+ </interface>
+</node>
diff --git a/xml/psu.xml b/xml/psu.xml
new file mode 100644
index 0000000..0d128df
--- /dev/null
+++ b/xml/psu.xml
@@ -0,0 +1,12 @@
+<node>
+ <!--
+ org.openbmc.PSU:
+ @short_description:
+ -->
+ <interface name="org.openbmc.PSU">
+ <signal name="TemperatureError">
+ </signal>
+ <signal name="OverCurrentError">
+ </signal>
+ </interface>
+</node>
diff --git a/xml/sensor.xml b/xml/sensor.xml
new file mode 100644
index 0000000..38ea7cc
--- /dev/null
+++ b/xml/sensor.xml
@@ -0,0 +1,44 @@
+<node>
+ <interface name="org.openbmc.SensorInteger">
+ <method name="getValue">
+ <arg name="value" type="i" direction="out"/>
+ </method>
+ <method name="getUnits">
+ <arg name="units" type="s" direction="out"/>
+ </method>
+ <property name="value" type="i" access="read"/>
+ <property name="units" type="s" access="read"/>
+ <signal name="Changed">
+ <arg name="value" type="i"/>
+ </signal>
+ </interface>
+ <interface name="org.openbmc.SensorString">
+ <method name="getValue">
+ <arg name="value" type="s" direction="out"/>
+ </method>
+ <method name="getUnits">
+ <arg name="units" type="s" direction="out"/>
+ </method>
+ <property name="value" type="i" access="read"/>
+ <property name="units" type="s" access="read"/>
+ <signal name="Changed">
+ <arg name="value" type="s"/>
+ </signal>
+ </interface>
+ <interface name="org.openbmc.SensorIntegerSettable">
+ <method name="getValue">
+ <arg name="value" type="i" direction="out"/>
+ </method>
+ <method name="setValue">
+ <arg name="value" type="i" direction="in"/>
+ </method>
+ <method name="getUnits">
+ <arg name="units" type="s" direction="out"/>
+ </method>
+ <property name="value" type="i" access="read"/>
+ <property name="units" type="s" access="read"/>
+ <signal name="Changed">
+ <arg name="value" type="i"/>
+ </signal>
+ </interface>
+</node>
diff --git a/xml/tmp b/xml/tmp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xml/tmp
diff --git a/xml/watchdog.xml b/xml/watchdog.xml
new file mode 100644
index 0000000..90138ba
--- /dev/null
+++ b/xml/watchdog.xml
@@ -0,0 +1,12 @@
+<node>
+ <!--
+ org.openbmc.Watchdog:
+ @short_description:
+ -->
+ <interface name="org.openbmc.Watchdog">
+ <method name="update"/>
+ <method name="start"/>
+ <method name="stop"/>
+ </interface>
+</node>
+