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
39 lines (29 loc) · 951 Bytes
/
Copy pathOcppConnection.h
File metadata and controls
39 lines (29 loc) · 951 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
// matth-x/ESP8266-OCPP
// Copyright Matthias Akstaller 2019 - 2021
// MIT License
#ifndef OCPPCONNECTION_H
#define OCPPCONNECTION_H
#include <deque>
#include <memory>
#include <WebSocketsClient.h>
#include <ArduinoJson.h>
#include <ArduinoOcpp/Core/OcppSocket.h>
#include <ArduinoOcpp/Core/OcppOperation.h>
namespace ArduinoOcpp {
class OcppConnection {
private:
OcppSocket *ocppSock;
std::deque<OcppOperation*> initiatedOcppOperations;
std::deque<OcppOperation*> receivedOcppOperations;
void handleConfMessage(JsonDocument *json);
void handleReqMessage(JsonDocument *json);
void handleReqMessage(JsonDocument *json, OcppOperation *op);
void handleErrMessage(JsonDocument *json);
public:
OcppConnection(OcppSocket *ocppSock);
void loop();
void initiateOcppOperation(OcppOperation *o);
bool processOcppSocketInputTXT(const char* payload, size_t length);
};
} //end namespace ArduinoOcpp
#endif