/* Set a sensor mode. 
These execution states are not supported in all devices. The function return value will indicate whether or not the request could be processed. The result of the request, when supported, is device dependent. */
bool sensor_set_state(sensor_t *sensor, sensor_state_t mode)
/* Set a sensor mode. 
These execution states are not supported in all devices. The function return value will indicate whether or not the request could be processed. The result of the request, when supported, is device dependent. */
bool sensor_set_state(sensor_t *sensor, sensor_state_t mode)
{
	bool result = false;
	if (mode != sensor->mod) {
		result
			= SENSOR_DRV_CALL(sensor, ioctl, SENSOR_SET_STATE,
				&mode);
	}
	if (result) {
		sensor->mod
			= (mode ==
				SENSOR_STATE_RESET) ? SENSOR_STATE_NORMAL : mode;
	}
	return result;
}