Adafruit Library
WipperSnapper_I2C_Driver.h
Go to the documentation of this file.
1 
16 #ifndef WipperSnapper_I2C_Driver_H
17 #define WipperSnapper_I2C_Driver_H
18 
19 #include "wippersnapper/i2c/v1/i2c.pb.h"
20 #include <Adafruit_Sensor.h>
21 #include <Arduino.h>
22 #include <Wire.h>
23 
24 #define PERIOD_24HRS_AGO_MILLIS (millis() - (24 * 60 * 60 * 1000))
25 #define ONE_SECOND_IN_MILLIS 1000
27 
28 /**************************************************************************/
32 /**************************************************************************/
34 
35 public:
36  /*******************************************************************************/
44  /*******************************************************************************/
45  WipperSnapper_I2C_Driver(TwoWire *i2c, uint16_t sensorAddress) {
46  _i2c = i2c;
47  _sensorAddress = sensorAddress;
48  }
49 
50  /*******************************************************************************/
54  /*******************************************************************************/
56 
57  /*******************************************************************************/
69  /*******************************************************************************/
70  virtual void fastTick() {}
71 
72  /*******************************************************************************/
77  /*******************************************************************************/
78  bool begin() { return false; }
79 
80  /*******************************************************************************/
88  /*******************************************************************************/
89  void setSensorPeriod(float period,
90  wippersnapper_i2c_v1_SensorType sensorType) {
91  long sensorPeriod = (long)period * 1000;
92 
93  switch (sensorType) {
94  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE:
95  _tempSensorPeriod = sensorPeriod;
96  break;
97  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY:
98  _humidSensorPeriod = sensorPeriod;
99  break;
100  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE:
101  _pressureSensorPeriod = sensorPeriod;
102  break;
103  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2:
104  _CO2SensorPeriod = sensorPeriod;
105  break;
106  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ECO2:
107  _ECO2SensorPeriod = sensorPeriod;
108  break;
109  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC:
110  _TVOCSensorPeriod = sensorPeriod;
111  break;
112  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE:
113  _altitudeSensorPeriod = sensorPeriod;
114  break;
115  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE:
116  _objectTempSensorPeriod = sensorPeriod;
117  break;
118  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT:
119  _lightSensorPeriod = sensorPeriod;
120  break;
121  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LUX:
122  _luxSensorPeriod = sensorPeriod;
123  break;
124  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD:
125  _PM10SensorPeriod = sensorPeriod;
126  break;
127  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD:
128  _PM25SensorPeriod = sensorPeriod;
129  break;
130  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD:
131  _PM100SensorPeriod = sensorPeriod;
132  break;
133  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT:
134  _unitlessPercentPeriod = sensorPeriod;
135  break;
136  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE:
137  _voltagePeriod = sensorPeriod;
138  break;
139  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CURRENT:
140  _currentPeriod = sensorPeriod;
141  break;
142  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY:
143  _proximitySensorPeriod = sensorPeriod;
144  break;
145  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW:
146  _rawSensorPeriod = sensorPeriod;
147  break;
148  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT:
149  _ambientTempFPeriod = sensorPeriod;
150  break;
151  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT:
152  _objectTempFPeriod = sensorPeriod;
153  break;
154  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE:
155  _gasResistancePeriod = sensorPeriod;
156  break;
157  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX:
158  _NOxIndexPeriod = sensorPeriod;
159  break;
160  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX:
161  _VOCIndexPeriod = sensorPeriod;
162  break;
163  default:
164  break;
165  }
166  }
167 
168  /*******************************************************************************/
175  /*******************************************************************************/
176  void
177  configureDriver(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq) {
178  int propertyIdx = 0; // contains the amount of i2c sensors in the
179  // msgDeviceInitReq to configure
180  while (propertyIdx < msgDeviceInitReq->i2c_device_properties_count) {
182  msgDeviceInitReq->i2c_device_properties[propertyIdx].sensor_period,
183  msgDeviceInitReq->i2c_device_properties[propertyIdx].sensor_type);
184  ++propertyIdx;
185  }
186  }
187 
188  /*******************************************************************************/
193  /*******************************************************************************/
194  uint16_t getI2CAddress() { return _sensorAddress; }
195 
196  /****************************** SENSOR_TYPE: CO2
197  * *******************************/
198  /*********************************************************************************/
204  /*********************************************************************************/
205  virtual long getSensorCO2Period() { return _CO2SensorPeriod; }
206 
207  /*********************************************************************************/
213  /*********************************************************************************/
214  virtual long getSensorCO2PeriodPrv() { return _CO2SensorPeriodPrv; }
215 
216  /*******************************************************************************/
222  /*******************************************************************************/
223  virtual void setSensorCO2PeriodPrv(long period) {
224  _CO2SensorPeriodPrv = period;
225  }
226 
227  /*******************************************************************************/
235  /*******************************************************************************/
236  virtual bool getEventCO2(sensors_event_t *co2Event) {
237  (void)
238  co2Event; // Parameter is intentionally unused in this virtual function.
239  return false;
240  }
241 
242  /****************************** SENSOR_TYPE: ECO2
243  * *******************************/
244  /*********************************************************************************/
250  /*********************************************************************************/
251  virtual long getSensorECO2Period() { return _ECO2SensorPeriod; }
252 
253  /*********************************************************************************/
259  /*********************************************************************************/
260  virtual long getSensorECO2PeriodPrv() { return _ECO2SensorPeriodPrv; }
261 
262  /*******************************************************************************/
268  /*******************************************************************************/
269  virtual void setSensorECO2PeriodPrv(long period) {
270  _ECO2SensorPeriodPrv = period;
271  }
272 
273  /*******************************************************************************/
281  /*******************************************************************************/
282  virtual bool getEventECO2(sensors_event_t *eco2Event) {
283  (void)eco2Event; // Parameter is intentionally unused in this virtual
284  // function.
285  return false;
286  }
287 
288  /****************************** SENSOR_TYPE: TVOC
289  * *******************************/
290  /*********************************************************************************/
296  /*********************************************************************************/
297  virtual long getSensorTVOCPeriod() { return _TVOCSensorPeriod; }
298 
299  /*********************************************************************************/
305  /*********************************************************************************/
306  virtual long getSensorTVOCPeriodPrv() { return _TVOCSensorPeriodPrv; }
307 
308  /*******************************************************************************/
314  /*******************************************************************************/
315  virtual void setSensorTVOCPeriodPrv(long period) {
316  _TVOCSensorPeriodPrv = period;
317  }
318 
319  /*******************************************************************************/
327  /*******************************************************************************/
328  virtual bool getEventTVOC(sensors_event_t *tvocEvent) {
329  (void)tvocEvent; // Parameter is intentionally unused in this virtual
330  // function.
331  return false;
332  }
333 
334  /********************** SENSOR_TYPE: AMBIENT TEMPERATURE (°C)
335  * ***********************/
336  /*********************************************************************************/
342  /*********************************************************************************/
344 
345  /*********************************************************************************/
352  /*********************************************************************************/
354 
355  /*******************************************************************************/
363  /*******************************************************************************/
364  virtual void setSensorAmbientTempPeriodPrv(long periodPrv) {
365  _tempSensorPeriodPrv = periodPrv;
366  }
367 
368  /*******************************************************************************/
377  /*******************************************************************************/
378  virtual bool getEventAmbientTemp(sensors_event_t *tempEvent) {
379  (void)tempEvent; // Parameter is intentionally unused in this virtual
380  // function.
381  return false;
382  }
383 
384  /************************* SENSOR_TYPE: RELATIVE_HUMIDITY
385  * ***********************/
386  /*********************************************************************************/
392  /*********************************************************************************/
394 
395  /*********************************************************************************/
401  /*********************************************************************************/
403  return _humidSensorPeriodPrv;
404  }
405 
406  /*******************************************************************************/
412  /*******************************************************************************/
413  virtual void setSensorRelativeHumidityPeriodPrv(long periodPrv) {
414  _humidSensorPeriodPrv = periodPrv;
415  }
416 
417  /*******************************************************************************/
426  /*******************************************************************************/
427  virtual bool getEventRelativeHumidity(sensors_event_t *humidEvent) {
428  (void)humidEvent; // Parameter is intentionally unused in this virtual
429  // function.
430  return false;
431  }
432 
433  /**************************** SENSOR_TYPE: PRESSURE
434  * ****************************/
435  /*********************************************************************************/
441  /*********************************************************************************/
443 
444  /*********************************************************************************/
450  /*********************************************************************************/
452 
453  /*******************************************************************************/
459  /*******************************************************************************/
460  virtual void setSensorPressurePeriodPrv(long period) {
461  _pressureSensorPeriodPrv = period;
462  }
463 
464  /*******************************************************************************/
473  /*******************************************************************************/
474  virtual bool getEventPressure(sensors_event_t *pressureEvent) {
475  (void)pressureEvent; // Parameter is intentionally unused in this virtual
476  // function.
477  return false;
478  }
479 
480  /**************************** SENSOR_TYPE: Altitude
481  * ****************************/
482  /*********************************************************************************/
488  /*********************************************************************************/
490 
491  /*********************************************************************************/
497  /*********************************************************************************/
499 
500  /*******************************************************************************/
506  /*******************************************************************************/
507  virtual void setSensorAltitudePeriodPrv(long period) {
508  _altitudeSensorPeriodPrv = period;
509  }
510 
511  /*******************************************************************************/
520  /*******************************************************************************/
521  virtual bool getEventAltitude(sensors_event_t *altitudeEvent) {
522  (void)altitudeEvent; // Parameter is intentionally unused in this virtual
523  // function.
524  return false;
525  }
526 
527  /**************************** SENSOR_TYPE: Object_Temperature
528  * ****************************/
529  /*********************************************************************************/
536  /*********************************************************************************/
538 
539  /*********************************************************************************/
546  /*********************************************************************************/
549  }
550 
551  /*******************************************************************************/
558  /*******************************************************************************/
559  virtual void setSensorObjectTempPeriodPrv(long period) {
561  }
562 
563  /*******************************************************************************/
572  /*******************************************************************************/
573  virtual bool getEventObjectTemp(sensors_event_t *objectTempEvent) {
574  (void)objectTempEvent; // Parameter is intentionally unused in this virtual
575  // function.
576  return false;
577  }
578 
579  /**************************** SENSOR_TYPE: LIGHT
580  * ****************************/
581  /*********************************************************************************/
588  /*********************************************************************************/
589  virtual long getSensorLightPeriod() { return _lightSensorPeriod; }
590 
591  /*********************************************************************************/
598  /*********************************************************************************/
600 
601  /*******************************************************************************/
608  /*******************************************************************************/
609  virtual void setSensorLightPeriodPrv(long period) {
610  _lightSensorPeriodPrv = period;
611  }
612 
613  /*******************************************************************************/
622  /*******************************************************************************/
623  virtual bool getEventLight(sensors_event_t *lightEvent) {
624  (void)lightEvent; // Parameter is intentionally unused in this virtual
625  // function.
626  return false;
627  }
628 
629  /**************************** SENSOR_TYPE: LUX
630  * ****************************/
631  /*********************************************************************************/
638  /*********************************************************************************/
639  virtual long getSensorLuxPeriod() { return _luxSensorPeriod; }
640 
641  /*********************************************************************************/
648  /*********************************************************************************/
649  virtual long getSensorLuxPeriodPrv() { return _luxSensorPeriodPrv; }
650 
651  /*******************************************************************************/
658  /*******************************************************************************/
659  virtual void setSensorLuxPeriodPrv(long period) {
660  _luxSensorPeriodPrv = period;
661  }
662 
663  /*******************************************************************************/
672  /*******************************************************************************/
673  virtual bool getEventLux(sensors_event_t *luxEvent) {
674  (void)luxEvent; // Parameter is intentionally unused in this virtual
675  // function.
676  return false;
677  }
678 
679  /**************************** SENSOR_TYPE: PM10_STD
680  * ****************************/
681  /*********************************************************************************/
688  /*********************************************************************************/
689  virtual long getSensorPM10_STDPeriod() { return _PM10SensorPeriod; }
690 
691  /*********************************************************************************/
698  /*********************************************************************************/
700 
701  /*******************************************************************************/
708  /*******************************************************************************/
709  virtual void setSensorPM10_STDPeriodPrv(long period) {
710  _PM10SensorPeriodPrv = period;
711  }
712 
713  /*******************************************************************************/
722  /*******************************************************************************/
723  virtual bool getEventPM10_STD(sensors_event_t *pm10StdEvent) {
724  (void)pm10StdEvent; // Parameter is intentionally unused in this virtual
725  // function.
726  return false;
727  }
728 
729  /**************************** SENSOR_TYPE: PM25_STD
730  * ****************************/
731  /*********************************************************************************/
738  /*********************************************************************************/
739  virtual long getSensorPM25_STDPeriod() { return _PM25SensorPeriod; }
740 
741  /*********************************************************************************/
748  /*********************************************************************************/
750 
751  /*******************************************************************************/
758  /*******************************************************************************/
759  virtual void setSensorPM25_STDPeriodPrv(long period) {
760  _PM25SensorPeriodPrv = period;
761  }
762 
763  /*******************************************************************************/
772  /*******************************************************************************/
773  virtual bool getEventPM25_STD(sensors_event_t *pm25StdEvent) {
774  (void)pm25StdEvent; // Parameter is intentionally unused in this virtual
775  // function.
776  return false;
777  }
778 
779  /**************************** SENSOR_TYPE: PM100_STD
780  * ****************************/
781  /*********************************************************************************/
788  /*********************************************************************************/
789  virtual long getSensorPM100_STDPeriod() { return _PM100SensorPeriod; }
790 
791  /*********************************************************************************/
798  /*********************************************************************************/
800 
801  /*******************************************************************************/
808  /*******************************************************************************/
809  virtual void setSensorPM100_STDPeriodPrv(long period) {
810  _PM100SensorPeriodPrv = period;
811  }
812 
813  /*******************************************************************************/
822  /*******************************************************************************/
823  virtual bool getEventPM100_STD(sensors_event_t *pm100StdEvent) {
824  (void)pm100StdEvent; // Parameter is intentionally unused in this virtual
825  // function.
826  return false;
827  }
828 
829  /**************************** SENSOR_TYPE: UNITLESS_PERCENT
830  * ****************************/
831  /*********************************************************************************/
838  /*********************************************************************************/
840  return _unitlessPercentPeriod;
841  }
842 
843  /*********************************************************************************/
850  /*********************************************************************************/
853  }
854 
855  /*******************************************************************************/
862  /*******************************************************************************/
863  virtual void setSensorUnitlessPercentPeriodPrv(long period) {
864  _unitlessPercentPeriodPrv = period;
865  }
866 
867  /*******************************************************************************/
876  /*******************************************************************************/
877  virtual bool getEventUnitlessPercent(sensors_event_t *unitlessPercentEvent) {
878  (void)unitlessPercentEvent; // Parameter is intentionally unused in this
879  // virtual function.
880  return false;
881  }
882 
883  /**************************** SENSOR_TYPE: VOLTAGE
884  * ****************************/
885  /*********************************************************************************/
891  /*********************************************************************************/
892  virtual long getSensorVoltagePeriod() { return _voltagePeriod; }
893 
894  /*********************************************************************************/
900  /*********************************************************************************/
901  virtual long getSensorVoltagePeriodPrv() { return _voltagePeriodPrv; }
902 
903  /*******************************************************************************/
909  /*******************************************************************************/
910  virtual void setSensorVoltagePeriodPrv(long period) {
911  _voltagePeriodPrv = period;
912  }
913 
914  /*******************************************************************************/
923  /*******************************************************************************/
924  virtual bool getEventVoltage(sensors_event_t *voltageEvent) {
925  (void)voltageEvent; // Parameter is intentionally unused in this virtual
926  // function.
927  return false;
928  }
929 
930  /**************************** SENSOR_TYPE: CURRENT
931  * ****************************/
932  /*********************************************************************************/
938  /*********************************************************************************/
939  virtual long getSensorCurrentPeriod() { return _currentPeriod; }
940 
941  /*********************************************************************************/
947  /*********************************************************************************/
948  virtual long getSensorCurrentPeriodPrv() { return _currentPeriodPrv; }
949 
950  /*******************************************************************************/
956  /*******************************************************************************/
957  virtual void setSensorCurrentPeriodPrv(long period) {
958  _currentPeriodPrv = period;
959  }
960 
961  /*******************************************************************************/
970  /*******************************************************************************/
971  virtual bool getEventCurrent(sensors_event_t *currentEvent) {
972  (void)currentEvent; // Parameter is intentionally unused in this virtual
973  // function.
974  return false;
975  }
976 
977  /****************************** SENSOR_TYPE: Raw
978  * *******************************/
979  /*********************************************************************************/
985  /*********************************************************************************/
986  virtual long getSensorRawPeriod() { return _rawSensorPeriod; }
987 
988  /*********************************************************************************/
994  /*********************************************************************************/
995  virtual long getSensorRawPeriodPrv() { return _rawSensorPeriodPrv; }
996 
997  /*******************************************************************************/
1003  /*******************************************************************************/
1004  virtual void setSensorRawPeriodPrv(long period) {
1005  _rawSensorPeriodPrv = period;
1006  }
1007 
1008  /*******************************************************************************/
1016  /*******************************************************************************/
1017  virtual bool getEventRaw(sensors_event_t *rawEvent) {
1018  (void)
1019  rawEvent; // Parameter is intentionally unused in this virtual function.
1020  return false;
1021  }
1022 
1023  /****************************** SENSOR_TYPE: Ambient Temp (°F)
1024  * *******************************/
1025 
1026  /*******************************************************************************/
1031  /*******************************************************************************/
1032  virtual void disableAmbientTempF() { _ambientTempFPeriod = 0.0L; }
1033 
1034  /*********************************************************************************/
1041  /*********************************************************************************/
1043 
1044  /*********************************************************************************/
1051  /*********************************************************************************/
1053  return _ambientTempFPeriodPrv;
1054  }
1055 
1056  /*******************************************************************************/
1064  /*******************************************************************************/
1065  virtual void setSensorAmbientTempFPeriodPrv(long period) {
1066  _ambientTempFPeriodPrv = period;
1067  }
1068 
1069  /*******************************************************************************/
1079  /*******************************************************************************/
1080  virtual bool getEventAmbientTempF(sensors_event_t *AmbientTempFEvent) {
1081  // obtain ambient temp. in °C
1082  if (!getEventAmbientTemp(AmbientTempFEvent))
1083  return false;
1084  // convert event from °C to °F
1085  AmbientTempFEvent->temperature =
1086  (AmbientTempFEvent->temperature * 9.0) / 5.0 + 32;
1087  return true;
1088  }
1089 
1090  /****************************** SENSOR_TYPE: Object Temp (°F)
1091  * *******************************/
1092  /*********************************************************************************/
1099  /*********************************************************************************/
1101 
1102  /*********************************************************************************/
1109  /*********************************************************************************/
1111 
1112  /*******************************************************************************/
1120  /*******************************************************************************/
1121  virtual void setSensorObjectTempFPeriodPrv(long period) {
1122  _objectTempFPeriodPrv = period;
1123  }
1124 
1125  /*******************************************************************************/
1135  /*******************************************************************************/
1136  virtual bool getEventObjectTempF(sensors_event_t *objectTempFEvent) {
1137  // obtain ambient temp. in °C
1138  if (!getEventObjectTemp(objectTempFEvent))
1139  return false;
1140  // convert event from °C to °F
1141  objectTempFEvent->temperature =
1142  (objectTempFEvent->temperature * 9.0) / 5.0 + 32.0;
1143  return true;
1144  }
1145 
1146  /****************************** SENSOR_TYPE: Gas Resistance (ohms)
1147  * *******************************/
1148  /*********************************************************************************/
1155  /*********************************************************************************/
1157 
1158  /*********************************************************************************/
1165  /*********************************************************************************/
1167  return _gasResistancePeriodPrv;
1168  }
1169 
1170  /*******************************************************************************/
1178  /*******************************************************************************/
1179  virtual void setSensorGasResistancePeriodPrv(long period) {
1180  _gasResistancePeriodPrv = period;
1181  }
1182 
1183  /*******************************************************************************/
1192  /*******************************************************************************/
1193  virtual bool getEventGasResistance(sensors_event_t *gasEvent) {
1194  (void)
1195  gasEvent; // Parameter is intentionally unused in this virtual function.
1196  return false;
1197  }
1198 
1199  /****************************** SENSOR_TYPE: NOx Index (index)
1200  * *******************************/
1201  /*********************************************************************************/
1208  /*********************************************************************************/
1209  virtual long getSensorNOxIndexPeriod() { return _NOxIndexPeriod; }
1210 
1211  /*********************************************************************************/
1218  /*********************************************************************************/
1220 
1221  /*******************************************************************************/
1229  /*******************************************************************************/
1230  virtual void setSensorNOxIndexPeriodPrv(long period) {
1231  _NOxIndexPeriodPrv = period;
1232  }
1233 
1234  /*******************************************************************************/
1243  /*******************************************************************************/
1244  virtual bool getEventNOxIndex(sensors_event_t *gasEvent) {
1245  (void)
1246  gasEvent; // Parameter is intentionally unused in this virtual function.
1247  return false;
1248  }
1249 
1250  /****************************** SENSOR_TYPE: VOC Index (index)
1251  * *******************************/
1252  /*********************************************************************************/
1259  /*********************************************************************************/
1260  virtual long getSensorVOCIndexPeriod() { return _VOCIndexPeriod; }
1261 
1262  /*********************************************************************************/
1269  /*********************************************************************************/
1271 
1272  /*******************************************************************************/
1280  /*******************************************************************************/
1281  virtual void setSensorVOCIndexPeriodPrv(long period) {
1282  _VOCIndexPeriodPrv = period;
1283  }
1284 
1285  /*******************************************************************************/
1294  /*******************************************************************************/
1295  virtual bool getEventVOCIndex(sensors_event_t *gasEvent) {
1296  (void)
1297  gasEvent; // Parameter is intentionally unused in this virtual function.
1298  return false;
1299  }
1300 
1301  /**************************** SENSOR_TYPE: PROXIMITY
1302  * ****************************/
1303  /*******************************************************************************/
1307  /*******************************************************************************/
1308  virtual void enableSensorProximity() {};
1309 
1310  /*******************************************************************************/
1314  /*******************************************************************************/
1316 
1317  /*********************************************************************************/
1324  /*********************************************************************************/
1326 
1327  /*******************************************************************************/
1334  /*******************************************************************************/
1335  virtual void setSensorProximityPeriod(long period) {
1336  if (period == 0)
1338  _proximitySensorPeriod = period;
1339  }
1340 
1341  /*********************************************************************************/
1348  /*********************************************************************************/
1350 
1351  /*******************************************************************************/
1358  /*******************************************************************************/
1359  virtual void setSensorProximityPeriodPrv(long period) {
1360  _proximitySensorPeriodPrv = period;
1361  }
1362 
1363  /*******************************************************************************/
1372  /*******************************************************************************/
1373  virtual bool getEventProximity(sensors_event_t *proximityEvent) {
1374  (void)proximityEvent; // Parameter is intentionally unused in this virtual
1375  // function.
1376  return false;
1377  }
1378 
1379  /*******************************************************************************/
1386  /*******************************************************************************/
1387  virtual void updateSensorProximity(float period) {
1388  setSensorProximityPeriod(period);
1389  }
1390 
1391 protected:
1392  TwoWire *_i2c;
1393  uint16_t _sensorAddress;
1395  0L;
1398  long _humidSensorPeriod =
1400  0L;
1403  long _pressureSensorPeriod =
1405  0L;
1408  long _CO2SensorPeriod =
1410  0L;
1414  0L;
1418  0L;
1422  0L;
1425  long _objectTempSensorPeriod = 0L;
1430  long _lightSensorPeriod =
1432  0L;
1435  long _luxSensorPeriod =
1437  0L;
1439  long _PM10SensorPeriod =
1441  0L;
1445  0L;
1449  0L;
1452  long _unitlessPercentPeriod =
1454  0L;
1457  long _voltagePeriod =
1459  0L;
1462  long _currentPeriod =
1464  0L;
1467  long _rawSensorPeriod =
1469  0L;
1473  long _ambientTempFPeriodPrv =
1476  long _objectTempFPeriod = 0L;
1478  long _objectTempFPeriodPrv =
1481  long _gasResistancePeriod = 0L;
1486  long _NOxIndexPeriod =
1488  0L;
1491  long _VOCIndexPeriod =
1493  0L;
1496  long _proximitySensorPeriod =
1498  0L;
1501 };
1503 
1504 #endif // WipperSnapper_I2C_Driver_H
long _unitlessPercentPeriod
The time period between reading the unitless % sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1453
virtual long getSensorUnitlessPercentPeriodPrv()
Base implementation - Returns the previous time interval at which the unitless % sensor was queried l...
Definition: WipperSnapper_I2C_Driver.h:851
virtual long getSensorLightPeriodPrv()
Base implementation - Returns the previous time interval at which the light sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:599
virtual long getSensorObjectTempPeriodPrv()
Base implementation - Returns the previous time interval at which the object temperature sensor was q...
Definition: WipperSnapper_I2C_Driver.h:547
virtual bool getEventPM10_STD(sensors_event_t *pm10StdEvent)
Base implementation - Reads a object pm10 std. sensor and converts the reading into the expected SI u...
Definition: WipperSnapper_I2C_Driver.h:723
virtual void updateSensorProximity(float period)
Updates the properties of a proximity sensor.
Definition: WipperSnapper_I2C_Driver.h:1387
long _PM10SensorPeriod
The time period between reading the pm25 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1440
uint16_t getI2CAddress()
Gets the I2C device&#39;s address.
Definition: WipperSnapper_I2C_Driver.h:194
virtual long getSensorPM25_STDPeriod()
Base implementation - Returns the object pm25 standard sensors&#39; period, if set.
Definition: WipperSnapper_I2C_Driver.h:739
virtual void setSensorObjectTempFPeriodPrv(long period)
Sets a timestamp for when the object temperature sensor (°F) was queried.
Definition: WipperSnapper_I2C_Driver.h:1121
long _PM100SensorPeriod
The time period between reading the pm100_std sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1448
#define PERIOD_24HRS_AGO_MILLIS
Used for last sensor read time, initially set 24hrs ago (max period)
Definition: WipperSnapper_I2C_Driver.h:24
virtual void setSensorVOCIndexPeriodPrv(long period)
Sets a timestamp for when the object VOC Index sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1281
long _currentPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1465
virtual long getSensorPressurePeriod()
Base implementation - Returns the pressure sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:442
virtual long getSensorTVOCPeriodPrv()
Base implementation - Returns the previous time interval at which the TVOC sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:306
virtual void setSensorAmbientTempFPeriodPrv(long period)
Sets a timestamp for when the ambient temperature sensor (°F) was queried.
Definition: WipperSnapper_I2C_Driver.h:1065
virtual bool getEventPM100_STD(sensors_event_t *pm100StdEvent)
Base implementation - Reads a object pm100 std. sensor and converts the reading into the expected SI ...
Definition: WipperSnapper_I2C_Driver.h:823
virtual long getSensorCurrentPeriod()
Base implementation - Returns the current sensor&#39;s period.
Definition: WipperSnapper_I2C_Driver.h:939
virtual long getSensorRelativeHumidityPeriodPrv()
Base implementation - Returns the previous time interval at which the humidity sensor was queried las...
Definition: WipperSnapper_I2C_Driver.h:402
long _altitudeSensorPeriod
The time period between reading the altitude sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1421
virtual long getSensorVOCIndexPeriod()
Base implementation - Returns the VOC Index sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1260
virtual long getSensorTVOCPeriod()
Base implementation - Returns the TVOC sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:297
virtual void setSensorProximityPeriodPrv(long period)
Sets a timestamp for when the proximity sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1359
virtual bool getEventCO2(sensors_event_t *co2Event)
Gets a sensor&#39;s CO2 value.
Definition: WipperSnapper_I2C_Driver.h:236
virtual long getSensorAmbientTempPeriod()
Base implementation - Returns the ambient temperature (°C) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:343
virtual long getSensorPM100_STDPeriodPrv()
Base implementation - Returns the previous time interval at which the pm100 std. sensor was queried l...
Definition: WipperSnapper_I2C_Driver.h:799
virtual long getSensorAmbientTempPeriodPrv()
Base implementation - Returns the previous time interval at which the ambient temperature sensor (°C)...
Definition: WipperSnapper_I2C_Driver.h:353
virtual bool getEventPM25_STD(sensors_event_t *pm25StdEvent)
Base implementation - Reads a object pm25 std. sensor and converts the reading into the expected SI u...
Definition: WipperSnapper_I2C_Driver.h:773
virtual bool getEventNOxIndex(sensors_event_t *gasEvent)
Base implementation - Reads a NOx Index sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:1244
virtual long getSensorECO2PeriodPrv()
Base implementation - Returns the previous time interval at which the eCO2 sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:260
long _currentPeriod
The time period between reading the current sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1463
long _NOxIndexPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1489
long _objectTempSensorPeriod
Definition: WipperSnapper_I2C_Driver.h:1426
long _TVOCSensorPeriod
The time period between reading the TVOC sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1417
long _ambientTempFPeriod
Definition: WipperSnapper_I2C_Driver.h:1472
virtual long getSensorUnitlessPercentPeriod()
Base implementation - Returns the object unitless % sensor period, if set.
Definition: WipperSnapper_I2C_Driver.h:839
virtual long getSensorCO2Period()
Base implementation - Returns the co2 sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:205
virtual void setSensorTVOCPeriodPrv(long period)
Sets a timestamp for when the TVOC sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:315
long _VOCIndexPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1494
virtual void setSensorVoltagePeriodPrv(long period)
Sets a timestamp for when the voltage sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:910
long _luxSensorPeriodPrv
sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1438
virtual void setSensorAltitudePeriodPrv(long period)
Sets a timestamp for when the Altitude sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:507
virtual bool getEventProximity(sensors_event_t *proximityEvent)
Base implementation - Reads a proximity sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:1373
long _tempSensorPeriod
The time period between reading the temperature sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1394
virtual bool getEventRelativeHumidity(sensors_event_t *humidEvent)
Base implementation - Reads a humidity sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:427
virtual void setSensorNOxIndexPeriodPrv(long period)
Sets a timestamp for when the object NOx Index sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1230
virtual ~WipperSnapper_I2C_Driver()
Destructor for an I2C sensor.
Definition: WipperSnapper_I2C_Driver.h:55
long _unitlessPercentPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1455
virtual long getSensorAmbientTempFPeriodPrv()
Base implementation - Returns the previous time interval at which the ambient temperature sensor (°F)...
Definition: WipperSnapper_I2C_Driver.h:1052
long _voltagePeriod
The time period between reading the voltage sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1458
bool begin()
Initializes the I2C sensor and begins I2C.
Definition: WipperSnapper_I2C_Driver.h:78
virtual long getSensorAmbientTempFPeriod()
Base implementation - Returns the ambient temperature (°F) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1042
virtual bool getEventAmbientTempF(sensors_event_t *AmbientTempFEvent)
Helper function to obtain a sensor&#39;s ambient temperature value in °F. Requires getEventAmbientTemp() ...
Definition: WipperSnapper_I2C_Driver.h:1080
long _TVOCSensorPeriodPrv
The time when the TVOC sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1419
WipperSnapper_I2C_Driver(TwoWire *i2c, uint16_t sensorAddress)
Instantiates an I2C sensor.
Definition: WipperSnapper_I2C_Driver.h:45
virtual void disableAmbientTempF()
Disables the device&#39;s ambient temperature (°F) sensor, if it exists.
Definition: WipperSnapper_I2C_Driver.h:1032
Base class for I2C Drivers.
Definition: WipperSnapper_I2C_Driver.h:33
virtual bool getEventAltitude(sensors_event_t *altitudeEvent)
Base implementation - Reads a Altitude sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:521
long _pressureSensorPeriod
The time period between reading the pressure sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1404
virtual bool getEventVOCIndex(sensors_event_t *gasEvent)
Base implementation - Reads a VOC Index sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:1295
virtual long getSensorLuxPeriodPrv()
Base implementation - Returns the previous time interval at which the lux sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:649
long _objectTempFPeriod
Definition: WipperSnapper_I2C_Driver.h:1477
long _ambientTempFPeriodPrv
was last read.
Definition: WipperSnapper_I2C_Driver.h:1474
long _ECO2SensorPeriodPrv
The time when the eCO2 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1415
long _gasResistancePeriodPrv
last read.
Definition: WipperSnapper_I2C_Driver.h:1484
long _humidSensorPeriod
The time period between reading the humidity sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1399
virtual void setSensorPM100_STDPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:809
virtual long getSensorLightPeriod()
Base implementation - Returns the object light sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:589
virtual bool getEventLux(sensors_event_t *luxEvent)
Base implementation - Reads a object Light(lux) sensor and converts the reading into the expected SI ...
Definition: WipperSnapper_I2C_Driver.h:673
long _PM100SensorPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1450
virtual long getSensorRelativeHumidityPeriod()
Base implementation - Returns the humidity sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:393
virtual bool getEventUnitlessPercent(sensors_event_t *unitlessPercentEvent)
Base implementation - Reads a object unitless % std. sensor and converts the reading into the expecte...
Definition: WipperSnapper_I2C_Driver.h:877
virtual long getSensorPM25_STDPeriodPrv()
Base implementation - Returns the previous time interval at which the pm25 std. sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:749
virtual bool getEventTVOC(sensors_event_t *tvocEvent)
Gets a sensor&#39;s TVOC value.
Definition: WipperSnapper_I2C_Driver.h:328
uint16_t _sensorAddress
The I2C driver&#39;s unique I2C address.
Definition: WipperSnapper_I2C_Driver.h:1393
virtual long getSensorAltitudePeriodPrv()
Base implementation - Returns the previous time interval at which the Altitude sensor was queried las...
Definition: WipperSnapper_I2C_Driver.h:498
long _luxSensorPeriod
The time period between reading the lux sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1436
virtual void setSensorECO2PeriodPrv(long period)
Sets a timestamp for when the eCO2 sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:269
virtual long getSensorGasResistancePeriodPrv()
Base implementation - Returns the previous time interval at which the gas resistance sensor (ohms) wa...
Definition: WipperSnapper_I2C_Driver.h:1166
long _gasResistancePeriod
Definition: WipperSnapper_I2C_Driver.h:1482
virtual long SensorProximityPeriodPrv()
Base implementation - Returns the previous time interval at which the proximity sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:1349
virtual long getSensorPM100_STDPeriod()
Base implementation - Returns the object pm100 standard sensors&#39; period, if set.
Definition: WipperSnapper_I2C_Driver.h:789
long _humidSensorPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1401
virtual long getSensorVoltagePeriod()
Base implementation - Returns the voltage sensor&#39;s period.
Definition: WipperSnapper_I2C_Driver.h:892
virtual void setSensorPM10_STDPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:709
long _objectTempSensorPeriodPrv
was last read.
Definition: WipperSnapper_I2C_Driver.h:1428
virtual long getSensorPM10_STDPeriodPrv()
Base implementation - Returns the previous time interval at which the pm10 std. sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:699
long _objectTempFPeriodPrv
was last read.
Definition: WipperSnapper_I2C_Driver.h:1479
long _lightSensorPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1433
virtual bool getEventECO2(sensors_event_t *eco2Event)
Gets a sensor&#39;s eCO2 value.
Definition: WipperSnapper_I2C_Driver.h:282
virtual void setSensorPM25_STDPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:759
void setSensorPeriod(float period, wippersnapper_i2c_v1_SensorType sensorType)
Sets the sensor&#39;s period, provided a wippersnapper_i2c_v1_SensorType.
Definition: WipperSnapper_I2C_Driver.h:89
virtual void setSensorObjectTempPeriodPrv(long period)
Sets a timestamp for when the object temperature sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:559
virtual long getSensorPressurePeriodPrv()
Base implementation - Returns the previous time interval at which the pressure sensor was queried las...
Definition: WipperSnapper_I2C_Driver.h:451
virtual void setSensorPressurePeriodPrv(long period)
Sets a timestamp for when the pressure sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:460
virtual void setSensorRelativeHumidityPeriodPrv(long periodPrv)
Sets a timestamp for when the temperature sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:413
virtual bool getEventPressure(sensors_event_t *pressureEvent)
Base implementation - Reads a pressure sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:474
virtual long getSensorCurrentPeriodPrv()
Base implementation - Returns the previous time interval at which the current sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:948
virtual long getSensorGasResistancePeriod()
Base implementation - Returns the gas resistance (ohms) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1156
virtual long getSensorAltitudePeriod()
Base implementation - Returns the Altitude sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:489
virtual bool getEventLight(sensors_event_t *lightEvent)
Base implementation - Reads a object light sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:623
long _VOCIndexPeriod
The time period between reading the VOC Index sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1492
virtual bool getEventGasResistance(sensors_event_t *gasEvent)
Base implementation - Reads a gas resistance sensor and converts the reading into the expected SI uni...
Definition: WipperSnapper_I2C_Driver.h:1193
virtual bool getEventAmbientTemp(sensors_event_t *tempEvent)
Base implementation - Reads an ambient temperature sensor (°C). Expects value to return in the proper...
Definition: WipperSnapper_I2C_Driver.h:378
virtual long getSensorObjectTempFPeriod()
Base implementation - Returns the object temperature (°F) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1100
long _CO2SensorPeriodPrv
The time when the CO2 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1411
long _lightSensorPeriod
The time period between reading the light sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1431
void configureDriver(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq)
Uses an I2CDeviceInitRequest message to configure the sensors belonging to the driver.
Definition: WipperSnapper_I2C_Driver.h:177
virtual void enableSensorProximity()
Enables the device&#39;s proximity sensor, if it exists.
Definition: WipperSnapper_I2C_Driver.h:1308
virtual long getSensorNOxIndexPeriodPrv()
Base implementation - Returns the previous time interval at which the NOx Index sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:1219
virtual void setSensorUnitlessPercentPeriodPrv(long period)
Sets a timestamp for when the unitless % sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:863
virtual void setSensorLuxPeriodPrv(long period)
Sets a timestamp for when the lux sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:659
virtual void setSensorCO2PeriodPrv(long period)
Sets a timestamp for when the co2 sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:223
virtual long getSensorRawPeriod()
Base implementation - Returns the raw sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:986
virtual void setSensorRawPeriodPrv(long period)
Sets a timestamp for when the raw sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1004
virtual long getSensorObjectTempPeriod()
Base implementation - Returns the object temperature sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:537
virtual void setSensorAmbientTempPeriodPrv(long periodPrv)
Sets a timestamp for when the ambient temperature sensor (°C) was queried.
Definition: WipperSnapper_I2C_Driver.h:364
long _voltagePeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1460
long _rawSensorPeriod
The time period between reading the Raw sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1468
virtual long getSensorCO2PeriodPrv()
Base implementation - Returns the previous time interval at which the co2 sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:214
virtual long getSensorECO2Period()
Base implementation - Returns the eCO2 sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:251
virtual void disableSensorProximity()
Disables the device&#39;s object proximity sensor, if it exists.
Definition: WipperSnapper_I2C_Driver.h:1315
virtual bool getEventObjectTempF(sensors_event_t *objectTempFEvent)
Helper function to obtain a sensor&#39;s object temperature value in °F. Requires getEventObjectTemp() to...
Definition: WipperSnapper_I2C_Driver.h:1136
long _rawSensorPeriodPrv
The time when the Raw sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1470
virtual long getSensorLuxPeriod()
Base implementation - Returns the object lux sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:639
long _PM25SensorPeriod
The time period between reading the pm25 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1444
long _tempSensorPeriodPrv
last read
Definition: WipperSnapper_I2C_Driver.h:1396
long _PM10SensorPeriodPrv
The time when the pm25 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1442
long _CO2SensorPeriod
The time period between reading the CO2 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1409
virtual long getSensorPM10_STDPeriod()
Base implementation - Returns the object pm10 standard sensors&#39; period, if set.
Definition: WipperSnapper_I2C_Driver.h:689
virtual long getSensorObjectTempFPeriodPrv()
Base implementation - Returns the previous time interval at which the object temperature sensor (°F) ...
Definition: WipperSnapper_I2C_Driver.h:1110
long _proximitySensorPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1499
virtual bool getEventObjectTemp(sensors_event_t *objectTempEvent)
Base implementation - Reads a object temperature sensor and converts the reading into the expected SI...
Definition: WipperSnapper_I2C_Driver.h:573
virtual long getSensorVoltagePeriodPrv()
Base implementation - Returns the previous time interval at which the voltage sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:901
long _ECO2SensorPeriod
The time period between reading the eCO2 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1413
long _proximitySensorPeriod
The time period between reading the proximity sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1497
virtual long getSensorRawPeriodPrv()
Base implementation - Returns the previous time interval at which the raw sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:995
virtual void setSensorCurrentPeriodPrv(long period)
Sets a timestamp for when the current sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:957
long _PM25SensorPeriodPrv
The time when the pm25 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1446
virtual bool getEventRaw(sensors_event_t *rawEvent)
Gets a sensor&#39;s Raw value.
Definition: WipperSnapper_I2C_Driver.h:1017
virtual long sensorProximityPeriod()
Base implementation - Returns the proximity sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1325
virtual bool getEventCurrent(sensors_event_t *currentEvent)
Base implementation - Reads a current sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:971
virtual void setSensorGasResistancePeriodPrv(long period)
Sets a timestamp for when the object gas resistance sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1179
long _altitudeSensorPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1423
virtual long getSensorVOCIndexPeriodPrv()
Base implementation - Returns the previous time interval at which the VOC Index sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:1270
long _NOxIndexPeriod
The time period between reading the NOx Index sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1487
virtual bool getEventVoltage(sensors_event_t *voltageEvent)
Base implementation - Reads a voltage sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:924
TwoWire * _i2c
Pointer to the I2C driver&#39;s Wire object.
Definition: WipperSnapper_I2C_Driver.h:1392
virtual void fastTick()
Lightweight, per-update background hook for drivers that need more frequent internal polling than the...
Definition: WipperSnapper_I2C_Driver.h:70
long _pressureSensorPeriodPrv
read.
Definition: WipperSnapper_I2C_Driver.h:1406
virtual long getSensorNOxIndexPeriod()
Base implementation - Returns the NOx Index sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1209
virtual void setSensorLightPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:609
virtual void setSensorProximityPeriod(long period)
Set the proximity sensor&#39;s return frequency.
Definition: WipperSnapper_I2C_Driver.h:1335