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

Add Write command to the darwin gattc implementaiton #212

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

Fabianexe
Copy link
Contributor

This solve the Darwin part of #153.

I have tested it and it works like expected.

@aykevl
Copy link
Member

aykevl commented Dec 26, 2023

Checked the documentation and this just sends the write, it apparently doesn't wait for a response so the caller doesn't know whether the call succeeded or not, or even whether the BLE connection is still alive. It always returns nil. Perhaps it should wait until the didWriteValueFor event is received?
For more information, see:
https://pkg.go.dev/github.com/tinygo-org/cbgo#Peripheral.WriteCharacteristic
https://developer.apple.com/documentation/corebluetooth/cbperipheral/1518747-writevalue

@Fabianexe
Copy link
Contributor Author

@aykevl you are right I have not looked so deep into the documentation, sorry for that.

I have added the delegate and wait now if an error appears.

Writing, waiting, and timeouts work fine on my mac.

@aykevl aykevl changed the base branch from release to dev January 5, 2024 13:02
@aykevl aykevl merged commit 190c4be into tinygo-org:dev Jan 5, 2024
5 checks passed
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.

2 participants