/* This function reads the baro data and reports the data */
static int drv_baro_bosch_bmp380_read(void *buf, size_t len)
/* This function reads the baro data and reports the data */
static int drv_baro_bosch_bmp380_read(void *buf, size_t len)
{
    int    ret = 0;
    size_t size = 0;
    barometer_data_t* pdata = (barometer_data_t*)buf;
    if (buf == NULL) {
        return -1;
    }
    size = sizeof(barometer_data_t);
    if (len < size) {
        return -1;
    }
    ret = drv_baro_bosch_bmp380_cali_temp(&bmp380_ctx);
    if (unlikely(ret) != 0) {
        return -1;
    }
    ret = drv_baro_bosch_bmp380_read_baro(&bmp380_ctx, pdata);
    if (unlikely(ret) != 0) {
        return -1;
    }
    pdata->timestamp = aos_now_ms();
    return (int)size;
}