39 lines
921 B
C++
39 lines
921 B
C++
#ifndef netserver_h
|
|
#define netserver_h
|
|
#include "Arduino.h"
|
|
|
|
#include "ESPAsyncWebServer.h"
|
|
#include "AsyncUDP.h"
|
|
|
|
enum requestType_e { PLAYLIST, STATION, ITEM, TITLE, VOLUME, NRSSI, BITRATE, MODE, EQUALIZER, BALANCE, PLAYLISTSAVED };
|
|
|
|
class NetServer {
|
|
public:
|
|
uint8_t playlistrequest; // ClientId want the playlist
|
|
bool importRequest;
|
|
bool resumePlay;
|
|
public:
|
|
NetServer() {};
|
|
bool begin();
|
|
void loop();
|
|
void requestOnChange(requestType_e request, uint8_t clientId);
|
|
void setRSSI(int val);
|
|
void onWsMessage(void *arg, uint8_t *data, size_t len);
|
|
bool savePlaylist(const char* post);
|
|
#if IR_PIN!=255
|
|
bool irRecordEnable;
|
|
void irToWs(const char* protocol, uint64_t irvalue);
|
|
void irValsToWs();
|
|
#endif
|
|
private:
|
|
requestType_e request;
|
|
int rssi;
|
|
|
|
void getPlaylist(uint8_t clientId);
|
|
bool importPlaylist();
|
|
};
|
|
|
|
extern NetServer netserver;
|
|
|
|
#endif
|