-
Notifications
You must be signed in to change notification settings - Fork 50
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
Connectivity manager refactoring #874
Conversation
d40d83a
to
14036b3
Compare
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
…nnect Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
14036b3
to
94123cd
Compare
Signed-off-by: Marc Emmers <[email protected]>
Signed-off-by: Marc Emmers <[email protected]>
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.
Looks good and more clean 👍
Just a couple of remarks where id like to see some changes.
/// \param configuration_slot Slot in which the configuration is stored | ||
/// \return true if the switch is possible. | ||
bool on_try_switch_network_connection_profile(const int32_t configuration_slot); | ||
void on_reconfiguration_of_security_parameters(); |
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.
According to the documentation a better name could be on_charging_station_certificate_changed
if (std::optional<std::string> interface_address = | ||
get_network_configuration_interface(configuration_slot_to_set, network_connection_profile.value()); |
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.
This confused me a little bit.
get_network_configuration_interface
makes use of the configure_network_connection_profile_callback
but get_network_configuration_interface
does not return the response of configure_network_connection_profile_callback
though, it just returns an interface_address
. So if configure_network_connection_profile_callback
returns {"sucess": true, interface_string: "std::nullopt"}
no connection attempt will be made although that should probably happen, just without specifying the iface.
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.
That is a fair point. Renamed the function a little bit and allowed it to be used with nullopt as interface.
get_network_configuration_interface(configuration_slot_to_set, network_connection_profile.value()); | ||
interface_address.has_value()) { | ||
connection_options->iface = interface_address; | ||
} else { | ||
can_use_connection_profile = false; |
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.
Id prefer to add a log that mentions that the profile for this slot can not be used.
Signed-off-by: Marc Emmers <[email protected]>
Describe your changes
We refactored the connectivity manager a bit. We tried to make the interface simpler by just having
connect()
anddisconnect()
calls to control the manager instead of having 4.This way we also are able to have slightly more control over how libocpp starts (with
start_connecting
) and be able to trigger a connection using a specific network profile.Issue ticket number and link
Checklist before requesting a review