ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
message_handler.hpp
1// SPDX-License-Identifier: Apache-2.0
2// Copyright Pionix GmbH and Contributors to EVerest
3
4#pragma once
5
6#include <ocpp/common/message_queue.hpp>
7
8namespace ocpp {
9namespace v2 {
10
14
15public:
16 virtual ~MessageHandlerInterface() {
17 }
21 virtual void handle_message(const EnhancedMessage<MessageType>& message) = 0;
22};
23
24class MessageTypeNotImplementedException : public std::exception {
25private:
26 std::string message;
27
28public:
29 MessageTypeNotImplementedException(MessageType message_type) :
30 message("Message is not implemented: " + conversions::messagetype_to_string(message_type)) {
31 }
32
33 const char* what() const noexcept override {
34 return message.c_str();
35 }
36};
37
38} // namespace v2
39} // namespace ocpp
Interface for handling OCPP2.0.1 CALL messages from the CSMS. Classes implementing a functional block...
Definition: message_handler.hpp:13
virtual void handle_message(const EnhancedMessage< MessageType > &message)=0
Handles the given message from the CSMS. This includes dispatching a CALLRESULT as a response to the ...
Definition: message_handler.hpp:24
Contains a OCPP message in json form with additional information.
Definition: message_queue.hpp:54