Added BLE on ESP32 target.

This commit is contained in:
Magnus Persson
2022-03-10 11:10:54 +01:00
parent 6dfe5a80fd
commit 21fba0481c
13 changed files with 241 additions and 5 deletions

View File

@ -30,6 +30,7 @@ SOFTWARE.
#include <tempsensor.hpp>
#include <webserver.hpp>
#include <wifi.hpp>
#include <ble.hpp>
// Define constats for this program
#ifdef DEACTIVATE_SLEEPMODE
@ -248,6 +249,14 @@ bool loopReadGravity() {
angle, tempC, gravity, corrGravity);
#endif
#if defined (ESP32)
if (myConfig.isBLEActive()) {
BleSender ble(myConfig.getColorBLE());
ble.sendData( convertCtoF(tempC), gravitySG);
Log.notice(F("MAIN: Broadcast data over bluetooth." CR));
}
#endif
bool pushExpired = (abs((int32_t)(millis() - pushMillis)) >
(myConfig.getSleepInterval() * 1000));