Skip to content

Commit

Permalink
Merge pull request #4 from SensESP/v3
Browse files Browse the repository at this point in the history
Update for SensESP v3
  • Loading branch information
mairas authored Aug 14, 2024
2 parents 06ecada + f02f662 commit 2895e52
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
7 changes: 1 addition & 6 deletions examples/vedirect-bmv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ using namespace sensesp;
reactesp::ReactESP app;

void setup() {
// Some initialization boilerplate when in debug mode...
#ifndef SERIAL_DEBUG_DISABLED
SetupSerialDebug(115200);
#endif
SetupLogging();

SensESPAppBuilder builder;

Expand Down Expand Up @@ -99,8 +96,6 @@ void setup() {
vedi->parser.data.maximum_auxiliary_voltage.connect_to(
new SKOutputFloat("electrical.batteries.start.maximumVoltage",
"/Signal K/Start Battery Maximum Voltage"));

sensesp_app->start();
}

void loop() { app.tick(); }
7 changes: 1 addition & 6 deletions examples/vedirect-solar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ using namespace sensesp;
reactesp::ReactESP app;

void setup() {
// Some initialization boilerplate when in debug mode...
#ifndef SERIAL_DEBUG_DISABLED
SetupSerialDebug(115200);
#endif
SetupLogging();

SensESPAppBuilder builder;

Expand Down Expand Up @@ -68,8 +65,6 @@ void setup() {
"electrical.solar." SOLAR_CHARGE_CONTROLLER_ID ".maxPowerToday",
"/Signal K/Solar Charger " SOLAR_CHARGE_CONTROLLER_ID
" Max Power Today"));

sensesp_app->start();
}

void loop() { app.tick(); }
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
{
"name": "SensESP",
"owner": "SignalK",
"version": "^2.5.1"
"version": ">=3.0.0-beta.1,<4.0.0-alpha.1"
}
],
"version": "1.0.0",
"version": "3.0.0",
"frameworks": "arduino",
"platforms": "*"
}
}
19 changes: 13 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
; https://docs.platformio.org/page/projectconf.html

[platformio]
default_envs =
default_envs =
esp32dev

[env]
framework = arduino
lib_ldf_mode = deep
monitor_speed = 115200
lib_deps =
SignalK/SensESP @ ^2.5.1
lib_deps =
SignalK/SensESP@>=3.0.0-beta.1,<4.0.0

[espressif32_base]
platform = espressif32
build_unflags = -Werror=reorder
Expand All @@ -28,5 +28,12 @@ monitor_filters = esp32_exception_decoder
[env:esp32dev]
extends = espressif32_base
board = esp32dev
build_flags =
-D LED_BUILTIN=2
build_flags =
-D LED_BUILTIN=2
; Max (and default) debugging level in Arduino ESP32 Core
-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
; Arduino Core bug workaround: define the log tag for the Arduino
; logging macros.
-D TAG='"Arduino"'
; Use the ESP-IDF logging library - required by SensESP.
-D USE_ESP_IDF_LOG
4 changes: 1 addition & 3 deletions src/sevedirect/sensors/vedirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include "sensesp.h"

VEDirectInput::VEDirectInput(Stream* rx_stream)
: Sensor(), rx_stream_{rx_stream} {}

void VEDirectInput::start() {
: rx_stream_{rx_stream} {
// enable reading the serial port
ReactESP::app->onAvailable(*rx_stream_, [this]() {
while (rx_stream_->available()) {
Expand Down
3 changes: 1 addition & 2 deletions src/sevedirect/sensors/vedirect.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ using namespace sensesp;

namespace sensesp {

class VEDirectInput : public Sensor {
class VEDirectInput {
public:
VEDirectInput(Stream* rx_stream);
virtual void start() override final;
VEDirect::Parser parser;

private:
Expand Down

0 comments on commit 2895e52

Please sign in to comment.