117 const uint8_t
byte = this->
data_[index];
119 if (index == 0 || index == 1) {
120 const uint8_t start_char = index == 0 ? START_CHARACTER_1 : START_CHARACTER_2;
121 if (
byte == start_char) {
125 ESP_LOGW(TAG,
"Start character %u mismatch: 0x%02X != 0x%02X", index + 1,
byte, START_CHARACTER_1);
138 ESP_LOGW(TAG,
"Payload length %u doesn't match. Are you using the correct PMSX003 type?", payload_length);
144 const uint16_t total_size = 4 + payload_length;
146 if (index < total_size - 1) {
152 for (uint16_t i = 0; i < total_size - 2; i++) {
158 ESP_LOGW(TAG,
"PMSX003 checksum mismatch! 0x%02X != 0x%02X",
checksum, check);
222 "Got PM1.0 Standard Concentration: %u µg/m³, PM2.5 Standard Concentration %u µg/m³, PM10.0 Standard "
223 "Concentration: %u µg/m³, PM1.0 Concentration: %u µg/m³, PM2.5 Concentration %u µg/m³, PM10.0 "
224 "Concentration: %u µg/m³",
225 pm_1_0_std_concentration, pm_2_5_std_concentration, pm_10_0_std_concentration, pm_1_0_concentration,
226 pm_2_5_concentration, pm_10_0_concentration);
253 "Got PM0.3 Particles: %u Count/0.1L, PM0.5 Particles: %u Count/0.1L, PM1.0 Particles: %u Count/0.1L, "
254 "PM2.5 Particles %u Count/0.1L",
255 pm_particles_03um, pm_particles_05um, pm_particles_10um, pm_particles_25um);
263 "Got PM0.3 Particles: %u Count/0.1L, PM0.5 Particles: %u Count/0.1L, PM1.0 Particles: %u Count/0.1L, "
264 "PM2.5 Particles %u Count/0.1L, PM5.0 Particles: %u Count/0.1L, PM10.0 Particles %u Count/0.1L",
265 pm_particles_03um, pm_particles_05um, pm_particles_10um, pm_particles_25um, pm_particles_50um,
278 ESP_LOGD(TAG,
"Got Formaldehyde: %u µg/m^3", formaldehyde);
289 const float humidity = this->
get_16_bit_uint_(temperature_offset + 2) / 10.0f;
291 ESP_LOGD(TAG,
"Got Temperature: %.1f°C, Humidity: %.1f%%",
temperature, humidity);
301 const uint8_t firmware_version = this->
data_[36];
302 const uint8_t error_code = this->
data_[37];
304 ESP_LOGD(TAG,
"Got Firmware Version: 0x%02X, Error Code: 0x%02X", firmware_version, error_code);