Magic Poi Lite 0.1
IOT LED Poi
Loading...
Searching...
No Matches
Loading.h
Go to the documentation of this file.
1#ifndef LOADING_H
2#define LOADING_H
3
4#include <Arduino.h>
5#include <WiFiClient.h>
6#include <Authentication.h>
7
8/**
9 * @file Loading.h
10 * @brief Declaration of the Loading class.
11 */
12
13class Loading {
14public:
15 Loading(); // Constructor declaration
16 String getTimelineNumber();
17 bool getTimeline(String tln);
18 void saveTimeline(const String &timelineData);
19 bool load();
20
21private:
22 /**
23 * @brief WiFi client object.
24 *
25 * This object is used for network communication with the server.
26 */
27 WiFiClient client;
28
29 /**
30 * @brief Authentication object.
31 *
32 * This object is used for handling authentication operations.
33 */
35
36 /**
37 * @brief JWT token buffer.
38 *
39 * This buffer stores the JWT token retrieved from authentication.
40 */
41 char token[512];
42
43 /**
44 * @brief Default timeline number.
45 *
46 * This string represents the default timeline number used for file paths.
47 */
48 String timelineNumber = "0";
49
50 /**
51 * @brief File path of the timeline file.
52 *
53 * This string represents the file path of the timeline data file, saved in LittleFS.
54 */
55 String timelineFilePath = "/timeline" + timelineNumber + ".txt";
56};
57
58#endif
Declaration of the Authentication class.
Definition Authentication.h:12
Definition Loading.h:13
WiFiClient client
WiFi client object.
Definition Loading.h:27
String timelineNumber
Default timeline number.
Definition Loading.h:48
bool load()
Loads data required for the application.
Definition Loading.cpp:181
void saveTimeline(const String &timelineData)
Saves the timeline data to a file.
Definition Loading.cpp:155
Loading()
Default constructor for Loading class.
Definition Loading.cpp:25
String getTimelineNumber()
Retrieves the current timeline number from the server.
Definition Loading.cpp:54
bool getTimeline(String tln)
Retrieves the timeline data from the server based on the specified timeline number.
Definition Loading.cpp:101
Authentication authentication
Authentication object.
Definition Loading.h:34
char token[512]
JWT token buffer.
Definition Loading.h:41
String timelineFilePath
File path of the timeline file.
Definition Loading.h:55