You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
888 B
35 lines
888 B
#ifndef TCP_H
|
|
#define TCP_H
|
|
|
|
#include <WiFi.h>
|
|
#include <WiFiClient.h>
|
|
#include <TFT_eSPI.h>
|
|
#include <SPI.h>
|
|
|
|
class TCP {
|
|
public:
|
|
// Constructor
|
|
TCP(const char* ssid, const char* password, const char* host, uint16_t port);
|
|
|
|
// Methods to connect to WiFi and send data
|
|
void connectWiFi(TFT_eSPI& tft);
|
|
void testConnection();
|
|
void sendData(float& potData, int& emoteIndex);
|
|
void receiveImage();
|
|
|
|
|
|
private:
|
|
const char* ssid; // WiFi SSID
|
|
const char* password; // WiFi password
|
|
const char* host; // Host IP address
|
|
uint16_t port; // Port number
|
|
WiFiClient client; // WiFi client object
|
|
TFT_eSPI* tft;
|
|
const int w = 128;
|
|
const int h = 168;
|
|
uint8_t imageBuffer[128 * 168 * 3];
|
|
uint16_t lineBuffer[128];
|
|
};
|
|
|
|
#endif // TCP_H
|
|
|
|
|