ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
types.hpp
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest
3#ifndef V2_TYPES_HPP
4#define V2_TYPES_HPP
5
6#include <ocpp/v2/ocpp_types.hpp>
7
8#include <ostream>
9#include <string>
10
11namespace ocpp {
12namespace v2 {
13
15enum class MessageType {
16 Authorize,
17 AuthorizeResponse,
18 BootNotification,
19 BootNotificationResponse,
20 CancelReservation,
21 CancelReservationResponse,
22 CertificateSigned,
23 CertificateSignedResponse,
24 ChangeAvailability,
25 ChangeAvailabilityResponse,
26 ClearCache,
27 ClearCacheResponse,
28 ClearChargingProfile,
29 ClearChargingProfileResponse,
30 ClearDisplayMessage,
31 ClearDisplayMessageResponse,
32 ClearedChargingLimit,
33 ClearedChargingLimitResponse,
34 ClearVariableMonitoring,
35 ClearVariableMonitoringResponse,
36 CostUpdated,
37 CostUpdatedResponse,
38 CustomerInformation,
39 CustomerInformationResponse,
40 DataTransfer,
41 DataTransferResponse,
42 DeleteCertificate,
43 DeleteCertificateResponse,
44 FirmwareStatusNotification,
45 FirmwareStatusNotificationResponse,
46 Get15118EVCertificate,
47 Get15118EVCertificateResponse,
48 GetBaseReport,
49 GetBaseReportResponse,
50 GetCertificateStatus,
51 GetCertificateStatusResponse,
52 GetChargingProfiles,
53 GetChargingProfilesResponse,
54 GetCompositeSchedule,
55 GetCompositeScheduleResponse,
56 GetDisplayMessages,
57 GetDisplayMessagesResponse,
58 GetInstalledCertificateIds,
59 GetInstalledCertificateIdsResponse,
60 GetLocalListVersion,
61 GetLocalListVersionResponse,
62 GetLog,
63 GetLogResponse,
64 GetMonitoringReport,
65 GetMonitoringReportResponse,
66 GetReport,
67 GetReportResponse,
68 GetTransactionStatus,
69 GetTransactionStatusResponse,
70 GetVariables,
71 GetVariablesResponse,
72 Heartbeat,
73 HeartbeatResponse,
74 InstallCertificate,
75 InstallCertificateResponse,
76 LogStatusNotification,
77 LogStatusNotificationResponse,
78 MeterValues,
79 MeterValuesResponse,
80 NotifyChargingLimit,
81 NotifyChargingLimitResponse,
82 NotifyCustomerInformation,
83 NotifyCustomerInformationResponse,
84 NotifyDisplayMessages,
85 NotifyDisplayMessagesResponse,
86 NotifyEVChargingNeeds,
87 NotifyEVChargingNeedsResponse,
88 NotifyEVChargingSchedule,
89 NotifyEVChargingScheduleResponse,
90 NotifyEvent,
91 NotifyEventResponse,
92 NotifyMonitoringReport,
93 NotifyMonitoringReportResponse,
94 NotifyReport,
95 NotifyReportResponse,
96 PublishFirmware,
97 PublishFirmwareResponse,
98 PublishFirmwareStatusNotification,
99 PublishFirmwareStatusNotificationResponse,
100 ReportChargingProfiles,
101 ReportChargingProfilesResponse,
102 RequestStartTransaction,
103 RequestStartTransactionResponse,
104 RequestStopTransaction,
105 RequestStopTransactionResponse,
106 ReservationStatusUpdate,
107 ReservationStatusUpdateResponse,
108 ReserveNow,
109 ReserveNowResponse,
110 Reset,
111 ResetResponse,
112 SecurityEventNotification,
113 SecurityEventNotificationResponse,
114 SendLocalList,
115 SendLocalListResponse,
116 SetChargingProfile,
117 SetChargingProfileResponse,
118 SetDisplayMessage,
119 SetDisplayMessageResponse,
120 SetMonitoringBase,
121 SetMonitoringBaseResponse,
122 SetMonitoringLevel,
123 SetMonitoringLevelResponse,
124 SetNetworkProfile,
125 SetNetworkProfileResponse,
126 SetVariableMonitoring,
127 SetVariableMonitoringResponse,
128 SetVariables,
129 SetVariablesResponse,
130 SignCertificate,
131 SignCertificateResponse,
132 StatusNotification,
133 StatusNotificationResponse,
134 TransactionEvent,
135 TransactionEventResponse,
136 TriggerMessage,
137 TriggerMessageResponse,
138 UnlockConnector,
139 UnlockConnectorResponse,
140 UnpublishFirmware,
141 UnpublishFirmwareResponse,
142 UpdateFirmware,
143 UpdateFirmwareResponse,
144 InternalError, // not in spec, for internal use
145};
146
150 ChargingProfile profile;
151 int32_t evse_id;
152 ChargingLimitSourceEnum source;
153
154 ReportedChargingProfile(const ChargingProfile& profile, const int32_t evse_id,
155 const ChargingLimitSourceEnum source) :
156 profile(profile), evse_id(evse_id), source(source) {
157 }
158};
159
160namespace conversions {
163std::string messagetype_to_string(MessageType m);
164
167MessageType string_to_messagetype(const std::string& s);
168
169} // namespace conversions
170
173std::ostream& operator<<(std::ostream& os, const MessageType& message_type);
174
175} // namespace v2
176} // namespace ocpp
177
178#endif
Definition: ocpp_types.hpp:755
This enhances the ChargingProfile type by additional paramaters that are required in the ReportChargi...
Definition: types.hpp:149