Files
yoradio/yoRadio/netserver.h
2022-08-15 14:19:39 +03:00

41 lines
1.1 KiB
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, GETMODE, GETINDEX, GETACTIVE, GETSYSTEM, GETSCREEN, GETTIMEZONE, GETWEATHER, GETCONTROLS };
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, uint8_t clientId);
bool savePlaylist(const char* post);
void takeMallocDog();
void giveMallocDog();
#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