lots of changes
diff --git a/bin/System/Barreleye.py b/bin/System/Barreleye.py
index dd9d1fa..364a280 100644
--- a/bin/System/Barreleye.py
+++ b/bin/System/Barreleye.py
@@ -3,9 +3,20 @@
def BarreleyeProcesses():
config = {}
+ config['org.openbmc.control.Power'] = {
+ 'exe_name' : 'bin/power_control.exe',
+ 'heartbeat' : 'no',
+ 'instances' : [
+ {
+ 'name' : 'PowerControl1',
+ 'user_label': 'Power control',
+ }
+ ]
+ }
+
config['org.openbmc.sensors.Temperature.Ambient'] = {
'exe_name' : 'bin/sensor_ambient.exe',
- 'watchdog' : "yes",
+ 'heartbeat' : "yes",
'instances' : [
{
'name' : 'AmbientTemperature1',
@@ -31,7 +42,7 @@
}
config['org.openbmc.buttons.ButtonPower'] = {
'exe_name' : 'bin/button_power.exe',
- 'watchdog' : 'no',
+ 'heartbeat' : 'no',
'instances' : [
{
'name' : 'PowerButton1',
@@ -39,16 +50,56 @@
}
]
}
- config['org.openbmc.leds.ChassisIdentify'] = {
- 'exe_name' : 'bin/chassis_identify.exe',
- 'watchdog' : "no",
+ config['org.openbmc.sensors.HostStatus'] = {
+ 'exe_name' : 'bin/sensor_host_status.exe',
+ 'heartbeat' : "no",
'instances' : [
{
- 'name' : 'ChassisIdentify',
+ 'name' : 'HostStatus1',
+ 'user_label': 'Host Status',
+ }
+ ]
+ }
+ config['org.openbmc.leds.ChassisIdentify'] = {
+ 'exe_name' : 'bin/chassis_identify.exe',
+ 'heartbeat' : "no",
+ 'instances' : [
+ {
+ 'name' : 'ChassisIdentify1',
'user_label': 'Chassis Identify LED',
}
]
}
+ config['org.openbmc.flash.BIOS'] = {
+ 'exe_name' : 'bin/flash_bios.exe',
+ 'heartbeat' : "no",
+ 'instances' : [
+ {
+ 'name' : 'BIOS1',
+ 'user_label': 'BIOS SPI Flash',
+ }
+ ]
+ }
+ config['org.openbmc.control.Host'] = {
+ 'exe_name' : 'bin/control_host.exe',
+ 'heartbeat' : "no",
+ 'instances' : [
+ {
+ 'name' : 'HostControl1',
+ 'user_label': 'Host Control',
+ }
+ ]
+ }
+ config['org.openbmc.control.Chassis'] = {
+ 'exe_name' : 'bin/chassis_control.py',
+ 'heartbeat' : "no",
+ 'instances' : [
+ {
+ 'name' : 'Chassis',
+ 'user_label': 'Chassis Control',
+ }
+ ]
+ }
return config
@@ -61,6 +112,8 @@
gpio['POWER_PIN'] = { 'gpio_num': 26, 'direction': 'out' }
gpio['CRONUS_SEL'] = { 'gpio_num': 27, 'direction': 'out' }
gpio['PGOOD'] = { 'gpio_num': 28, 'direction': 'in' }
+ gpio['IDENTIFY'] = { 'gpio_num': 30, 'direction': 'out' }
+ gpio['POWER_BUTTON'] = { 'gpio_num': 31, 'direction': 'in' }
return gpio
diff --git a/bin/System/__init__.py b/bin/System/__init__.py
index f95b8ee..0cb7ef8 100644
--- a/bin/System/__init__.py
+++ b/bin/System/__init__.py
@@ -1,2 +1,2 @@
-from Barreleye import BarreleyeSensors
+from Barreleye import BarreleyeProcesses
from Barreleye import BarreleyeGpios
diff --git a/objects/openbmc_utilities.c b/objects/openbmc_utilities.c
deleted file mode 100644
index d03fdb4..0000000
--- a/objects/openbmc_utilities.c
+++ /dev/null
@@ -1,137 +0,0 @@
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <argp.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-
-#include "interfaces/power_control.h"
-#include "objects/openbmc_utilities.h"
-
-void gpio_writec(GPIO* gpio, char value)
-{
- char buf[1];
- buf[0] = value;
- if (write(gpio->fd, buf, 1) != 1)
- {
- //TODO: error handling
- printf("Write error\n");
- }
-}
-
-void gpio_write(GPIO* gpio, uint8_t value)
-{
- char buf[1];
- buf[0] = '0';
- if (value==1)
- {
- buf[0]='1';
- }
- if (write(gpio->fd, buf, 1) != 1)
- {
- //TODO: error handling
- printf("write error\n");
- }
-}
-
-uint8_t gpio_read(GPIO* gpio)
-{
- char buf[1];
- if (read(gpio->fd,&buf,1) != 1)
- {
- //TODO: error hjandling
- printf("read error\n");
- }
- if (buf[0]=='1') {
- return 1;
- }
- return 0;
-
-}
-void gpio_clock_cycle(GPIO* gpio, int num_clks) {
- int i=0;
- for (i=0;i<num_clks;i++) {
- gpio_writec(gpio,'0');
- gpio_writec(gpio,'1');
- }
-}
-
-// Gets the gpio device path from gpio manager object
-void gpio_init(GDBusConnection *connection, GPIO* gpio)
-{
- GDBusProxy *proxy;
- GError *error;
- GVariant *result;
-
- error = NULL;
- g_assert_no_error (error);
- error = NULL;
- proxy = g_dbus_proxy_new_sync (connection,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL, /* GDBusInterfaceInfo */
- "org.openbmc.managers.Gpios", /* name */
- "/org/openbmc/managers/Gpios", /* object path */
- "org.openbmc.managers.Gpios", /* interface */
- NULL, /* GCancellable */
- &error);
- g_assert_no_error (error);
-
- result = g_dbus_proxy_call_sync (proxy,
- "init",
- g_variant_new ("(s)", gpio->name),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error);
-
- g_assert_no_error (error);
- g_assert (result != NULL);
- g_variant_get (result, "(&si&s)", &gpio->dev,&gpio->num,&gpio->direction);
- g_print("GPIO Lookup: %s = %d,%s\n",gpio->name,gpio->num,gpio->direction);
-
- //export and set direction
- char dev[254];
- char data[4];
- sprintf(dev,"%s/export",gpio->dev);
- int fd = open(dev, O_WRONLY);
- sprintf(data,"%d",gpio->num);
- write(fd,data,strlen(data));
- close(fd);
-
- sprintf(dev,"%s/gpio%d/direction",gpio->dev,gpio->num);
- fd = open(dev,O_WRONLY);
- write(fd,gpio->direction,strlen(gpio->direction));
- close(fd);
-
-
-}
-int gpio_open(GPIO* gpio)
-{
- // open gpio for writing or reading
- char buf[254];
- if (strcmp(gpio->direction,"in")==0)
- {
- sprintf(buf, "%s/gpio%d/value", gpio->dev, gpio->num);
- gpio->fd = open(buf, O_RDONLY);
- }
- else
- {
- sprintf(buf, "%s/gpio%d/value", gpio->dev, gpio->num);
- gpio->fd = open(buf, O_WRONLY);
-
- }
- if (gpio->fd == -1)
- {
- printf("error opening: %s\n",buf);
- }
- return gpio->fd;
-}
-
-void gpio_close(GPIO* gpio)
-{
- close(gpio->fd);
-}
diff --git a/objects/openbmc_utilities.h b/objects/openbmc_utilities.h
deleted file mode 100644
index 1aa2032..0000000
--- a/objects/openbmc_utilities.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#include <stdint.h>
-
-typedef struct {
- gchar* name;
- gchar* dev;
- uint16_t num;
- gchar* direction;
- int fd;
-} GPIO;
-
-
-//gpio functions
-void gpio_init(GDBusConnection*, GPIO*);
-void gpio_close(GPIO*);
-int gpio_open(GPIO*);
-void gpio_write(GPIO*, uint8_t);
-void gpio_writec(GPIO*, char);
-void gpio_clock_cycle(GPIO*, int);
-uint8_t gpio_read(GPIO*);
-
-
-
diff --git a/objects/power_control_obj.c b/objects/power_control_obj.c
index 26006b4..5d3315f 100644
--- a/objects/power_control_obj.c
+++ b/objects/power_control_obj.c
@@ -167,9 +167,11 @@
main (gint argc, gchar *argv[])
{
GMainLoop *loop;
+ cmdline cmd;
+ cmd.argc = argc;
+ cmd.argv = argv;
guint id;
- //g_type_init ();
loop = g_main_loop_new (NULL, FALSE);
id = g_bus_own_name (G_BUS_TYPE_SESSION,
@@ -179,7 +181,7 @@
on_bus_acquired,
on_name_acquired,
on_name_lost,
- loop,
+ &cmd,
NULL);
g_timeout_add(5000, poll_pgood, NULL);
diff --git a/objects/sensor_temperature_ambient_obj.c b/objects/sensor_temperature_ambient_obj.c
index b1271e9..15e5f67 100644
--- a/objects/sensor_temperature_ambient_obj.c
+++ b/objects/sensor_temperature_ambient_obj.c
@@ -25,11 +25,10 @@
//TOOD: Change to actually read sensor
value = value+1;
- if (heartbeat > 10000)
+ if (heartbeat > 30000)
{
heartbeat = 0;
- g_print(">>> Send Heartbeat\n");
- sensor_integer_emit_heartbeat(sensor);
+ sensor_integer_emit_heartbeat(sensor,dbus_name);
}
else
{
@@ -37,12 +36,11 @@
}
// End actually reading sensor
- g_print("Polling sensor: %d\n",value);
//if changed, set property and emit signal
if (value != sensor_integer_get_value(sensor))
{
- g_print("Sensor changed\n");
+ //g_print("Sensor changed\n");
sensor_integer_set_value(sensor,value);
sensor_integer_emit_changed(sensor,value);
check_thresholds(threshold,value);
diff --git a/xml/sensor.xml b/xml/sensor.xml
index 40bf73d..a0988c9 100644
--- a/xml/sensor.xml
+++ b/xml/sensor.xml
@@ -22,6 +22,9 @@
<method name="getThresholdState">
<arg name="threshold_state" type="i" direction="out"/>
</method>
+ <method name="getWatchdog">
+ <arg name="watchdog" type="i" direction="out"/>
+ </method>
<property name="value" type="i" access="read"/>
<property name="units" type="s" access="read"/>
@@ -34,7 +37,8 @@
<property name="poll_interval" type="i" access="read"/>
<property name="config_data" type="as" access="read"/>
- <property name="changed_tolerance" type="i" access="read"/>
+
+ <property name="watchdog" type="i" access="read"/>
<signal name="Changed">
<arg name="value" type="i"/>
@@ -71,25 +75,4 @@
<arg name="value" type="i"/>
</signal>
</interface>
- <interface name="org.openbmc.SensorIntegerThreshold">
- <method name="check">
- <arg name="value" type="i" direction="in"/>
- </method>
- <method name="setThresholds">
- <arg name="critical_upper" type="i" direction="in"/>
- <arg name="critical_lower" type="i" direction="in"/>
- <arg name="warning_upper" type="i" direction="in"/>
- <arg name="warning_lower" type="i" direction="in"/>
- </method>
- <signal name="critical">
- <arg name="over" type="b"/>
- </signal>
- <signal name="warning">
- <arg name="over" type="b"/>
- </signal>
- <property name="critical_upper" type="i" access="read"/>
- <property name="critical_lower" type="i" access="read"/>
- <property name="warning_upper" type="i" access="read"/>
- <property name="warning_lower" type="i" access="read"/>
- </interface>
</node>