-
Notifications
You must be signed in to change notification settings - Fork 89
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
Conversation
Signed-off-by: pietfried <[email protected]>
@@ -529,6 +529,10 @@ void OCPP201::ready() { | |||
return; | |||
}; | |||
|
|||
callbacks.time_sync_callback = [this](const ocpp::DateTime& current_time) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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]>
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]>
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]>
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]>
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]>
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]>
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
Describe your changes
Issue ticket number and link
Checklist before requesting a review