Skip to content

Commit 378f77b

Browse files
committed
Use BSEC library from lib manager and fix wrapper accordingly
1 parent 8190bc6 commit 378f77b

14 files changed

+19
-4348
lines changed

src/AirQualityClass.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int AirQualityClass::begin()
3535
if (_revision == BOARD_REVISION_2) {
3636
if (mkr_iot_carrier_rev2::iaqSensor == nullptr) {
3737
iaqSensor = new Bsec();
38-
iaqSensor->begin(BME680_I2C_ADDR_PRIMARY, Wire);
38+
iaqSensor->begin(BME68X_I2C_ADDR_LOW, Wire);
3939
if (checkIaqSensorStatus() == STATUS_ERROR){
4040
return 0;
4141
}
@@ -53,7 +53,7 @@ int AirQualityClass::begin()
5353
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
5454
};
5555

56-
iaqSensor->updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_CONTINUOUS);
56+
iaqSensor->updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_CONT);
5757
if (checkIaqSensorStatus() == STATUS_ERROR){
5858
return 0;
5959
}
@@ -68,14 +68,14 @@ int AirQualityClass::begin()
6868

6969
int AirQualityClass::checkIaqSensorStatus(void)
7070
{
71-
if (iaqSensor->status != BSEC_OK) {
72-
if (iaqSensor->status < BSEC_OK) {
71+
if (iaqSensor->bsecStatus != BSEC_OK) {
72+
if (iaqSensor->bsecStatus < BSEC_OK) {
7373
return STATUS_ERROR;
7474
}
7575
}
7676

77-
if (iaqSensor->bme680Status != BME680_OK) {
78-
if (iaqSensor->bme680Status < BME680_OK) {
77+
if (iaqSensor->bme68xStatus != BME68X_OK) {
78+
if (iaqSensor->bme68xStatus < BME68X_OK) {
7979
return STATUS_ERROR;
8080
}
8181
}

src/EnvClass.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int EnvClass::begin()
3636
if (_revision == BOARD_REVISION_2) {
3737
if (mkr_iot_carrier_rev2::iaqSensor == nullptr) {
3838
iaqSensor = new Bsec();
39-
iaqSensor->begin(BME680_I2C_ADDR_PRIMARY, Wire);
39+
iaqSensor->begin(BME68X_I2C_ADDR_LOW, Wire);
4040
if (checkIaqSensorStatus() == STATUS_ERROR){
4141
return 0;
4242
}
@@ -54,7 +54,7 @@ int EnvClass::begin()
5454
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
5555
};
5656

57-
iaqSensor->updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_CONTINUOUS);
57+
iaqSensor->updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_CONT);
5858
if (checkIaqSensorStatus() == STATUS_ERROR){
5959
return 0;
6060
}
@@ -73,14 +73,14 @@ int EnvClass::begin()
7373

7474
int EnvClass::checkIaqSensorStatus(void)
7575
{
76-
if (iaqSensor->status != BSEC_OK) {
77-
if (iaqSensor->status < BSEC_OK) {
76+
if (iaqSensor->bsecStatus != BSEC_OK) {
77+
if (iaqSensor->bsecStatus < BSEC_OK) {
7878
return 0;
7979
}
8080
}
8181

82-
if (iaqSensor->bme680Status != BME680_OK) {
83-
if (iaqSensor->bme680Status < BME680_OK) {
82+
if (iaqSensor->bme68xStatus != BME68X_OK) {
83+
if (iaqSensor->bme68xStatus < BME68X_OK) {
8484
return 0;
8585
}
8686
}

src/MKRIoTCarrierDefines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//Sensor libraries
1010
#include <Arduino_APDS9960.h> //Ambient light
1111
#include <Arduino_LPS22HB.h> //Pressure sensor
12-
#include "bsec/bsec.h"
12+
#include "bsec.h"
1313
#include <Arduino_HTS221.h> // env sensor
1414
#include <Arduino_LSM6DSOX.h>
1515
#include <Arduino_LSM6DS3.h>

src/PressureClass.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int PressureClass::begin()
3535
if (_revision == BOARD_REVISION_2) {
3636
if (mkr_iot_carrier_rev2::iaqSensor == nullptr) {
3737
iaqSensor = new Bsec();
38-
iaqSensor->begin(BME680_I2C_ADDR_PRIMARY, Wire);
38+
iaqSensor->begin(BME68X_I2C_ADDR_LOW, Wire);
3939
if (checkIaqSensorStatus() == STATUS_ERROR){
4040
return 0;
4141
}
@@ -53,7 +53,7 @@ int PressureClass::begin()
5353
BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
5454
};
5555

56-
iaqSensor->updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_CONTINUOUS);
56+
iaqSensor->updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_CONT);
5757
if (checkIaqSensorStatus() == STATUS_ERROR){
5858
return 0;
5959
}
@@ -73,14 +73,14 @@ int PressureClass::begin()
7373

7474
int PressureClass::checkIaqSensorStatus(void)
7575
{
76-
if (iaqSensor->status != BSEC_OK) {
77-
if (iaqSensor->status < BSEC_OK) {
76+
if (iaqSensor->bsecStatus != BSEC_OK) {
77+
if (iaqSensor->bsecStatus < BSEC_OK) {
7878
return STATUS_ERROR;
7979
}
8080
}
8181

82-
if (iaqSensor->bme680Status != BME680_OK) {
83-
if (iaqSensor->bme680Status < BME680_OK) {
82+
if (iaqSensor->bme68xStatus != BME68X_OK) {
83+
if (iaqSensor->bme68xStatus < BME68X_OK) {
8484
return STATUS_ERROR;
8585
}
8686
}

src/bsec/bme680/LICENSE

-30
This file was deleted.

0 commit comments

Comments
 (0)