@@ -60,6 +60,11 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
6060 const char *driver_name) -> drvBase * {
6161 return new drvBme680 (i2c, addr, mux_channel, driver_name);
6262 }},
63+ {" bme688" ,
64+ [](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
65+ const char *driver_name) -> drvBase * {
66+ return new drvBme680 (i2c, addr, mux_channel, driver_name);
67+ }},
6368 {" BMP280" ,
6469 [](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
6570 const char *driver_name) -> drvBase * {
@@ -195,6 +200,11 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
195200 const char *driver_name) -> drvBase * {
196201 return new drvScd4x (i2c, addr, mux_channel, driver_name);
197202 }},
203+ {" scd41" ,
204+ [](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
205+ const char *driver_name) -> drvBase * {
206+ return new drvScd4x (i2c, addr, mux_channel, driver_name);
207+ }},
198208 {" scd30" ,
199209 [](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
200210 const char *driver_name) -> drvBase * {
@@ -470,7 +480,7 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
470480 if (strcmp (device_descriptor.i2c_bus_scl , " default" ) != 0 ) {
471481 WS_DEBUG_PRINTLN (" [i2c] Non-default I2C bus specified!" );
472482 if (_i2c_bus_alt == nullptr ) {
473- WS_DEBUG_PRINT (" [i2c] Initializing alternative i2c bus..." );
483+ WS_DEBUG_PRINTLN (" [i2c] Initializing alternative i2c bus..." );
474484 _i2c_bus_alt = new I2cHardware ();
475485 _i2c_bus_alt->InitBus (false , device_descriptor.i2c_bus_sda ,
476486 device_descriptor.i2c_bus_scl );
@@ -595,6 +605,7 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
595605 WS_DEBUG_PRINTLN (" [i2c] ERROR: I2C driver failed to initialize!" );
596606 device_status =
597607 wippersnapper_i2c_I2cDeviceStatus_I2C_DEVICE_STATUS_FAIL_INIT;
608+ // TODO: In offline mode, turn red and HALT
598609 if (!PublishI2cDeviceAddedorReplaced (device_descriptor, device_status))
599610 return false ;
600611 return true ;
@@ -603,6 +614,7 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
603614 WS_DEBUG_PRINTLN (" [i2c] ERROR: I2C driver type not found or unsupported!" );
604615 device_status =
605616 wippersnapper_i2c_I2cDeviceStatus_I2C_DEVICE_STATUS_FAIL_UNSUPPORTED_SENSOR;
617+ // TODO: In offline mode, turn red and HALT
606618 if (!PublishI2cDeviceAddedorReplaced (device_descriptor, device_status))
607619 return false ;
608620 return true ;
0 commit comments