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

Registered time_sync_callback in OCPP201 module #814

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

Pietfried
Copy link
Contributor

@Pietfried Pietfried commented Aug 5, 2024

Describe your changes

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@@ -529,6 +529,10 @@ void OCPP201::ready() {
return;
};

callbacks.time_sync_callback = [this](const ocpp::DateTime& current_time) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of capturing everything (i.e. this), it is advised to capture only the things that are needed. So you could probably also write:

callbacks.time_sync_callback = [&system = this->r_system](const auto& current_time) {
  system->call_set_system_time(current_time.to_rfc3339());
}

But note, that this would not be the same in case this->r_system changes during the lifetime of the assigned function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, since this covers almost every other callback definition, I have raised an issue for that: #828 . It therefore won't be covered as part of this PR.

barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Aug 15, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.7.1):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Sep 10, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.7.1):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Sep 12, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.8.0):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Sep 12, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.8.0):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Sep 12, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.8.0):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Sep 17, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.8.0):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
barsnick added a commit to chargebyte/meta-chargebyte-everest that referenced this pull request Sep 18, 2024
This adds a patch from a PR which is not yet part of a release (currently
referencing 2024.8.0):

- PR EVerest/everest-core#814
  "Registered time_sync_callback in OCPP201 module"

Signed-off-by: Moritz Barsnick <[email protected]>
…allback-v201

# Conflicts:
#	modules/OCPP201/OCPP201.cpp
@hikinggrass hikinggrass merged commit 85ae942 into main Sep 23, 2024
10 checks passed
@hikinggrass hikinggrass deleted the feature/system-time-callback-v201 branch September 23, 2024 14:59
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.

3 participants