/** * TODO file description * * Created on 2021/12/13. */ #ifndef ESPNODE_DATA_REPORT_H #define ESPNODE_DATA_REPORT_H #include #include #include #include #include struct data_report { bool iaq_ready; uint32_t iaq_timestamp; float iaq; float iaq_static; float iaq_co2_ppm_equiv; float iaq_voc_ppm_equiv; bool thpg_ready; uint32_t thpg_timestamp; float temperature; float pressure; float humidity; float gasr; bool co2_ready; uint32_t co2_timestamp; float co2_ppm; }; static inline uint32_t timestamp_age(uint32_t ticks) { return xTaskGetTickCount() - ticks; } #define DATA_MAX_AGE (pdMS_TO_TICKS(60000)) extern SemaphoreHandle_t g_mux_data_report; extern struct data_report g_data_report; #endif //ESPNODE_DATA_REPORT_H