Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <ocpp/v16/charge_point_configuration_interface.hpp>
#include <ocpp/v16/types.hpp>

#include <map>
#include <set>
#include <vector>

Expand Down Expand Up @@ -94,6 +93,9 @@ class ChargePointConfigurationDeviceModel : private ChargePointConfigurationBase
SetResult setInternalTimeOffsetNextTransition(const std::string& value);
SetResult setInternalWaitForSetUserPriceTimeout(const std::string& value);

std::optional<std::string> calculateEvseIds();
std::string calculateSupportedMeasurands();

public:
explicit ChargePointConfigurationDeviceModel(const std::string_view& ocpp_main_path,
std::unique_ptr<v2::DeviceModelInterface> device_model_interface);
Expand Down
465 changes: 339 additions & 126 deletions lib/everest/ocpp/include/ocpp/v16/known_keys.hpp

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/everest/ocpp/include/ocpp/v16/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <iostream>
#include <sstream>
#include <string_view>

Check warning on line 8 in lib/everest/ocpp/include/ocpp/v16/types.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/everest/ocpp/include/ocpp/v16/types.hpp#L8

Include file: <string_view> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <nlohmann/json_fwd.hpp>

Expand Down Expand Up @@ -137,7 +138,7 @@

/// \brief Converts the given std::string \p s to SupportedFeatureProfiles
/// \returns a SupportedFeatureProfiles from a string representation
SupportedFeatureProfiles string_to_supported_feature_profiles(const std::string& s);
SupportedFeatureProfiles string_to_supported_feature_profiles(const std::string_view& s);
} // namespace conversions

/// \brief Writes the string representation of the given \p supported_feature_profiles to the given output stream \p os
Expand Down
45 changes: 45 additions & 0 deletions lib/everest/ocpp/include/ocpp/v16/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <ocpp/v16/ocpp_types.hpp>
#include <ocpp/v16/types.hpp>

#include <cstddef>

Check warning on line 11 in lib/everest/ocpp/include/ocpp/v16/utils.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/everest/ocpp/include/ocpp/v16/utils.hpp#L11

Include file: <cstddef> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <map>

Check warning on line 12 in lib/everest/ocpp/include/ocpp/v16/utils.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/everest/ocpp/include/ocpp/v16/utils.hpp#L12

Include file: <map> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <string>
#include <vector>

Expand All @@ -32,6 +34,49 @@
/// \note will not contain empty strings when a comma is repeated
std::vector<std::string> from_csl(const std::string& csl);

/// \brief List that maintains insertion order and prevents duplicates
class OrderedUniqueStringList {
private:
using Store = std::map<std::string, std::size_t>;
std::size_t count{0};
Store list{};

void do_insert(std::string&& s);

public:
/// \brief Add to list assuming not a duplicate
/// \param s - the string to add
void insert(const std::string& s) {
do_insert(std::string{s});
}
/// \brief Add to list assuming not a duplicate
/// \param s - the string to add
void insert(std::string&& s) {
do_insert(std::move(s));
}

/// \brief Clear the list
void clear() {
count = 0;
list.clear();
}

/// \brief obtain an ordered vector of the unique strings
std::vector<std::string> get() const;

/// \brief is the list empty
/// \returns true when empty
bool empty() const {
return list.empty();
}

/// \brief how many strings are in the list
/// \returns the size of the list
auto size() const {
return list.size();
}
};

} // namespace ocpp::v16::utils

#endif
36 changes: 36 additions & 0 deletions lib/everest/ocpp/include/ocpp/v2/ctrlr_component_variables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ extern const Component SecurityCtrlr;
extern const Component SmartChargingCtrlr;
extern const Component TariffCostCtrlr;
extern const Component TxCtrlr;
// following controllers contains OCPP1.6 configuration keys without a clear mapping to OCPP2.x.
extern const Component OCPP16LegacyCtrlr;
extern const Component CustomLegacyController;
} // namespace ControllerComponents

namespace StandardizedVariables {
Expand Down Expand Up @@ -310,6 +313,39 @@ extern const ComponentVariable TxBeforeAcceptedEnabled;
extern const RequiredComponentVariable TxStartPoint;
extern const RequiredComponentVariable TxStopPoint;
extern const ComponentVariable ISO15118CtrlrAvailable;

// OCPP1.6 mavericks: The following ComponentVariable definitions are required because some CPP1.6 configuration keys
// do not map to any existing component variable combination in OCPP2.x. The following definitions only control the
// OCPP1.6 implementation
extern const ComponentVariable BlinkRepeat;
extern const ComponentVariable ConnectorPhaseRotation;
extern const ComponentVariable ConnectorPhaseRotationMaxLength;
extern const RequiredComponentVariable GetConfigurationMaxKeys;
extern const ComponentVariable LightIntensity;
extern const ComponentVariable MinimumStatusDuration;
extern const ComponentVariable StopTransactionOnEVSideDisconnect;
extern const RequiredComponentVariable SupportedFeatureProfiles;
extern const ComponentVariable SupportedFeatureProfilesMaxLength;
extern const RequiredComponentVariable UnlockConnectorOnEVSideDisconnect;
extern const ComponentVariable ReserveConnectorZeroSupported;
extern const ComponentVariable HostName;
extern const ComponentVariable AllowChargingProfileWithoutStartSchedule;
extern const ComponentVariable WaitForStopTransactionsOnResetTimeout;
extern const ComponentVariable StopTransactionIfUnlockNotSupported;
extern const ComponentVariable MeterPublicKeys;
extern const ComponentVariable DisableSecurityEventNotifications;
extern const ComponentVariable ISO15118CertificateManagementEnabled;
extern const ComponentVariable CustomDisplayCostAndPrice; // Required only if CaliforniaPricing enabled
extern const ComponentVariable DefaultPrice;
extern const ComponentVariable DefaultPriceText;
extern const ComponentVariable CustomIdleFeeAfterStop;
extern const ComponentVariable SupportedLanguages;
extern const ComponentVariable CustomMultiLanguageMessages;
extern const ComponentVariable Language;
extern const ComponentVariable WaitForSetUserPriceTimeout;
extern const ComponentVariable AuthorizationKey16;
extern const RequiredComponentVariable CentralSystemURI16;
extern const RequiredComponentVariable SecurityProfile16;
} // namespace ControllerComponentVariables

namespace EvseComponentVariables {
Expand Down
Loading
Loading