forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOcppConnection.h
More file actions
40 lines (29 loc) · 1 KB
/
Copy pathOcppConnection.h
File metadata and controls
40 lines (29 loc) · 1 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
// matth-x/ArduinoOcpp
// Copyright Matthias Akstaller 2019 - 2022
// MIT License
#ifndef OCPPCONNECTION_H
#define OCPPCONNECTION_H
#include <deque>
#include <memory>
#include <ArduinoJson.h>
namespace ArduinoOcpp {
class OcppModel;
class OcppSocket;
class OcppOperation;
class OcppConnection {
private:
std::shared_ptr<OcppModel> baseModel;
std::deque<std::unique_ptr<OcppOperation>> initiatedOcppOperations;
std::deque<std::unique_ptr<OcppOperation>> receivedOcppOperations;
void handleConfMessage(JsonDocument& json);
void handleReqMessage(JsonDocument& json);
void handleReqMessage(JsonDocument& json, std::unique_ptr<OcppOperation> op);
void handleErrMessage(JsonDocument& json);
public:
OcppConnection(OcppSocket& oSock, std::shared_ptr<OcppModel> baseModel);
void loop(OcppSocket& oSock);
void initiateOcppOperation(std::unique_ptr<OcppOperation> o);
bool processOcppSocketInputTXT(const char* payload, size_t length);
};
} //end namespace ArduinoOcpp
#endif