Skip to content

Conversation

@Pietfried
Copy link
Contributor

Describe your changes

  • Add support for the MeterPublicKey configuration key
  • Added public function to set the public key of the powermeter per connector

The implementation for this configuration key follows the requirements of the OCA Eichrecht Whitepaper

The format the new configuration keys are reported is:
MeterPublicKey[n] where n is the id of the respective connector

Issue ticket number and link

Companion PR: EVerest/everest-core#1599

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • If OCPP 2.0.1 or OCPP2.1: I have updated the OCPP 2.x status document
  • I read the contribution documentation and made sure that my changes meet its requirements

…dded public function to set the public key of the powermeter per connector

Signed-off-by: Piet Gömpel <pietgoempel@gmail.com>
@Pietfried Pietfried force-pushed the feature/meter-public-key-support branch from 848068b to 9b3d70d Compare December 2, 2025 08:46
Copy link
Member

@james-ctc james-ctc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General

especially for header files basic types as function arguments shouldn't be const.
e.g. std::uint32_t connector_id rather than const std::uint32_t connector_id

(it does have a meaning for the function implementation)

}

namespace {
template <typename T> std::optional<T> parse_meter_public_key_index(const std::string& input) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any situation where parse_meter_public_key_index will be called where T != uint32?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the template

const std::string& s = key.get();
const auto connector_id_opt = parse_meter_public_key_index<uint32_t>(s);

if (connector_id_opt.has_value() == false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other places if (!…) is used, which is preferable, rather than if (… == false)

return std::nullopt;
}

const uint32_t connector_id = connector_id_opt.value();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safer to be const auto especially since connector_id_opt is auto.

Signed-off-by: Piet Gömpel <pietgoempel@gmail.com>
@Pietfried Pietfried requested a review from james-ctc December 2, 2025 12:46
@Pietfried Pietfried merged commit 52a347e into main Dec 10, 2025
10 checks passed
@Pietfried Pietfried deleted the feature/meter-public-key-support branch December 10, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants