-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve NetworkChannel Interface #116
Conversation
…tion to the NetworkChannel interface and improve documentation
Memory usage after merging this PR will be: Memory Reportaction_microstep_test_c
action_overwrite_test_c
action_test_c
delayed_conn_test_c
event_payload_pool_test_c
event_queue_test_c
multiple_startup_shutdown_test_c
nanopb_test_c
physical_action_test_c
port_test_c
reaction_queue_test_c
request_shutdown_test_c
shutdown_test_c
startup_test_c
tcp_channel_test_c
timer_test_c
|
NETWORK_CHANNEL_STATE_CONNECTED, | ||
NETWORK_CHANNEL_STATE_DISCONNECTED, | ||
NETWORK_CHANNEL_STATE_LOST_CONNECTION, | ||
} NetworkChannelState; |
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.
I am open to reduce the amount of state options if reasonable.
This is mostly meant as a first idea on what possible scenarios could exist.
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.
I think thats the correct amount of detail to describe the state.
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 to me also
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.
NETWORK_CHANNEL_STATE_CONNECTED, | ||
NETWORK_CHANNEL_STATE_DISCONNECTED, | ||
NETWORK_CHANNEL_STATE_LOST_CONNECTION, | ||
} NetworkChannelState; |
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 to me also
This PR adds the following new functions:
get_connection_state
to check in what state the network channel is currently in.try_reconnect
to reestablish a connection after failure.And the following new field:
expected_try_connect_duration
to tellenvironment.c
for how long to sleep if a connection is not yet established.Furthermore I improved the documentation of the network_channel.h file.