Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
SDLoggerDataEntry.hpp
1
#include <string>
2
#include <vector>
3
#include "../TimeStamp/TimeStamp.hpp"
4
#include "../MQTTMailer/MQTTMailer.hpp"
5
6
using namespace
std;
7
8
/*
9
* Class defining the syntax for a data entry by the SDLogger. Used for storing and retrieving data, as well as formatting and
10
* performing basic operations/conversions.
11
*
12
*/
13
class
SDLoggerDataEntry
{
14
15
public
:
16
17
TimeStamp
* timestamp;
// timestamp data was recorded at
18
string
topic;
// mqtt topic/type of data recorded here
19
string
data;
// the data string
20
//
21
22
SDLoggerDataEntry
(){;}
23
24
SDLoggerDataEntry
(
TimeStamp
ts
,
string
topic,
string
data){
25
this->timestamp = &
ts
;
26
this->topic = topic;
27
this->data = data;
28
}
29
30
string
to_mqtt_message(
string
topic);
// convert fields to an mqtt message
31
//
32
33
string
to_string(){
return
this->timestamp->to_string() +
", "
+ topic +
", "
+ data; }
34
35
};
36
37
SDLoggerDataEntry
Definition
SDLoggerDataEntry.hpp:13
TimeStamp
Definition
TimeStamp.hpp:14
reset_count
int reset_count
number of resets retrieved for NVS
Definition
scheduler.hpp:31
lib
SDLogger
SDLoggerDataEntry.hpp
Generated by
1.10.0