-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebaseHandler.h
53 lines (40 loc) · 1.23 KB
/
firebaseHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef FIREBASEHANDLER_H
#define FIREBASEHANDLER_H
// Checks and conntects to Firebase database
#include <Arduino.h>
#include <list>
#include "BuildIndicator.h"
#include "configHandler.h"
#include "interpretation.h"
#include "ledHandler.h"
#include "displayHandler.h"
class FirebaseHandler {
public:
explicit FirebaseHandler(ConfigHandler& configHandler, LedHandler& ledHandler, DisplayHandler& displayHandler);
~FirebaseHandler();
void begin(String host, String auth, String path);
void updateListOfBuilds();
std::list<String> listBuilds();
void saveBuildKeys();
void saveInterpretations();
String* getBuildKeys();
Color* getColors();
std::list<Interpretation>& getInterpretations();
void handleEvents();
private:
void refreshAllBuildKeys();
void refreshBuildKey(String key, String result);
void startStreaming();
Color getColorOfResult(String result);
String m_firebaseHost;
String m_firebaseAuth;
String m_firebasePath;
String m_buildKeys[NUM_OF_PIXELS];
Color m_colors[NUM_OF_PIXELS];
ConfigHandler& m_configHandler;
LedHandler& m_ledHandler;
DisplayHandler& m_displayHandler;
std::list<String> m_listOfBuilds;
std::list<Interpretation> m_interpretations;
};
#endif // FIREBASEHANDLER_H