-
Notifications
You must be signed in to change notification settings - Fork 8
INGK-1202 recover from disconnection public method #669
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
INGK-1202 recover from disconnection public method #669
Conversation
…ate-recover-from-disconnection-function-for-all-networks
…on-function-for-all-networks
…on-function-for-all-networks
| self.__network._set_servo_state(node_id, NetState.CONNECTED) | ||
| timestamps[node_id] = node.nmt.timestamp | ||
| elif servo_state == NetState.DISCONNECTED: | ||
| self.__network.recover_from_disconnection() |
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.
something I wonder....
If you manually call recover_from_disconnection, why shouldn't the _notify_status be called?
Maybe it does not belong to this issue, but it makes no sense to me.
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.
The point of the issue was to be able to do this stuff without the status listener.
So, if we want to notify the status when we use this method, that implies that there is some net observer.
The only reliable way of having a "observation of the net" is through the status listener.
With the new method you will be able to know when you're connected back again, but not when you're disconnected, that is only possible with the net status listener.
So I do not really see the point of having to notify the status here. That is done by the net status listener already.
ingenialink/ethernet/network.py
Outdated
| callback(status) | ||
|
|
||
| @staticmethod | ||
| def _ping_servo(servo: EthernetServo) -> bool: |
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.
avoid calling this a ping. It used to be an actual ping, but now is just reading a reg:
ingenialink-python/ingenialink/servo.py
Line 1107 in 21f1433
| def is_alive(self) -> bool: |
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.
@polfeliu I modified is_alive method to accept a number of attempts and completely removed the ping method
Description
Create
recover_from_disconnectionmethod for all networks.Type of change
Please add a description and delete options that are not relevant.
recover_from_disconnectionmethod for all networksprocessmethod in all of themTests
Please describe the manual tests that you ran to verify your changes if it applies.
Documentation
Please update the documentation.
[Unreleased]section of the CHANGELOG.