35 lines
470 B
C++
35 lines
470 B
C++
#ifndef API_H
|
|
#define API_H
|
|
|
|
#include <Arduino_JSON.h>
|
|
#include <WiFiEsp.h>
|
|
|
|
class API {
|
|
public:
|
|
|
|
|
|
|
|
API(String user, String password, String host, bool https = true);
|
|
|
|
bool wifiBegin(String wifiId, String wifiPass, Stream* espSerial);
|
|
|
|
bool sendValute(String val, String poubelleID);
|
|
|
|
JSONVar* connect();
|
|
|
|
private:
|
|
|
|
String user;
|
|
String password;
|
|
String serveurHost;
|
|
bool https;
|
|
|
|
WiFiEspClient* client;
|
|
String token;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif |