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] AddConnectionStatusChanged callback #331

Open
dbogoslovtsev opened this issue Jan 9, 2025 · 0 comments
Open

[Windows] AddConnectionStatusChanged callback #331

dbogoslovtsev opened this issue Jan 9, 2025 · 0 comments
Labels

Comments

@dbogoslovtsev
Copy link

Hi! I noticed the recent activity in the dev branch (#319). Thanks for the fixes!
I’d like to take it a step further and get AddConnectionStatusChanged/RemoveConnectionStatusChanged working on the Windows target.
I tried implementing something like this, but the callback doesn’t seem to work:

	var handler *foundation.TypedEventHandler
	handler = foundation.NewTypedEventHandler(
		ole.NewGUID(winrt.ParameterizedInstanceGUID(
			foundation.GUIDTypedEventHandler,
			bluetooth.SignatureBluetoothLEDevice,
			bluetooth.SignatureBluetoothConnectionStatus,
		)),
		func(instance *foundation.TypedEventHandler, sender, args unsafe.Pointer) {
			println("TypedEventHandlerCallback")
			println(instance)
			println(sender)
			println(args)

			if a.connectHandler != nil {
				a.connectHandler(device, false)
			}
		})
	bleDevice.AddConnectionStatusChanged(handler)

Is there any chance you might implement this later? Or do you have any suggestions on how to make it work properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants