bluetooth icon indicating copy to clipboard operation
bluetooth copied to clipboard

Problem with SetConnectedHandler() on Raspberry Pi OS Peripheral Device

Open kevin-activ opened this issue 8 months ago • 1 comments

Same issue as https://github.com/tinygo-org/bluetooth/issues/145 That was closed but it's still an issue.

Unfortunately this is still not working with v0.11.0 on Raspberry Pi Linux

I'm running this lib version: Dep: &{Path:tinygo.org/x/bluetooth Version:v0.11.0 Sum:h1:32ludjNnqz6RyVRpmw2qgod7NvDePbBTWXkJm6jj4cg= Replace:<nil>}

and the latest version of Pi OS Linux pi4work 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

I have my program running as a BLE peripheral and the connections work just fine and I can send data, but the connect handler is never called. No matter where I call SetConnectHandler() from. I've tried before and after enabling the adapter, before and after starting the advertising, etc

adapter.SetConnectHandler(func(d bluetooth.Device, c bool) {
		println("handler")
		connected = c
	})

kevin-activ avatar Apr 10 '25 22:04 kevin-activ

Labeling to close on next release, since this has been addressed by #369

deadprogram avatar Jun 13 '25 07:06 deadprogram

Thank you!

kevin-activ avatar Aug 05 '25 18:08 kevin-activ