-
Notifications
You must be signed in to change notification settings - Fork 143
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
Problem with SetConnectedHandler() on Linux (Raspbian) Peripheral Device #145
Comments
For your use case, you need to implement the callbacks for the peripheral services that you are implementing. I am not aware of a call to At the bottom of the go library abstractions, the BlueZ stack is used for the Linux implementation. You can find its docs here |
What @TirelessDev said! 😸 |
Hello, I guess I will modify it later to do like @TirelessDev, as it seems much more elegant that what I did ( 80d9f9d ) Anyway, thank you for your help, it works well ! |
Nice, good to know that that property change is fired off when acting as a peripheral as well! It might then be worth weaving the functionality into this library in the same way, though I am not sure if the same would be possible on MacOS and Windows. @SVdvr did you want to put a draft PR together with what you have working so that we can look at doing this? |
Yes please! |
Hello, sorry for the delay, I completely forgot to answer the last post... I'll try to do it during the nex days/weeks, but I'll still tell you how it works, maybe someone will find a better idea.
|
Now closing as part of release |
@deadprogram Can you provide the same feature also for linux environment? |
Hello,
I am using your lib to create/manage a peripheral BLE device on an RPI 4.
It already works quite well, I can advertise and read/write with services and characteristics I defined. However, I would need to run a function each time a a Central device connects/disconnects to my RPI.
As I understood, the 'adapter.SetConnectHandler()' can be used for that, but it doesn't work for me.
Did I miss something ? My code is very similar to this example : https://github.com/tinygo-org/bluetooth/blob/v0.6.0/examples/circuitplay/main.go
How do I (is it possible to ?) configure a handler that will be called each time a central device connects to my Linux (Raspbian) peripheral ?
Thank you !
The text was updated successfully, but these errors were encountered: