weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
84 stars 19 forks source link

Periheral as a thread #50

Closed Happy13r closed 2 weeks ago

Happy13r commented 1 month ago

Hi, As a stand alone process, the peripheral works fine. But when I'm trying to run peripheral as a thread. The advertisement does not work. At first look it seems callback are not working properly. Do you know what could be the issue here.

weliem commented 1 month ago

You might want to read up on DBus and GLib with regards to threads for in-depth information. My understanding is that callbacks/signals always are delivered on the thread associated with the main context. That perhaps explains what you are seeing?

Happy13r commented 1 month ago

yes, you're right it works perfectly in the main context. I'll go through the Dbus & Glib documentation as well, thanks!