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

Fixes characterist data lost issue #61

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ internal class GattConnectionImpl(
}

override fun onCharacteristicChanged(gatt: BG, characteristic: BGC) {
launch { characteristicChangedChannel.send(characteristic) }
runBlocking { characteristicChangedChannel.send(characteristic) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is blocking a thread helping here?

Did you try with #53 instead?

Copy link
Author

Choose a reason for hiding this comment

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

That's an awesome question, but I don't have any answer. This just works, rather we like it or not.

Copy link
Author

Choose a reason for hiding this comment

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

Did you try with #53 instead?

Yes, in fact I thought that had solved the issue, but turns out nothing but this solved this crazy behavior.

}

override fun onDescriptorRead(gatt: BG, descriptor: BGD, status: Int) {
Expand Down