Thread (2 messages) flat view 2 messages, 2 authors, 2021-02-21

How to receive notifications after calling StartNotify

From: Mihai Emilian <hidden>
Date: 2021-02-21 17:10:51

Dear linux-bluetooth community,

I am writing a bluetooth client in C which receives notifications from
a bluetooth device (server). I am able to call StartNotify() from the
bluez api and the Notifying property changes to true. However, I am
not sure how I should listen for the notifications, or where.

There are several questions:
a) How do I provide a callback function to this?
b) async or sync method call? Does it matter?
c) Do I need the main loop to do this and why?

Here's my source code https://pastebin.com/KEGTatsL

Is there an example? I tried looking at the different files such as
client in bluez kernel source and gatttool source, but I couldn't
figure this out.

Many thanks,
Regards,
Mihai
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help