/** Broadcast faked lid input state within mce * * @param state COVER_CLOSED, COVER_OPEN or COVER_UNDEF */ static void report_lid_input(cover_state_t state) { cover_state_t old_state = datapipe_get_gint(lid_cover_sensor_pipe); if( state != old_state ) { mce_log(LL_NOTICE, "state: %s -> %s", cover_state_repr(old_state), cover_state_repr(state)); execute_datapipe(&lid_cover_sensor_pipe, GINT_TO_POINTER(state), USE_INDATA, CACHE_INDATA); } }
/** Broadcast proximity state within MCE * * @param state COVER_CLOSED or COVER_OPEN */ static void report_proximity(cover_state_t state) { /* Get current proximity datapipe value */ cover_state_t old_state = datapipe_get_gint(proximity_sensor_pipe); /* Execute datapipe if state has changed */ if( old_state != state ) { mce_log(LL_NOTICE, "state: %s -> %s", cover_state_repr(old_state), cover_state_repr(state)); execute_datapipe(&proximity_sensor_pipe, GINT_TO_POINTER(state), USE_INDATA, CACHE_INDATA); } }
/** Broadcast proximity state within MCE * * @param state COVER_CLOSED or COVER_OPEN */ static void report_proximity(cover_state_t state) { /* Get current proximity datapipe value */ cover_state_t old_state = datapipe_get_gint(proximity_sensor_pipe); /* Execute datapipe if state has changed */ /* FIXME: figure out where things break down if we do not * omit the non-change datapipe execute ... */ //if( old_state != state ) { mce_log(LL_NOTICE, "state: %s -> %s", cover_state_repr(old_state), cover_state_repr(state)); execute_datapipe(&proximity_sensor_pipe, GINT_TO_POINTER(state), USE_INDATA, CACHE_INDATA); } /* Update last-seen proximity state */ old_proximity_sensor_state = state; }