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/v2/connectivity_manager.hpp>
8#include <ocpp/v2/device_model.hpp>
9
10namespace ocpp {
11namespace v2 {
12
13class MessageDispatcher : public MessageDispatcherInterface<MessageType> {
14
15public:
17 std::atomic<RegistrationStatusEnum>& registration_status) :
18 message_queue(message_queue), device_model(device_model), registration_status(registration_status){};
19 void dispatch_call(const json& call, bool triggered = false) override;
20 std::future<ocpp::EnhancedMessage<MessageType>> dispatch_call_async(const json& call, bool triggered) override;
21 void dispatch_call_result(const json& call_result) override;
22 void dispatch_call_error(const json& call_error) override;
23
24private:
26 DeviceModel& device_model;
27 std::atomic<RegistrationStatusEnum>& registration_status;
28};
29
30} // namespace v2
31} // namespace ocpp
Interface for dispatching OCPP messages that shall be send over the websocket. This interface defines...
Definition: message_dispatcher.hpp:13
This class manages access to the device model representation and to the device model interface and pr...
Definition: device_model.hpp:96
Definition: message_dispatcher.hpp:13
void dispatch_call_error(const json &call_error) override
Dispatches a CallError message.
Definition: message_dispatcher.cpp:54
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:29
void dispatch_call(const json &call, bool triggered=false) override
Dispatches a Call message.
Definition: message_dispatcher.cpp:10