-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerialSDManager.h
More file actions
44 lines (35 loc) · 1002 Bytes
/
SerialSDManager.h
File metadata and controls
44 lines (35 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SERIALSDMANAGER_H
#define SERIALSDMANAGER_H
#include <SD.h>
#include <SPI.h>
#include <CRC32.h> // Füge die CRC32-Bibliothek hinzu
class SerialSDManager {
public:
SerialSDManager(int chipSelectPin);
void begin();
void checkForSerialInput();
private:
const int chipSelect;
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;
static const byte numChars = 400;
char receivedChars[numChars];
char tempChars[numChars];
char cmdMsg[numChars] = {0};
char cmdFileName[50] = {0};
int cmdId = 0;
boolean newData = false;
void recvWithStartEndMarkers();
void parseData();
void executeCommand();
void printRoot();
void printFileContent(const char* filename);
void deleteFile(const char* fileName);
void deleteAllCfgExcept(const char* keepFile);
void writeFile(const char* fileName, const char* fileContent);
char* findConfigFile();
SdFile getParentDir(const char* filepath, int* index);
};
#endif // SERIALSDMANAGER_H