Commit 17104348 authored by spiiroin's avatar spiiroin

[mce-sensorfw] Refactor mce - sensorfwd IPC. JB#41369

So far MCE has utilized only three sensors - all of which report a single
unsigned integer value. This has allowed code to organically grow in to a
form that requires numerous glue functions for each sensor type and is
ill-prepared for handling sensors that report vector form data.

Reduce the amount of glue functions that needs to be implemented for each
supported sensor type and stop assuming sensor data will be a single integer
value.

Handle situations where the standby-override attribute is not supported for
an otherwise functioning sensor.

Do not attempt to start mce-starting-up exceptional situation before the
objects required by such operation have been created.

Also fix spelling of some constants from SWF_xxx to SFW_xxx.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent c1fb3a29
......@@ -258,6 +258,7 @@ CFLAGS += -Wmissing-format-attribute
CFLAGS += -Wstack-protector
#CFLAGS += -Werror (OBS build might have different compiler)
CFLAGS += -Wno-declaration-after-statement
CFLAGS += -Wno-missing-field-initializers
# Linker
LDLIBS += -Wl,--as-needed
......
......@@ -402,8 +402,8 @@ static gboolean dbus_init_message_handler (void);
const char *mce_dbus_type_repr (int type);
bool mce_dbus_iter_at_end (DBusMessageIter *iter);
static bool mce_dbus_iter_req_type (DBusMessageIter *iter, int want);
static bool mce_dbus_iter_get_basic (DBusMessageIter *iter, void *pval, int type);
bool mce_dbus_iter_req_type (DBusMessageIter *iter, int want);
bool mce_dbus_iter_get_basic (DBusMessageIter *iter, void *pval, int type);
bool mce_dbus_iter_get_object (DBusMessageIter *iter, const char **pval);
bool mce_dbus_iter_get_string (DBusMessageIter *iter, const char **pval);
bool mce_dbus_iter_get_bool (DBusMessageIter *iter, bool *pval);
......@@ -4475,7 +4475,7 @@ mce_dbus_iter_at_end(DBusMessageIter *iter)
*
* @return true if iterator points to expected type, false otherwise
*/
static bool
bool
mce_dbus_iter_req_type(DBusMessageIter *iter, int want)
{
int have = dbus_message_iter_get_arg_type(iter);
......@@ -4500,7 +4500,7 @@ mce_dbus_iter_req_type(DBusMessageIter *iter, int want)
*
* @return true if iterator points to expected type, false otherwise
*/
static bool
bool
mce_dbus_iter_get_basic(DBusMessageIter *iter, void *pval, int type)
{
if( !dbus_type_is_basic(type) ) {
......
......@@ -196,6 +196,8 @@ char *mce_dbus_message_repr(DBusMessage *const msg);
char *mce_dbus_message_iter_repr(DBusMessageIter *iter);
bool mce_dbus_iter_at_end(DBusMessageIter *iter);
bool mce_dbus_iter_req_type(DBusMessageIter *iter, int want);
bool mce_dbus_iter_get_basic(DBusMessageIter *iter, void *pval, int type);
bool mce_dbus_iter_get_object(DBusMessageIter *iter, const char **pval);
bool mce_dbus_iter_get_string(DBusMessageIter *iter, const char **pval);
bool mce_dbus_iter_get_bool(DBusMessageIter *iter, bool *pval);
......
This diff is collapsed.
......@@ -53,22 +53,26 @@ digraph mce_sensorfw
OVERRIDE_DISABLING;
OVERRIDE_DISABLED;
OVERRIDE_ERROR;
OVERRIDE_NA;
OVERRIDE_ANY [label="*"];
OVERRIDE_ANY -> OVERRIDE_ERROR [label="failure"];
OVERRIDE_ANY -> OVERRIDE_IDLE [label="reset()"];
OVERRIDE_ANY -> OVERRIDE_ERROR [label="failure"];
OVERRIDE_ANY -> OVERRIDE_IDLE [label="reset()"];
OVERRIDE_IDLE -> OVERRIDE_RETHINK [label="connected"];
OVERRIDE_IDLE -> OVERRIDE_RETHINK [label="connected"];
OVERRIDE_RETHINK -> OVERRIDE_ENABLING;
OVERRIDE_RETHINK -> OVERRIDE_DISABLING;
OVERRIDE_ENABLING -> OVERRIDE_ENABLED;
OVERRIDE_ENABLED -> OVERRIDE_RETHINK [label="disable()"];
OVERRIDE_DISABLING -> OVERRIDE_DISABLED;
OVERRIDE_DISABLED -> OVERRIDE_RETHINK [label="enable()"];
OVERRIDE_ENABLING -> OVERRIDE_ENABLED [label="ack"];
OVERRIDE_ENABLED -> OVERRIDE_RETHINK [label="disable()"];
OVERRIDE_DISABLING -> OVERRIDE_DISABLED [label="ack"];
OVERRIDE_DISABLED -> OVERRIDE_RETHINK [label="enable()"];
OVERRIDE_ERROR -> OVERRIDE_RETHINK [label="retry"];
OVERRIDE_ERROR -> OVERRIDE_RETHINK [label="retry"];
OVERRIDE_ENABLING -> OVERRIDE_NA [label="nak"];
OVERRIDE_DISABLING -> OVERRIDE_NA [label="nak"];
}
subgraph clusterCONNECTION {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment