Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As reported in #647 it isn't safe to delay the emission of the
connection
even until we have asynchronously read the connection PHY from the controller. Unfortunately, the controller doesn't provide the PHY information when a connection is made, it has to be requested with a command, which is an asynchronous sequence, and thus some data could be received between the time the PHY request is made and the response is received, in which case that data will arrive before the connection event is emitted.The only clean solution here is that the
Connection
object can't have a synchronousphy
property. It must be an async "property" (not really a property, because real properties can't be async, but anasync def get_phy()
method).Also, as a consequence of this change, the
connection_phy_update
event must pass the PHY value as a parameter, so as not to required an un-necessaryget_phy
request from the listener to obtain the information.This does change the API slightly, but it probably won't break too many users.