[Bugfix] Peripheral connection event delay/missing disconnect event#1082
Open
[Bugfix] Peripheral connection event delay/missing disconnect event#1082
Conversation
This removes some incorrect upstream changes that would allow a peripheral/server device to recieve events from connected client requests without the application being aware of the connection. The code was changed from the original mynewt event flow in that the connection event is not sent until a response from a request to read the remote version/features where originally the event was sent before these responses were received. This reverts this situaton for the peripheral role because when the connection is made in this case it is fully established and there is no need to wait for the responses to the above requests. In addition the delay caused by these was allowing connected peers to interact without the application knowing of the connection, creating unexpoected issues. One of those issues is the client could disconnect before the peripheral receives a response to the above requests and the changes that were made would prevent the disconnect event from being sent because the connection was not considered established. Finally, the connection reattempt code was checking for a connection establishment failure when the device was acting as a slave, which is incorrect as that condition cannot happen if the spec is followed. The controller should never send this event to a peripheral device waiting for connection, it should just stay advertsing. This patch removes all of the unecessary code that was added and reverts the flow to the original mynewt flow for peripheral devices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This removes some incorrect upstream changes that would allow a peripheral/server device to recieve events from connected client requests without the application being aware of the connection.
The code was changed from the original mynewt event flow in that the connection event is not sent until a response from a request to read the remote version/features where originally the event was sent before these responses were received.
This reverts this situaton for the peripheral role because when the connection is made in this case it is fully established and there is no need to wait for the responses to the above requests. In addition the delay caused by these was allowing connected peers to interact without the application knowing of the connection, creating unexpoected issues.
One of those issues is the client could disconnect before the peripheral receives a response to the above requests and the changes that were made would prevent the disconnect event from being sent because the connection was not considered established.
Finally, the connection reattempt code was checking for a connection establishment failure when the device was acting as a slave, which is incorrect as that condition cannot happen if the spec is followed. The controller should never send this event to a peripheral device waiting for connection, it should just stay advertsing.
This patch removes all of the unecessary code that was added and reverts the flow to the original mynewt flow for peripheral devices.