ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
ocpp_types.hpp
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest
3// This code is generated using the generator in 'src/code_generator/common`, please do not edit manually
4
5#ifndef OCPP_V16_OCPP_TYPES_HPP
6#define OCPP_V16_OCPP_TYPES_HPP
7
8#include <string>
9
10#include <nlohmann/json_fwd.hpp>
11#include <optional>
12
13#include <ocpp/common/types.hpp>
14#include <ocpp/v16/ocpp_enums.hpp>
15#include <ocpp/v16/types.hpp>
16
17namespace ocpp {
18namespace v16 {
19
20struct IdTagInfo {
21 AuthorizationStatus status;
22 std::optional<ocpp::DateTime> expiryDate;
23 std::optional<CiString<20>> parentIdTag;
24};
26void to_json(json& j, const IdTagInfo& k);
27
29void from_json(const json& j, IdTagInfo& k);
30
31// \brief Writes the string representation of the given IdTagInfo \p k to the given output stream \p os
33std::ostream& operator<<(std::ostream& os, const IdTagInfo& k);
34
36 HashAlgorithmEnumType hashAlgorithm;
37 CiString<128> issuerNameHash;
38 CiString<128> issuerKeyHash;
39 CiString<40> serialNumber;
40};
42void to_json(json& j, const CertificateHashDataType& k);
43
45void from_json(const json& j, CertificateHashDataType& k);
46
47// \brief Writes the string representation of the given CertificateHashDataType \p k to the given output stream \p os
49std::ostream& operator<<(std::ostream& os, const CertificateHashDataType& k);
50
52 int32_t startPeriod;
53 float limit;
54 std::optional<int32_t> numberPhases;
55};
57void to_json(json& j, const ChargingSchedulePeriod& k);
58
60void from_json(const json& j, ChargingSchedulePeriod& k);
61
62// \brief Writes the string representation of the given ChargingSchedulePeriod \p k to the given output stream \p os
64std::ostream& operator<<(std::ostream& os, const ChargingSchedulePeriod& k);
65
67 ChargingRateUnit chargingRateUnit;
68 std::vector<ChargingSchedulePeriod> chargingSchedulePeriod;
69 std::optional<int32_t> duration;
70 std::optional<ocpp::DateTime> startSchedule;
71 std::optional<float> minChargingRate;
72};
74void to_json(json& j, const ChargingSchedule& k);
75
77void from_json(const json& j, ChargingSchedule& k);
78
79// \brief Writes the string representation of the given ChargingSchedule \p k to the given output stream \p os
81std::ostream& operator<<(std::ostream& os, const ChargingSchedule& k);
82
83struct KeyValue {
84 CiString<50> key;
85 bool readonly;
86 std::optional<CiString<500>> value;
87};
89void to_json(json& j, const KeyValue& k);
90
92void from_json(const json& j, KeyValue& k);
93
94// \brief Writes the string representation of the given KeyValue \p k to the given output stream \p os
96std::ostream& operator<<(std::ostream& os, const KeyValue& k);
97
99 CiString<512> remoteLocation;
100 std::optional<ocpp::DateTime> oldestTimestamp;
101 std::optional<ocpp::DateTime> latestTimestamp;
102};
104void to_json(json& j, const LogParametersType& k);
105
107void from_json(const json& j, LogParametersType& k);
108
109// \brief Writes the string representation of the given LogParametersType \p k to the given output stream \p os
111std::ostream& operator<<(std::ostream& os, const LogParametersType& k);
112
114 std::string value;
115 std::optional<ReadingContext> context;
116 std::optional<ValueFormat> format;
117 std::optional<Measurand> measurand;
118 std::optional<Phase> phase;
119 std::optional<Location> location;
120 std::optional<UnitOfMeasure> unit;
121};
123void to_json(json& j, const SampledValue& k);
124
126void from_json(const json& j, SampledValue& k);
127
128// \brief Writes the string representation of the given SampledValue \p k to the given output stream \p os
130std::ostream& operator<<(std::ostream& os, const SampledValue& k);
131
133 ocpp::DateTime timestamp;
134 std::vector<SampledValue> sampledValue;
135};
137void to_json(json& j, const MeterValue& k);
138
140void from_json(const json& j, MeterValue& k);
141
142// \brief Writes the string representation of the given MeterValue \p k to the given output stream \p os
144std::ostream& operator<<(std::ostream& os, const MeterValue& k);
145
147 int32_t chargingProfileId;
148 int32_t stackLevel;
149 ChargingProfilePurposeType chargingProfilePurpose;
150 ChargingProfileKindType chargingProfileKind;
151 ChargingSchedule chargingSchedule;
152 std::optional<int32_t> transactionId;
153 std::optional<RecurrencyKindType> recurrencyKind;
154 std::optional<ocpp::DateTime> validFrom;
155 std::optional<ocpp::DateTime> validTo;
156};
158void to_json(json& j, const ChargingProfile& k);
159
161void from_json(const json& j, ChargingProfile& k);
162
163// \brief Writes the string representation of the given ChargingProfile \p k to the given output stream \p os
165std::ostream& operator<<(std::ostream& os, const ChargingProfile& k);
166
168 CiString<20> idTag;
169 std::optional<IdTagInfo> idTagInfo;
170};
172void to_json(json& j, const LocalAuthorizationList& k);
173
175void from_json(const json& j, LocalAuthorizationList& k);
176
177// \brief Writes the string representation of the given LocalAuthorizationList \p k to the given output stream \p os
179std::ostream& operator<<(std::ostream& os, const LocalAuthorizationList& k);
180
182 CiString<512> location;
183 ocpp::DateTime retrieveDateTime;
184 CiString<5500> signingCertificate;
185 CiString<800> signature;
186 std::optional<ocpp::DateTime> installDateTime;
187};
189void to_json(json& j, const FirmwareType& k);
190
192void from_json(const json& j, FirmwareType& k);
193
194// \brief Writes the string representation of the given FirmwareType \p k to the given output stream \p os
196std::ostream& operator<<(std::ostream& os, const FirmwareType& k);
197
199 ocpp::DateTime timestamp;
200 std::vector<SampledValue> sampledValue;
201};
203void to_json(json& j, const TransactionData& k);
204
206void from_json(const json& j, TransactionData& k);
207
208// \brief Writes the string representation of the given TransactionData \p k to the given output stream \p os
210std::ostream& operator<<(std::ostream& os, const TransactionData& k);
211
212} // namespace v16
213} // namespace ocpp
214
215#endif // OCPP_V16_OCPP_TYPES_HPP
Contains a DateTime implementation that can parse and create RFC 3339 compatible strings.
Definition: types.hpp:109
Definition: ocpp_types.hpp:35
Definition: ocpp_types.hpp:146
Definition: ocpp_types.hpp:51
Definition: ocpp_types.hpp:66
Definition: ocpp_types.hpp:181
Definition: ocpp_types.hpp:20
Definition: ocpp_types.hpp:83
Definition: ocpp_types.hpp:167
Definition: ocpp_types.hpp:98
Definition: ocpp_types.hpp:132
Definition: ocpp_types.hpp:113
Definition: ocpp_types.hpp:198