Init commit
This commit is contained in:
@@ -1 +1,38 @@
|
||||
#include "json.hpp"
|
||||
#include "json.hpp"
|
||||
|
||||
String response;
|
||||
|
||||
String serializeSensorValue (
|
||||
int sensorId,
|
||||
int deviceId,
|
||||
String sensorType,
|
||||
String unit,
|
||||
int sensorStatus,
|
||||
float temperature,
|
||||
float humidity,
|
||||
float carbonMonoxide,
|
||||
float lat,
|
||||
float lon,
|
||||
long timestamp
|
||||
)
|
||||
{
|
||||
DynamicJsonDocument doc(2048);
|
||||
|
||||
String output;
|
||||
|
||||
doc["sensorId"] = sensorId;
|
||||
doc["deviceId"] = deviceId;
|
||||
doc["sensorType"] = sensorType;
|
||||
doc["unit"] = unit;
|
||||
doc["sesnsorStatuts"] = sensorStatus;
|
||||
doc["temperature"] = temperature;
|
||||
doc["humidity"] = humidity;
|
||||
doc["carbonMonoxide"] = carbonMonoxide;
|
||||
doc["lat"] = lat;
|
||||
doc["lon"] = lon;
|
||||
doc["timestamp"] = timestamp;
|
||||
|
||||
serializeJson(doc, output);
|
||||
Serial.println(output);
|
||||
return output;
|
||||
}
|
||||
@@ -1 +1,4 @@
|
||||
#include "rest.hpp"
|
||||
#include "rest.hpp"
|
||||
|
||||
RestClient client = RestClient(SERVER_IP, SERVER_PORT);
|
||||
|
||||
Reference in New Issue
Block a user