Skip to content

Commit

Permalink
Merge pull request #149 from melkati/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
melkati authored Jan 29, 2024
2 parents 92f567e + 670f511 commit 12324ef
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 125 deletions.
3 changes: 2 additions & 1 deletion CO2_Gadget.ino
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,9 @@ void setup() {
#ifdef SUPPORT_BLE
initBLE();
#endif
initWifi();
initSensors();
initWifi();
wifiChanged = false;
#ifdef SUPPORT_ESPNOW
initESPNow();
#endif
Expand Down
6 changes: 4 additions & 2 deletions CO2_Gadget_BLE.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
#include "Sensirion_Gadget_BLE.h"
#include "WifiMultiLibraryWrapper.h"

// clang-format on

NimBLELibraryWrapper lib;
WifiMultiLibraryWrapper wifi;
DataProvider provider(lib, DataType::T_RH_CO2_ALT, true, false, false, &wifi);
// DataProvider provider(lib, DataType::T_RH_CO2_ALT);
#endif

void initBLE() {
#ifdef SUPPORT_BLE
#ifdef SUPPORT_BLE
if (activeBLE) {
if (bleInitialized) {
Serial.print(
Expand All @@ -36,7 +38,7 @@ void initBLE() {

void publishBLE() {
#ifdef SUPPORT_BLE
if (activeBLE) {
if ((activeBLE) && (co2 > 0)) {
provider.writeValueToCurrentSample(co2, SignalType::CO2_PARTS_PER_MILLION);
provider.writeValueToCurrentSample(temp, SignalType::TEMPERATURE_DEGREES_CELSIUS);
provider.writeValueToCurrentSample(hum, SignalType::RELATIVE_HUMIDITY_PERCENTAGE);
Expand Down
2 changes: 2 additions & 0 deletions CO2_Gadget_Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ void initPreferences() {
wifiPass.trim();
hostName.trim();
preferences.end();
#ifdef DEBUG_PREFERENCES
printPreferences();
#endif
}

void putPreferences() {
Expand Down
Loading

0 comments on commit 12324ef

Please sign in to comment.