12#include "../../include/SDCard.hpp"
35 std::string filetype =
".csv";
36 std::string separator =
";";
56 SDLogger(std::string
prefix,
int month,
int day,
int year, std::string filetype);
70 void set_filename(std::string
prefix,
int month,
int day,
int year, std::string filetype);
Thin wrapper around ESP32 SD card API.
Definition SDCard.hpp:28
bool exists(const char *path)
Definition SDCard.hpp:109
Creates an interface for writing data to a log file on an SD card.
Definition SDLogger.hpp:30
void close_card()
Close card connection.
Definition SDLogger.cpp:112
SDLogger()
Default constructor that performs no initialization.
Definition SDLogger.hpp:46
void write_line(std::string line)
Write a line to the file, will overwrite the contents of the file.
Definition SDLogger.cpp:124
bool initialize_sd_card()
Call before using SD card interface. Initializes connection to SD card.
Definition SDLogger.cpp:37
void log_absolute_mqtt(std::string time, std::string mqtt_topic, std::string mqtt_message)
Append a line to the target csv file containing an absolute time stamp, mqtt topic,...
Definition SDLogger.cpp:161
bool exists(std::string fn)
File with name fn exists in SD card's filesystem.
Definition SDLogger.hpp:116
bool exists()
File with name stored in this->filename exists in SD card's filesystem.
Definition SDLogger.hpp:121
void log_relative_mqtt(std::string time, int offset, std::string mqtt_topic, std::string mqtt_message)
Append a line with a relative time stamp to the target file.
Definition SDLogger.cpp:181
File open_file(const char *mode=FILE_WRITE)
Opens the file attached to the logger object with the default mode.
Definition SDLogger.cpp:92
void read()
Not implemented
void append_line(std::string line)
Open file and append a line, add newline if needed.
Definition SDLogger.cpp:141
void set_filename(std::string)
Set the filename to write to the easiest way possible.
Definition SDLogger.cpp:59
void write_header(std::vector< std::string > fields)
Writes a header line to a file using append to prevent overwriting valuable data.
Definition SDLogger.cpp:197
int reset_count
number of resets retrieved for NVS
Definition scheduler.hpp:31