Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for providing powermeter public key #924

Merged
merged 3 commits into from
Oct 22, 2024
Merged
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
7 changes: 5 additions & 2 deletions interfaces/evse_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cmds:
type: boolean
authorize_response:
description: >-
Reports the result of an authorization request to the EvseManager.
Reports the result of an authorization request to the EvseManager.
Contains the provided_token for which authorization was requested and
the validation_result
arguments:
Expand Down Expand Up @@ -150,6 +150,9 @@ vars:
description: Measured dataset
type: object
$ref: /powermeter#/Powermeter
powermeter_public_key_ocmf:
description: Powermeter public key
type: string
evse_id:
description: EVSE ID including the connector number, e.g. DE*PNX*E123456*1
type: string
Expand All @@ -159,7 +162,7 @@ vars:
$ref: /evse_board_support#/HardwareCapabilities
iso15118_certificate_request:
description: >-
The vehicle requests the SECC to deliver the certificate that belong
The vehicle requests the SECC to deliver the certificate that belong
to the currently valid contract of the vehicle.
Response will be reported async via set_get_certificate_response
type: object
Expand Down
6 changes: 5 additions & 1 deletion modules/EvseManager/evse/evse_managerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,14 @@ void evse_managerImpl::init() {
// /Interface to Node-RED debug UI

if (mod->r_powermeter_billing().size() > 0) {
mod->r_powermeter_billing()[0]->subscribe_powermeter([this](const types::powermeter::Powermeter p) {
mod->r_powermeter_billing()[0]->subscribe_powermeter([this](const types::powermeter::Powermeter& p) {
// Republish data on proxy powermeter struct
publish_powermeter(p);
});
mod->r_powermeter_billing()[0]->subscribe_public_key_ocmf([this](const std::string& public_key_ocmf) {
// Republish data on proxy powermeter public_key_ocmf
publish_powermeter_public_key_ocmf(public_key_ocmf);
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ LemDCBM400600Controller::stop_transaction(const std::string& transaction_id) {
this->request_device_to_stop_transaction(tid);
}
auto signed_meter_value = types::units_signed::SignedMeterValue{fetch_ocmf_result(tid), "", "OCMF"};
signed_meter_value.public_key.emplace(public_key_ocmf);
return types::powermeter::TransactionStopResponse{types::powermeter::TransactionRequestStatus::OK,
{}, // Empty start_signed_meter_value
signed_meter_value};
Expand Down
2 changes: 1 addition & 1 deletion modules/LemDCBM400600/main/powermeterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ void powermeterImpl::init() {
void powermeterImpl::ready() {
// Start the live_measure_publisher thread, which periodically publishes the live measurements of the device
this->live_measure_publisher_thread = std::thread([this] {
this->publish_public_key_ocmf(this->controller->get_public_key_ocmf());
while (true) {
try {
if (!this->controller->is_initialized()) {
this->controller->init();
this->publish_public_key_ocmf(this->controller->get_public_key_ocmf());
std::this_thread::sleep_for(
std::chrono::milliseconds(mod->config.resilience_initial_connection_retry_delay));
} else {
Expand Down
Loading