csv_writer.h 688 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef CSV_WRITER_H_
#define CSV_WRITER_H_

#if defined(ESP8266)
#  include <LittleFS.h>
#  define FS_LIB LittleFS
#elif defined(ESP32)
#  include <SPIFFS.h>
#  define FS_LIB SPIFFS
#else
#  error Board should be either ESP8266 or ESP832
#endif

namespace config {
Eric Duminil's avatar
Eric Duminil committed
15
  extern uint16_t csv_interval; // [s]
16
17
}
namespace csv_writer {
Eric Duminil's avatar
Eric Duminil committed
18
19
20
  extern char last_successful_write[];
  void initialize(const char *sensorId);
  void logIfTimeHasCome(const char *timestamp, const int16_t &co2, const float &temperature, const float &humidity);
21
  int getAvailableSpace();
Eric Duminil's avatar
Eric Duminil committed
22
  extern char filename[];
23
24

  void setCSVinterval(int32_t csv_interval);
Eric Duminil's avatar
Eric Duminil committed
25
  void showCSVContent();
26
  void formatFilesystem();
27
28
29
}

#endif