Skip to content

Commit

Permalink
Fix for providing powermeter public key (#924)
Browse files Browse the repository at this point in the history
* Fix for providing powermeter public key - the key was missing in the transaction data and from the interface. EVSE Manager has to republish the key which is needed by other modules.
---------
Signed-off-by: florinmihut <[email protected]>
  • Loading branch information
florinmihut authored and hikinggrass committed Oct 25, 2024
1 parent 0853a74 commit bb0c434
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
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
1 change: 1 addition & 0 deletions modules/LemDCBM400600/main/lem_dcbm_400600_controller.cpp
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

0 comments on commit bb0c434

Please sign in to comment.