ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
message_dispatcher.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_dispatcher.hpp>
7#include <ocpp/v16/charge_point_configuration.hpp>
8
9namespace ocpp {
10namespace v16 {
11
12class MessageDispatcher : public MessageDispatcherInterface<MessageType> {
13
14public:
16 std::atomic<RegistrationStatus>& registration_status) :
17 message_queue(message_queue), configuration(configuration), registration_status(registration_status){};
18 void dispatch_call(const json& call, bool triggered = false) override;
19 std::future<ocpp::EnhancedMessage<MessageType>> dispatch_call_async(const json& call, bool triggered) override;
20 void dispatch_call_result(const json& call_result) override;
21 void dispatch_call_error(const json& call_error) override;
22
23private:
25 ChargePointConfiguration& configuration;
26 std::atomic<RegistrationStatus>& registration_status;
27};
28
29} // namespace v16
30} // namespace ocpp
Interface for dispatching OCPP messages that shall be send over the websocket. This interface defines...
Definition: message_dispatcher.hpp:13
contains the configuration of the charge point
Definition: charge_point_configuration.hpp:17
Definition: message_dispatcher.hpp:12
void dispatch_call_result(const json &call_result) override
Dispatches a CallResult message.
Definition: message_dispatcher.cpp:50
std::future< ocpp::EnhancedMessage< MessageType > > dispatch_call_async(const json &call, bool triggered) override
Dispatches a Call message asynchronously.
Definition: message_dispatcher.cpp:28
void dispatch_call_error(const json &call_error) override
Dispatches a CallError message.
Definition: message_dispatcher.cpp:54
void dispatch_call(const json &call, bool triggered=false) override
Dispatches a Call message.
Definition: message_dispatcher.cpp:9