forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetVariables.h
More file actions
63 lines (43 loc) · 1.4 KB
/
SetVariables.h
File metadata and controls
63 lines (43 loc) · 1.4 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// matth-x/MicroOcpp
// Copyright Matthias Akstaller 2019 - 2024
// MIT License
#ifndef MO_SETVARIABLES_H
#define MO_SETVARIABLES_H
#include <MicroOcpp/Version.h>
#if MO_ENABLE_V201
#include <MicroOcpp/Core/Operation.h>
#include <MicroOcpp/Core/Memory.h>
#include <MicroOcpp/Model/Variables/Variable.h>
namespace MicroOcpp {
class VariableService;
namespace Ocpp201 {
// SetVariableDataType (2.44) and
// SetVariableResultType (2.45)
struct SetVariableData {
// SetVariableDataType
Variable::AttributeType attributeType = Variable::AttributeType::Actual;
const char *attributeValue; // will become invalid after processReq
String componentName;
int componentEvseId = -1;
int componentEvseConnectorId = -1;
String variableName;
// SetVariableResultType
SetVariableStatus attributeStatus;
SetVariableData(const char *memory_tag = nullptr);
};
class SetVariables : public Operation, public MemoryManaged {
private:
VariableService& variableService;
Vector<SetVariableData> queries;
const char *errorCode = nullptr;
public:
SetVariables(VariableService& variableService);
const char* getOperationType() override;
void processReq(JsonObject payload) override;
std::unique_ptr<JsonDoc> createConf() override;
const char *getErrorCode() override {return errorCode;}
};
} //namespace Ocpp201
} //namespace MicroOcpp
#endif //MO_ENABLE_V201
#endif