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

J01- Add evseId=0 meter values #191

Merged
merged 8 commits into from
Oct 17, 2023
Merged

J01- Add evseId=0 meter values #191

merged 8 commits into from
Oct 17, 2023

Conversation

SNSubramanya
Copy link
Contributor

No description provided.

@SNSubramanya SNSubramanya marked this pull request as ready for review September 27, 2023 12:24
@SNSubramanya
Copy link
Contributor Author

#187 must be merged first to rebase this branch

@@ -284,7 +295,18 @@ void ChargePoint::on_session_finished(const int32_t evse_id, const int32_t conne
}

void ChargePoint::on_meter_value(const int32_t evse_id, const MeterValue& meter_value) {
this->evses.at(evse_id)->on_meter_value(meter_value);
std::lock_guard<std::mutex> lk(this->meter_value_mutex);
Copy link
Contributor

Choose a reason for hiding this comment

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

You only need to lock this in case your writing to this->meter_value, not the evse because it has its own lock ;)

EVLOG_debug << "Next meter value will be sent at: " << next_timestamp.value().to_rfc3339();
this->aligned_meter_values_timer.at(
[this]() {
[this, &transaction_active]() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is safe to do because at the time the lambda function will be called the boolean will be out of scope.

Signed-off-by: Soumya Subramanya <[email protected]>
Add a measurerand filter for evseID 0

Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
"attributes": {
"Actual": 42
}
{
Copy link
Contributor

Choose a reason for hiding this comment

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

So it seems like you made some more changes here during the rebase than intended ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah... sorry i think i made a mistake during the rebasing...

lib/ocpp/v201/charge_point.cpp Outdated Show resolved Hide resolved
SNSubramanya and others added 2 commits October 16, 2023 07:34
Co-authored-by: marcemmers <[email protected]>
Signed-off-by: SNSubramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
@SNSubramanya SNSubramanya merged commit 8292d0c into main Oct 17, 2023
3 checks passed
@SNSubramanya SNSubramanya deleted the J01-MeterValues branch October 17, 2023 11:08
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.

2 participants