Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

#include <http_server/HttpServerBase.h>

class HttpServerTemperature: public HttpServerBase {
class HttpServerTemperature : public HttpServerBase
{
private:
String _sensorId;

public:
HttpServerTemperature(String host, String secretKey, String path, String sensorId);
HttpServerTemperature(String host, String secretKey, String sensorId, String path);
void sendCurrentTemperature(float temperature);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

#include <http_server/HttpServerBase.h>

class HttpServerWaterPump: public HttpServerBase {
class HttpServerWaterPump : public HttpServerBase
{
private:
String _waterPumpId;

public:
HttpServerWaterPump(String host, String secretKey, String path, String waterPumpId);
HttpServerWaterPump(String host, String secretKey, String waterPumpId, String path);
void sendWaterPumpStatusOn();
void sendWaterPumpStatusOff();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void HttpServerBuoy::sendBuoyInactive()
HTTPClient https = setupHttps();
JsonDocument payload;
payload["buoyId"] = _buoyId;
payload["newValue"] = true;
payload["newValue"] = false;
char requestBody[50];
serializeJson(payload, requestBody);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "http_server/HttpServerTemperature.h"

HttpServerTemperature::HttpServerTemperature(String host, String secretKey, String path, String sensorId) : HttpServerBase(host, secretKey, path), _sensorId(sensorId) {}
HttpServerTemperature::HttpServerTemperature(String host, String secretKey, String sensorId, String path) : HttpServerBase(host, secretKey, path), _sensorId(sensorId) {}

void HttpServerTemperature::sendCurrentTemperature(float temperature)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "http_server/HttpServerWaterPump.h"

HttpServerWaterPump::HttpServerWaterPump(String host, String secretKey, String path, String waterPumpId) : HttpServerBase(host, secretKey, path), _waterPumpId(waterPumpId) {}
HttpServerWaterPump::HttpServerWaterPump(String host, String secretKey, String waterPumpId, String path) : HttpServerBase(host, secretKey, path), _waterPumpId(waterPumpId) {}

void HttpServerWaterPump::sendWaterPumpStatusOn()
{
Expand Down Expand Up @@ -34,7 +34,7 @@ void HttpServerWaterPump::sendWaterPumpStatusOff()
HTTPClient https = setupHttps();
JsonDocument payload;
payload["fanId"] = _waterPumpId;
payload["on"] = true;
payload["on"] = false;
char requestBody[50];
serializeJson(payload, requestBody);

Expand Down
8 changes: 4 additions & 4 deletions hardware/TheReefEmbedded/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ WiFiHandler wiFiHandler(PIN_BUTTON_RESET_WIFI);
TemperatureManager temperatureManager(minTemperature, maxTemperature);
WaterLevelManager waterLevelManager;

HttpServerFan httpServerFan(HOST, secretKey, "10", "/fans/update_on");
HttpServerTemperature httpServerTemperature(HOST, secretKey, "1", "/indicators/update");
HttpServerBuoy httpServerBuoy(HOST, secretKey, "4", "/buoys/update");
HttpServerWaterPump httpServerWaterPump(HOST, secretKey, "11", "/fans/update_on"); // no sevidor aparece como boia, pois é o sensor da boia que envia para o servidor da bomba
HttpServerFan httpServerFan(HOST, secretKey, "14", "/fans/update_on");
HttpServerTemperature httpServerTemperature(HOST, secretKey, "5", "/indicators/update");
HttpServerBuoy httpServerBuoy(HOST, secretKey, "15", "/buoys/update");
HttpServerWaterPump httpServerWaterPump(HOST, secretKey, "15", "/fans/update_on"); // no sevidor aparece como boia, pois é o sensor da boia que envia para o servidor da bomba

LcdManager lcdManager;

Expand Down
Loading