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

Windows Write Event Fix #274

Merged
merged 1 commit into from
May 29, 2024

Conversation

Cartermel
Copy link
Contributor

@Cartermel Cartermel commented May 23, 2024

  • fixed issue where the WriteEvent from CharacteristicConfig was not being set to the internal winrt characteristic
  • removed write event being called from the internal Characteristic.Write(), which was leading to an infinite loop when attempting to write to the characteristic in it's own write event

Not sure if the second point is intended behavour? In gatts_linux.go it calls a characterisit writeEvent, but I'm assuming bluez is writing to the characterisitic for you, whereas in winrt we have to write to it manually... One of these is probably not intended..!

@deadprogram deadprogram requested a review from jagobagascon May 25, 2024 07:47
@jagobagascon
Copy link
Member

Note: I tried to test this but it seems that my bluetooth dongle does not support working as a peripheral.

The first point LGTM.

But I have some concerns about removing the write event call from Characteristic.Write().

I could not test this but checking the code I imagine the infinite loop also happens on linux. And if that's the case I would try to keep the behaviour consistent among the different platforms. Maybe @aykevl can confirm this? Is this intended behaviour?

@Cartermel maybe we could split this PR in two and merge the first part while we clarify if the infinite loop is intended behaviour or not? I think it's something we can live with (it can probably be avoided by setting some flag to ignore your own callbacks).

@Cartermel Cartermel force-pushed the windows-write-event-fix branch from 98ee2ad to f1c1536 Compare May 27, 2024 16:07
@Cartermel
Copy link
Contributor Author

sounds good, created a new PR here with the windows changes for now: #277

Copy link
Member

@jagobagascon jagobagascon left a comment

Choose a reason for hiding this comment

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

LGTM!

@jagobagascon
Copy link
Member

@deadprogram is it fine if I merge this?

@deadprogram
Copy link
Member

@jagobagascon looks good to me! Thanks @Cartermel for working on this.

@jagobagascon jagobagascon merged commit d46f2cc into tinygo-org:dev May 29, 2024
5 checks passed
AndyRN pushed a commit to jasday/bluetooth that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants