/* This API gets the power mode of the sensor.  */
int8_t bme280_get_sensor_mode(uint8_t *sensor_mode, struct bme280_dev *dev)
/* This API gets the power mode of the sensor.  */
int8_t bme280_get_sensor_mode(uint8_t *sensor_mode, struct bme280_dev *dev)
{
    int8_t rslt;
    rslt = null_ptr_check(dev);
    if ((rslt == BME280_OK) && (sensor_mode != NULL))
    {
        rslt = bme280_get_regs(BME280_PWR_CTRL_ADDR, sensor_mode, 1, dev);
        *sensor_mode = BME280_GET_BITS_POS_0(*sensor_mode, BME280_SENSOR_MODE);
    }
    else
    {
        rslt = BME280_E_NULL_PTR;
    }
    return rslt;
}