Skip to content

Commit

Permalink
FIXES
Browse files Browse the repository at this point in the history
  • Loading branch information
golovasteek committed Mar 18, 2024
1 parent 83af563 commit 873caac
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 38 deletions.
4 changes: 0 additions & 4 deletions interfaces/evse_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ vars:
description: Measured dataset
type: object
$ref: /powermeter#/Powermeter
transaction_meter_value:
description: Signed meter value attached to transaction context
type: object
$ref: /units_signed#/TransactionMeterValue
evse_id:
description: EVSE ID including the connector number, e.g. DE*PNX*E123456*1
type: string
Expand Down
3 changes: 1 addition & 2 deletions modules/EvseManager/Charger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,8 +1056,6 @@ bool Charger::start_transaction() {
shared_context.stop_transaction_id_token.reset();
shared_context.transaction_active = true;

// The `TransactionStarted` is a time critical event. We send it before
// trying to sign the meter values, which takes time to complete.
const types::powermeter::TransactionReq req{evse_id, "", "", 0, 0, ""};
for (const auto& meter : r_powermeter_billing) {
const auto response = meter->call_start_transaction(req);
Expand Down Expand Up @@ -1088,6 +1086,7 @@ void Charger::stop_transaction() {
EVLOG_error << "Failed to stop a transaction on the power meter " << response.error.value_or("");
break;
} else if (response.status == types::powermeter::TransactionRequestStatus::OK) {
shared_context.start_signed_meter_value = response.start_signed_meter_value;
shared_context.stop_signed_meter_value = response.signed_meter_value;
break;
}
Expand Down
1 change: 1 addition & 0 deletions modules/EvseManager/evse/evse_managerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void evse_managerImpl::ready() {
transaction_finished.meter_value.energy_Wh_export.value().total;
}

transaction_finished.start_signed_meter_value = mod->charger->get_start_signed_meter_value();
transaction_finished.signed_meter_value = mod->charger->get_stop_signed_meter_value();
mod->telemetry.publish("session", "events", telemetry_data);

Expand Down
4 changes: 4 additions & 0 deletions types/evse_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ types:
description: Transaction finished meter value
type: object
$ref: /powermeter#/Powermeter
start_signed_meter_value:
description: The starting signed meter value report of the stopped transaction. If not included in the `signed_meter_value` object, it must be included here.
type: object
$ref: /units_signed#/SignedMeterValue
signed_meter_value:
description: The signed meter value report of the stopped transaction
type: object
Expand Down
2 changes: 1 addition & 1 deletion types/powermeter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ types:
description: If status is not OK, a verbose error message.
type: string
Powermeter:
description: Measured dataset (AC or DC). Represents live measure snapshot.
description: Measured dataset (AC or DC.
type: object
additionalProperties: false
required:
Expand Down
32 changes: 1 addition & 31 deletions types/units_signed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,34 +153,4 @@ types:
description: VAR phase C
type: object
$ref: /units_signed#/SignedMeterValue
SignedMeterValueContext:
description: Context of the signed value within the transaction.
type: string
enum:
# Signed value belongs to transaction start
- TRANSACTION_START
# Signed value belongs to transaction stop
- TRANSACTION_STOP
# Signed value taken in the middle of transaction
- CURRENT
# Signed value includes whole set of measuremtes for transaction
- TRANSACTION
TransactionMeterValue:
description: Signed meter value attached to transaction context
type: object
required:
- transaction_id
- signed_meter_value
- signature_context
properties:
transaction_id:
description: OCPP transaction UUID
type: string
signed_meter_value:
description: The signed meter data.
type: object
$ref: /units_signed#/SignedMeterValue
signature_context:
description: Context of the signed value.
type: string
$ref: /units_signed#/SignedMeterValueContext

0 comments on commit 873caac

Please sign in to comment.