-
Notifications
You must be signed in to change notification settings - Fork 58
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
network connection profiles #410
Conversation
95a6a1a
to
a5d1c79
Compare
1f7d92e
to
944e2aa
Compare
@@ -47,7 +48,7 @@ class WebsocketBase { | |||
WebsocketConnectionOptions connection_options; | |||
std::function<void(const int security_profile)> connected_callback; | |||
std::function<void()> disconnected_callback; | |||
std::function<void(const websocketpp::close::status::value reason)> closed_callback; | |||
std::function<void(const WebsocketCloseReason reason)> closed_callback; | |||
std::function<void(const std::string& message)> message_callback; | |||
websocketpp::lib::shared_ptr<boost::asio::steady_timer> reconnect_timer; |
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.
@hikinggrass maybe we should also abstract usage to the timer and use the evse timer instead?
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.
Yes and there is more to be abstracted I think. I did not go through all the websocketpp things there, only the things I needed to be changed. I did not look into detail how websocketpp and the websocket in general works.
@@ -50,7 +54,7 @@ class Websocket { | |||
|
|||
/// \brief register a \p callback that is called when the websocket connection has been closed and will not attempt | |||
/// to reconnect | |||
void register_closed_callback(const std::function<void(const websocketpp::close::status::value reason)>& callback); | |||
void register_closed_callback(const std::function<void(const WebsocketCloseReason reason)>& callback); |
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.
We can keep the closed_callback
and disconnected_callback
for now because they are implicitly used to manage the reconnect behavior, but to reduce complexity of the interface I would prefer to not have the seperated after this refactor is done
48f7846
to
86b7632
Compare
3eb08ca
to
63ead24
Compare
There are a lot of changes now. Tested this with websocket plain (not tls) and only ocpp 2.0.1. Is it possible to take a look again if this is the direction we want to go? Maybe we want to move 'ping' to the connectivity manager as well. |
84d3a3b
to
2657cad
Compare
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> [wip] fixed bug in print statement Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
… connection profile Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com> Signed-off-by: Maaike <maaike@iolar.nl>
…ionProfile should not be an optional. Add configuration slot as parameter. Disconnected callback: also add configuration slot and NetworkConnectionProfile. Signed-off-by: Maaike Zijderveld <m.zijderveld@alfen.nl> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: AssemblyJohn <ioan.bogdann@gmail.com> Signed-off-by: Maaike <maaike@iolar.nl>
…umentation for network connectivity. Signed-off-by: Maaike Zijderveld <m.zijderveld@alfen.nl> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike Zijderveld <m.zijderveld@alfen.nl> Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
…ger. Signed-off-by: Maaike <maaike@iolar.nl>
…r we will remove it completely. Signed-off-by: Maaike <maaike@iolar.nl>
…disconnected is indeed connected. Init function: try next configuration priority if the current is not found. Remove some TODO's that are already implemented. Signed-off-by: Maaike <maaike@iolar.nl>
…websocket. Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
…ger to reconnect with backoff wait time. Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
… network slots in connectivity manager. Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
…cket.hpp. Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
Signed-off-by: Maaike <maaike@iolar.nl>
…to connectivity manager. Signed-off-by: Maaike <maaike@iolar.nl>
… is not set to wss). Extra check if websocket is already stopped. Extra check if a reconnection is already taking place (in connectivity manager). Signed-off-by: Maaike <maaike@iolar.nl>
b3a2043
to
9d2e723
Compare
Signed-off-by: Maaike <maaike@iolar.nl>
|
||
/// \brief Default timeout for the return value (future) of the `configure_network_connection_profile_callback` | ||
/// function. | ||
constexpr int32_t default_network_config_timeout_seconds = 60; |
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.
These can (should) be chrono types
EVLOG_debug << "Init websocket without config slot, use first available: " << config_slot_int; | ||
} else { | ||
// No network connection profile. Retry connecting after some time, maybe it is set manually. | ||
EVLOG_info << "No network connection profile set. Try again later."; |
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.
Maybe we can try this more often then every 300 seconds but not print this message every time?
No description provided.