|
|
@ -25,29 +25,58 @@ |
|
|
|
namespace iflytop { |
|
|
|
using namespace std; |
|
|
|
|
|
|
|
#pragma pack(1)
|
|
|
|
typedef struct { |
|
|
|
uint16_t hydrogen_peroxide_volume; // ppm 0x0100
|
|
|
|
uint16_t h2o_h2o2_rs; // %RS * 100
|
|
|
|
uint16_t temperature1; // °C * 100
|
|
|
|
uint16_t relative_humidity; // %RH * 100
|
|
|
|
uint16_t absolute_hydrogen_peroxide; // mg/m3
|
|
|
|
uint16_t h2o_h2o2dew_point_temperature; // °C * 100
|
|
|
|
uint16_t reserved1; //
|
|
|
|
uint16_t water_volume; // ppm
|
|
|
|
uint16_t water_vapor_pressure; // hpa
|
|
|
|
uint16_t absolute_humidity; // g/m3
|
|
|
|
uint16_t water_vapor_saturation_pressure_h2o; // hpa
|
|
|
|
uint16_t temperature2; // °C * 100
|
|
|
|
uint16_t h2o2_vapor_pressure; // hpa
|
|
|
|
uint16_t water_vapor_saturation_pressure_h2o_h2o2; // hpa
|
|
|
|
} hpp272_data_t; |
|
|
|
#pragma pack()
|
|
|
|
|
|
|
|
class HPP272 { |
|
|
|
public: |
|
|
|
typedef struct { |
|
|
|
uint8_t precision; |
|
|
|
uint8_t pressure_unit; |
|
|
|
int16_t value; |
|
|
|
int16_t zero_point; |
|
|
|
int16_t range_full_point; |
|
|
|
} sensor_data_t; |
|
|
|
|
|
|
|
private: |
|
|
|
/* data */ |
|
|
|
|
|
|
|
ModbusBlockHost modbusBlockHost; |
|
|
|
uint8_t id; |
|
|
|
|
|
|
|
/**
|
|
|
|
* |
|
|
|
* 0100 ppm Vaporized hydrogen peroxide concentration by volume |
|
|
|
* 0101 %RS * 100 H2O+H2O2 relative saturation |
|
|
|
* 0102 °C * 100 Temperature used for calculation. By default, shows the temperature from the temperature probe |
|
|
|
* 0103 %RH * 100 Relative humidity |
|
|
|
* 0104 mg/m3 Absolute hydrogen peroxide |
|
|
|
* 0105 °C * 100 H2O+H2O2 dew point temperature |
|
|
|
* 0106 |
|
|
|
* 0107 ppm ppm Water concentration by volume |
|
|
|
* 0108 hPa Water vapor pressure |
|
|
|
* 0109 g/m3 Absolute humidity (water) |
|
|
|
* 010A hPa Water vapor saturation pressure (H2O) |
|
|
|
* 010B °C * 100 Temperature from the temperature probe |
|
|
|
* 010C hPa H2O2 vapor pressure |
|
|
|
* 010D hPa Water vapor saturation pressure (H2O+H2O2) |
|
|
|
* |
|
|
|
*/ |
|
|
|
hpp272_data_t datacache; |
|
|
|
|
|
|
|
public: |
|
|
|
HPP272(/* args */); |
|
|
|
~HPP272(); |
|
|
|
|
|
|
|
void initialize(UART_HandleTypeDef *huart, uint8_t id); |
|
|
|
bool readVal(sensor_data_t *data); |
|
|
|
void initialize(UART_HandleTypeDef* huart, uint8_t id); |
|
|
|
hpp272_data_t* readVal(); |
|
|
|
}; |
|
|
|
|
|
|
|
} // namespace iflytop
|