/* Read sensor data. 
If scaled data format is selected for the device, this routine gets a compensated "true pressure" sample using the sampling mode specified when the device was initialized. Otherwise a raw uncompensated pressure reading is returned in "data". */
static bool bmp_read(sensor_t *sensor, sensor_read_t type, sensor_data_t *data)
/* Read sensor data. 
If scaled data format is selected for the device, this routine gets a compensated "true pressure" sample using the sampling mode specified when the device was initialized. Otherwise a raw uncompensated pressure reading is returned in "data". */
static bool bmp_read(sensor_t *sensor, sensor_read_t type, sensor_data_t *data)
{
	switch (type) {
	case SENSOR_READ_PRESSURE:
		return bmp_get_pressure(sensor->hal, data);
	case SENSOR_READ_TEMPERATURE:
		return bmp_get_temperature(sensor->hal, data);
	case SENSOR_READ_ID:
		return bmp_device_id(sensor->hal, data);
	default:
		sensor->err = SENSOR_ERR_FUNCTION;
		return false;
	}
}