uEspConfigLib
https://github.com/Naguissa/uEspConfigLib
uEspConfigLibFSSd.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <Arduino.h>
25#include <SPI.h>
26#include <SD.h>
27
28#ifdef ARDUINO_ARCH_ESP32
29 #define uEspConfigLibFSSd_writeCasted(data) _dataFile.write((uint8_t *) data, strlen(data))
30#else
31 #define uEspConfigLibFSSd_writeCasted(data) _dataFile.write(data, strlen(data))
32#endif
33
34
36 public:
42 uEspConfigLibFSSd(const bool);
43
51 uEspConfigLibFSSd(const char*, const bool = false, const uint8_t = SS);
52
58 bool openToRead();
59
65 bool openToWrite();
66
73 bool readLine(String *);
74
81 bool write(const char *);
82
88 bool closeFile();
89
90 private:
91 uint8_t _status;
92 char * _path = 0;
93 File _dataFile;
94};
95
The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib - FileSystem interface...
Definition: uEspConfigLibFSInterface.h:50
The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib - SD-card FileSystem i...
Definition: uEspConfigLibFSSd.h:35
bool openToRead()
Opens the file for read.
Definition: uEspConfigLibFSSd.cpp:64
bool closeFile()
Closes current file.
Definition: uEspConfigLibFSSd.cpp:149
bool write(const char *)
Writes content to current file.
Definition: uEspConfigLibFSSd.cpp:137
uEspConfigLibFSSd(const bool)
Constructor.
Definition: uEspConfigLibFSSd.cpp:31
bool openToWrite()
Opens the file for write.
Definition: uEspConfigLibFSSd.cpp:91
bool readLine(String *)
Reads a whole line from current file.
Definition: uEspConfigLibFSSd.cpp:118