csv_writer.h 628 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 csv_writer {
Eric Duminil's avatar
Eric Duminil committed
15
16
17
  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);
18
  int getAvailableSpace();
Eric Duminil's avatar
Eric Duminil committed
19
  extern char filename[];
20
21

  void setCSVinterval(int32_t csv_interval);
Eric Duminil's avatar
Eric Duminil committed
22
  void showCSVContent();
23
  void formatFilesystem();
24
25
26
}

#endif