34 lines
729 B
C++
34 lines
729 B
C++
#ifndef Octoprint_h
|
|
#define Octoprint_h
|
|
|
|
#include <Arduino.h>
|
|
#include <ESP8266WiFi.h>
|
|
#include "Params.h"
|
|
|
|
|
|
class Octoprint
|
|
{
|
|
public:
|
|
Octoprint(String octoprint, String port, String API);
|
|
boolean connect();
|
|
void close();
|
|
void executeJson(String json, String svalue, String nvalue);
|
|
void executeJsonPost(String json, String postData);
|
|
//String getIdFromOctoprint();
|
|
String readLine();
|
|
static String getIndexOfString(String data, String separator, int index);
|
|
private:
|
|
const char* _pass;
|
|
public:
|
|
const char* _ssid;
|
|
WiFiClient _client;
|
|
char _octo[];
|
|
int _iport;
|
|
String _octoprint;
|
|
String _port;
|
|
String _API;
|
|
|
|
};
|
|
|
|
#endif
|