forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperation.cpp
More file actions
50 lines (37 loc) · 1.36 KB
/
Copy pathOperation.cpp
File metadata and controls
50 lines (37 loc) · 1.36 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
// matth-x/MicroOcpp
// Copyright Matthias Akstaller 2019 - 2023
// MIT License
#include <MicroOcpp/Core/Operation.h>
#include <MicroOcpp/Debug.h>
using MicroOcpp::Operation;
Operation::Operation() {}
Operation::~Operation() {}
const char* Operation::getOperationType(){
MO_DBG_ERR("Unsupported operation: getOperationType() is not implemented");
return "CustomOperation";
}
void Operation::initiate(StoredOperationHandler *rpcData) {
//called after initiateRequest(anyMsg)
}
bool Operation::restore(StoredOperationHandler *rpcData) {
return false;
}
std::unique_ptr<DynamicJsonDocument> Operation::createReq() {
MO_DBG_ERR("Unsupported operation: createReq() is not implemented");
return createEmptyDocument();
}
void Operation::processConf(JsonObject payload) {
MO_DBG_ERR("Unsupported operation: processConf() is not implemented");
}
void Operation::processReq(JsonObject payload) {
MO_DBG_ERR("Unsupported operation: processReq() is not implemented");
}
std::unique_ptr<DynamicJsonDocument> Operation::createConf() {
MO_DBG_ERR("Unsupported operation: createConf() is not implemented");
return createEmptyDocument();
}
std::unique_ptr<DynamicJsonDocument> MicroOcpp::createEmptyDocument() {
auto emptyDoc = std::unique_ptr<DynamicJsonDocument>(new DynamicJsonDocument(0));
emptyDoc->to<JsonObject>();
return emptyDoc;
}