added ObjectAdded signal
diff --git a/objects/fan_generic_obj.c b/objects/fan_generic_obj.c
index afe3318..fb61c5c 100644
--- a/objects/fan_generic_obj.c
+++ b/objects/fan_generic_obj.c
@@ -1,6 +1,6 @@
#include "interfaces/openbmc_intf.h"
#include "openbmc.h"
-
+#include "object_mapper.h"
/* ---------------------------------------------------------------------------------------------------- */
@@ -66,6 +66,10 @@
object_skeleton_set_fan (object, fan);
g_object_unref (fan);
+ ObjectMapper* mapper = object_mapper_skeleton_new ();
+ object_skeleton_set_object_mapper (object, mapper);
+ g_object_unref (mapper);
+
//define method callbacks here
g_signal_connect (fan,
"handle-get-speed",
@@ -85,6 +89,7 @@
/* Export all objects */
g_dbus_object_manager_server_set_connection (manager, connection);
+ emit_object_added((GDBusObjectManager*)manager);
}
static void
diff --git a/objects/flash_bios_obj.c b/objects/flash_bios_obj.c
index 4b82d67..738ba86 100644
--- a/objects/flash_bios_obj.c
+++ b/objects/flash_bios_obj.c
@@ -3,6 +3,7 @@
#include <string.h>
#include "interfaces/openbmc_intf.h"
#include "openbmc.h"
+#include "object_mapper.h"
/* ---------------------------------------------------------------------------------------------------- */
static const gchar* dbus_object_path = "/org/openbmc/control/flash";
@@ -307,6 +308,10 @@
object_skeleton_set_shared_resource (object, lock);
g_object_unref (lock);
+ ObjectMapper* mapper = object_mapper_skeleton_new ();
+ object_skeleton_set_object_mapper (object, mapper);
+ g_object_unref (mapper);
+
shared_resource_set_lock(lock,false);
shared_resource_set_name(lock,"");
@@ -378,6 +383,7 @@
g_free(flasher_file);
/* Export all objects */
g_dbus_object_manager_server_set_connection (manager, connection);
+ emit_object_added((GDBusObjectManager*)manager);
}
static void
diff --git a/objects/host_watchdog_obj.c b/objects/host_watchdog_obj.c
index 13208e2..a4651ea 100644
--- a/objects/host_watchdog_obj.c
+++ b/objects/host_watchdog_obj.c
@@ -1,6 +1,6 @@
#include "interfaces/openbmc_intf.h"
#include "openbmc.h"
-
+#include "object_mapper.h"
/* ---------------------------------------------------------------------------------------------------- */
@@ -98,6 +98,10 @@
Watchdog *wd = watchdog_skeleton_new ();
object_skeleton_set_watchdog (object, wd);
g_object_unref (wd);
+
+ ObjectMapper* mapper = object_mapper_skeleton_new ();
+ object_skeleton_set_object_mapper (object, mapper);
+ g_object_unref (mapper);
// set properties
watchdog_set_watchdog(wd,1);
@@ -129,6 +133,7 @@
/* Export all objects */
g_dbus_object_manager_server_set_connection (manager, connection);
+ emit_object_added((GDBusObjectManager*)manager);
}
static void
diff --git a/objects/power_control_obj.c b/objects/power_control_obj.c
index 97d1021..5421074 100644
--- a/objects/power_control_obj.c
+++ b/objects/power_control_obj.c
@@ -10,6 +10,7 @@
#include "interfaces/openbmc_intf.h"
#include "openbmc.h"
#include "gpio.h"
+#include "object_mapper.h"
/* ---------------------------------------------------------------------------------------------------- */
static const gchar* dbus_object_path = "/org/openbmc/control";
@@ -19,6 +20,9 @@
//This object will use these GPIOs
GPIO power_pin = (GPIO){ "POWER_PIN" };
GPIO pgood = (GPIO){ "PGOOD" };
+GPIO usb_reset = (GPIO){ "USB_RESET" };
+GPIO pcie_reset = (GPIO){ "PCIE_RESET" };
+
static GDBusObjectManagerServer *manager = NULL;
@@ -66,11 +70,26 @@
{
control_power_emit_power_lost(control_power);
control_emit_goto_system_state(control,"HOST_POWERED_OFF");
+ rc = gpio_open(&pcie_reset);
+ rc = gpio_write(&pcie_reset,0);
+ gpio_close(&pcie_reset);
+
+ rc = gpio_open(&usb_reset);
+ rc = gpio_write(&usb_reset,0);
+ gpio_close(&usb_reset);
+
}
else
{
control_power_emit_power_good(control_power);
control_emit_goto_system_state(control,"HOST_POWERED_ON");
+ rc = gpio_open(&pcie_reset);
+ rc = gpio_write(&pcie_reset,1);
+ gpio_close(&pcie_reset);
+
+ rc = gpio_open(&usb_reset);
+ rc = gpio_write(&usb_reset,1);
+ gpio_close(&usb_reset);
}
}
} else {
@@ -188,6 +207,10 @@
object_skeleton_set_control (object, control);
g_object_unref (control);
+ ObjectMapper* mapper = object_mapper_skeleton_new ();
+ object_skeleton_set_object_mapper (object, mapper);
+ g_object_unref (mapper);
+
//define method callbacks here
g_signal_connect (control_power,
"handle-set-power-state",
@@ -219,6 +242,11 @@
if (rc != GPIO_OK) { break; }
rc = gpio_init(connection,&pgood);
if (rc != GPIO_OK) { break; }
+ rc = gpio_init(connection,&pcie_reset);
+ if (rc != GPIO_OK) { break; }
+ rc = gpio_init(connection,&usb_reset);
+ if (rc != GPIO_OK) { break; }
+
uint8_t gpio;
rc = gpio_open(&pgood);
if (rc != GPIO_OK) { break; }
@@ -227,6 +255,7 @@
gpio_close(&pgood);
control_power_set_pgood(control_power,gpio);
printf("Pgood state: %d\n",gpio);
+
} while(0);
if (rc != GPIO_OK)
{
@@ -243,7 +272,7 @@
control_power_set_pgood_timeout(control_power,pgood_timeout);
g_timeout_add(poll_interval, poll_pgood, object);
}
-
+ emit_object_added((GDBusObjectManager*)manager);
}
static void