@@ -144,21 +144,18 @@ class ws_uart_drv_pm25aqi : public ws_uart_drv {
144
144
wippersnapper_signal_v1_UARTResponse_init_zero;
145
145
msgUARTResponse.which_payload =
146
146
wippersnapper_signal_v1_UARTResponse_resp_uart_device_event_tag;
147
- // We'll be sending back six sensor_events: pm10_standard, pm25_standard,
148
- // pm100_standard, pm10_env, pm25_env, and pm100_env
149
- msgUARTResponse.payload .resp_uart_device_event .sensor_event_count = 6 ;
150
- Serial.print (" Device ID: " );
151
- Serial.println (getDriverID ());
152
147
strcpy (msgUARTResponse.payload .resp_uart_device_event .device_id ,
153
- " pm1006 " ); // TODO: Change to non-fixed value
148
+ getDriverID ());
154
149
155
150
// check if driverID is pm1006
156
151
if (strcmp (getDriverID (), " pm1006" ) == 0 ) {
157
152
// PM1006 returns only PM2.5_ENV readings
158
- packUARTResponse (&msgUARTResponse, 4 ,
153
+ msgUARTResponse.payload .resp_uart_device_event .sensor_event_count = 1 ;
154
+ packUARTResponse (&msgUARTResponse, 0 ,
159
155
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_ENV,
160
156
(float )_data.pm25_env );
161
157
} else {
158
+ msgUARTResponse.payload .resp_uart_device_event .sensor_event_count = 6 ;
162
159
packUARTResponse (&msgUARTResponse, 0 ,
163
160
wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD,
164
161
(float )_data.pm10_standard );
0 commit comments