Exemplo n.º 1
0
/** 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);
    }
}
Exemplo n.º 2
0
/** 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);
    }
}
Exemplo n.º 3
0
Arquivo: proximity.c Projeto: g7/mce
/** 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;
}