Skip to content
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

Fix when characteristic updates value faster than asyncio schedule. #241

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Fix when characteristic updates value faster than asyncio schedule. #241

merged 1 commit into from
Jul 2, 2020

Conversation

superfashi
Copy link
Contributor

This fixes problems running with my code, but there could potentially be other places that is experiencing a similar situation.

@superfashi superfashi changed the title Fix #240 when characteristic updates value faster than asyncio schedule Fix when characteristic updates value faster than asyncio schedule. #240 Jul 2, 2020
@superfashi superfashi changed the title Fix when characteristic updates value faster than asyncio schedule. #240 Fix when characteristic updates value faster than asyncio schedule. Jul 2, 2020
@hbldh hbldh self-assigned this Jul 2, 2020
@hbldh hbldh changed the base branch from master to develop July 2, 2020 06:00
@hbldh hbldh added this to the Version 0.7.1 milestone Jul 2, 2020
@hbldh hbldh added asyncio Problems related to asyncio and multiple clients bug Something isn't working Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend labels Jul 2, 2020
@dlech
Copy link
Collaborator

dlech commented Jul 2, 2020

This looks like a good fix to me. We should probably make the same change for descriptor values.

@@ -318,6 +318,7 @@ def peripheral_didUpdateValueForCharacteristic_error_(
self.did_update_value_for_characteristic,
peripheral,
characteristic,
characteristic.value(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to remember that I had to do something equivalent to copy.copy(characteristic.value()) when I handled a similar situation. Are you sure that this is sufficient?

What I got returned then was a class instance of data class, whereas this is a bytes object. That is a clear difference...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tested this it's a bytes object so this should be sufficient. Do you have any documents on the behavior of this for pyobjc?

@hbldh hbldh merged commit b85ba5a into hbldh:develop Jul 2, 2020
@hbldh hbldh mentioned this pull request Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asyncio Problems related to asyncio and multiple clients Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants