Skip to content

Commit

Permalink
[mce-sensorfw] Refactor mce - sensorfwd IPC. JB#41369
Browse files Browse the repository at this point in the history
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: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed May 28, 2018
1 parent c1fb3a2 commit 1710434
Show file tree
Hide file tree
Showing 5 changed files with 672 additions and 590 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions mce-dbus.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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) ) {
Expand Down
2 changes: 2 additions & 0 deletions mce-dbus.h
Expand Up @@ -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);
Expand Down

0 comments on commit 1710434

Please sign in to comment.