35 lines
470 B
C
Raw Normal View History

2023-03-27 17:42:17 +02:00
#ifndef API_H
#define API_H
#include <Arduino_JSON.h>
#include <WiFiEsp.h>
2023-03-27 17:42:17 +02:00
class API {
public:
2023-03-28 16:05:36 +02:00
API(String user, String password, String host, bool https = true);
bool wifiBegin(String wifiId, String wifiPass, Stream* espSerial);
2023-03-28 16:05:36 +02:00
bool sendValute(String val, String poubelleID);
2023-03-27 17:42:17 +02:00
JSONVar* connect();
2023-03-28 16:05:36 +02:00
private:
String user;
String password;
String serveurHost;
bool https;
WiFiEspClient* client;
2023-03-28 16:05:36 +02:00
String token;
2023-03-27 17:42:17 +02:00
};
#endif