|
4 | 4 | #ifndef OCPP_V2_CTRLR_COMPONENT_VARIABLES
|
5 | 5 | #define OCPP_V2_CTRLR_COMPONENT_VARIABLES
|
6 | 6 |
|
| 7 | +#include <set> |
| 8 | + |
7 | 9 | #include <ocpp/v2/ocpp_types.hpp>
|
8 | 10 |
|
9 | 11 | namespace ocpp {
|
10 | 12 | namespace v2 {
|
| 13 | +/// |
| 14 | +/// \brief Required ComponentVariable. |
| 15 | +/// |
| 16 | +struct RequiredComponentVariable : ComponentVariable { |
| 17 | + /// \brief Constructor |
| 18 | + RequiredComponentVariable() : required_for({OcppProtocolVersion::v201, OcppProtocolVersion::v21}){}; |
| 19 | + |
| 20 | + /// |
| 21 | + /// \brief RequiredComponentVariable |
| 22 | + /// \param component Component |
| 23 | + /// \param variable Variable |
| 24 | + /// \param custom_data Custom data (default nullopt) |
| 25 | + /// \param required_for Required for which version. Multiple versions can be given. |
| 26 | + /// |
| 27 | + RequiredComponentVariable(const Component component, const std::optional<Variable> variable, |
| 28 | + const std::optional<CustomData> custom_data = std::nullopt, |
| 29 | + const std::set<OcppProtocolVersion>& required_for = {OcppProtocolVersion::v201, |
| 30 | + OcppProtocolVersion::v21}) : |
| 31 | + ComponentVariable(), required_for(required_for) { |
| 32 | + this->component = component; |
| 33 | + this->variable = variable; |
| 34 | + this->customData = custom_data; |
| 35 | + }; |
| 36 | + |
| 37 | + /// \brief For which ocpp protocol version(s) this component variable is required. |
| 38 | + std::set<OcppProtocolVersion> required_for; |
| 39 | +}; |
| 40 | + |
| 41 | +/// |
| 42 | +/// \brief Required variables per component. |
| 43 | +/// |
| 44 | +/// First value is the 'available' variable from the specific component. Second value is a set of required variables. |
| 45 | +/// This makes it possible to check only for the required variables if a component is available. |
| 46 | +/// |
| 47 | +extern const std::vector<std::pair<ComponentVariable, std::vector<RequiredComponentVariable>>> |
| 48 | + required_component_available_variables; |
| 49 | + |
| 50 | +/// |
| 51 | +/// \brief Required variables that should always exist, regardless of any available or not available controller. |
| 52 | +/// |
| 53 | +extern const std::vector<RequiredComponentVariable> required_variables; |
| 54 | + |
| 55 | +/// |
| 56 | +/// \brief Required variables of an EVSE. |
| 57 | +/// |
| 58 | +extern const std::vector<Variable> required_evse_variables; |
| 59 | + |
| 60 | +/// |
| 61 | +/// \brief Required variables of a connector. |
| 62 | +/// |
| 63 | +extern const std::vector<Variable> required_connector_variables; |
11 | 64 |
|
12 | 65 | namespace ControllerComponents {
|
13 | 66 | extern const Component InternalCtrlr;
|
@@ -88,6 +141,7 @@ extern const ComponentVariable MessageQueueSizeThreshold;
|
88 | 141 | extern const ComponentVariable MaxMessageSize;
|
89 | 142 | extern const ComponentVariable ResumeTransactionsOnBoot;
|
90 | 143 | extern const ComponentVariable AllowSecurityLevelZeroConnections;
|
| 144 | +extern const RequiredComponentVariable SupportedOcppVersions; |
91 | 145 | extern const ComponentVariable AlignedDataCtrlrEnabled;
|
92 | 146 | extern const ComponentVariable AlignedDataCtrlrAvailable;
|
93 | 147 | extern const RequiredComponentVariable AlignedDataInterval;
|
|
0 commit comments