forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurationOptions.h
More file actions
42 lines (35 loc) · 1003 Bytes
/
Copy pathConfigurationOptions.h
File metadata and controls
42 lines (35 loc) · 1003 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
// matth-x/ArduinoOcpp
// Copyright Matthias Akstaller 2019 - 2021
// MIT License
#ifndef CONFIGURATIONOPTIONS_H
#define CONFIGURATIONOPTIONS_H
namespace ArduinoOcpp {
class FilesystemOpt{
private:
bool use = false;
bool mount = false;
bool formatFsOnFail = false;
public:
enum Mode : uint8_t {Deactivate, Use, Use_Mount, Use_Mount_FormatOnFail};
FilesystemOpt() = default;
FilesystemOpt(Mode mode) {
switch (mode) {
case (FilesystemOpt::Use_Mount_FormatOnFail):
formatFsOnFail = true;
//fallthrough
case (FilesystemOpt::Use_Mount):
mount = true;
//fallthrough
case (FilesystemOpt::Use):
use = true;
break;
default:
break;
}
}
bool accessAllowed() {return use;}
bool mustMount() {return mount;}
bool formatOnFail() {return formatFsOnFail;}
};
} //end namespace ArduinoOcpp
#endif