me la pela
This commit is contained in:
46
hardware/include/JsonTools.hpp
Normal file
46
hardware/include/JsonTools.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include <ArduinoJson.h>
|
||||
#include <HTTPClient.h>
|
||||
|
||||
String serializeSensorValue (
|
||||
int sensorId,
|
||||
int deviceId,
|
||||
String sensorType,
|
||||
String unit,
|
||||
int sensorStatus,
|
||||
float temperature,
|
||||
float humidity,
|
||||
float carbonMonoxide,
|
||||
float lat,
|
||||
float lon,
|
||||
long timestamp
|
||||
);
|
||||
|
||||
String serializeActuatorStatus (
|
||||
int actuatorId,
|
||||
int deviceId,
|
||||
int status,
|
||||
long timestamp
|
||||
);
|
||||
|
||||
String serializeDevice (
|
||||
int sensorId,
|
||||
int deviceId,
|
||||
String sensorType,
|
||||
int status,
|
||||
long timestamp
|
||||
);
|
||||
|
||||
void deserializeSensorValue (
|
||||
HTTPClient &http,
|
||||
int httpResponseCode
|
||||
);
|
||||
|
||||
void deserializeActuatorStatus (
|
||||
HTTPClient &http,
|
||||
int httpResponseCode
|
||||
);
|
||||
|
||||
void deserializeDevice (
|
||||
HTTPClient &http,
|
||||
int httpResponseCode
|
||||
);
|
||||
4
hardware/include/RestClient.hpp
Normal file
4
hardware/include/RestClient.hpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#include <HTTPClient.h>
|
||||
|
||||
void getRequest(HTTPClient &httpClient, const String url, String &response);
|
||||
void postRequest(HTTPClient &httpClient, const String url, const String &payload, String &response);
|
||||
7
hardware/include/WifiConnection.hpp
Normal file
7
hardware/include/WifiConnection.hpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
#define SSID "iPhone de Álvaro"
|
||||
#define PASSWORD "alvarito123"
|
||||
|
||||
int setupWifi();
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "json.hpp"
|
||||
@@ -9,4 +10,14 @@
|
||||
#define LED 2
|
||||
#define SERVER_IP "192.168.1.178"
|
||||
#define REST_PORT 80
|
||||
#define MQTT_PORT 1883
|
||||
#define MQTT_PORT 1883
|
||||
=======
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "JsonTools.hpp"
|
||||
#include "RestClient.hpp"
|
||||
#include "WifiConnection.hpp"
|
||||
#include "MqttClient.hpp"
|
||||
|
||||
uint32_t getChipID();
|
||||
>>>>>>> main
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include <HTTPClient.h>
|
||||
Reference in New Issue
Block a user