/* This internal API reads the calibration data from the sensor, parse it and store in the device structure.  */
static int8_t get_calib_data(struct bme280_dev *dev)
/* This internal API reads the calibration data from the sensor, parse it and store in the device structure.  */
static int8_t get_calib_data(struct bme280_dev *dev)
{
    int8_t rslt;
    uint8_t reg_addr = BME280_TEMP_PRESS_CALIB_DATA_ADDR;
    uint8_t calib_data[BME280_TEMP_PRESS_CALIB_DATA_LEN] = { 0 };
    rslt = bme280_get_regs(reg_addr, calib_data, BME280_TEMP_PRESS_CALIB_DATA_LEN, dev);
    if (rslt == BME280_OK)
    {
        parse_temp_press_calib_data(calib_data, dev);
        reg_addr = BME280_HUMIDITY_CALIB_DATA_ADDR;
        rslt = bme280_get_regs(reg_addr, calib_data, BME280_HUMIDITY_CALIB_DATA_LEN, dev);
        if (rslt == BME280_OK)
        {
            parse_humidity_calib_data(calib_data, dev);
        }
    }
    return rslt;
}