All of lore.kernel.org
 help / color / mirror / Atom feed
* Understanding Bluez mgmt events
@ 2017-05-16  8:49 Natalya Rozhnova
  2017-05-16 14:24 ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Natalya Rozhnova @ 2017-05-16  8:49 UTC (permalink / raw)
  To: linux-bluetooth

Hello,

I'm trying to understand the mgmt events in Bluez.
If I understand correctly, the MGMT_OP_... commands are first sent as following:

mgmt_send(adapter->mgmt, MGMT_OP_START_DISCOVERY, ...)

And then it should trigger a corresponding event like
MGMT_EV_DISCOVERING, MGMT_EV_DEVICE_FOUND etc.

I'm quite lost in understanding who, where and how generates these
MGMT_EV... events...
Could anybody please explain this on a simple example or showing a
piece of code in bluez sources where it is done...

Thanks in advance for any help,
Natalya

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Understanding Bluez mgmt events
  2017-05-16  8:49 Understanding Bluez mgmt events Natalya Rozhnova
@ 2017-05-16 14:24 ` Johan Hedberg
  2017-05-16 15:27   ` Natalya Rozhnova
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2017-05-16 14:24 UTC (permalink / raw)
  To: Natalya Rozhnova; +Cc: linux-bluetooth

Hi Natalya,

On Tue, May 16, 2017, Natalya Rozhnova wrote:
> I'm trying to understand the mgmt events in Bluez.
> If I understand correctly, the MGMT_OP_... commands are first sent as following:
> 
> mgmt_send(adapter->mgmt, MGMT_OP_START_DISCOVERY, ...)
> 
> And then it should trigger a corresponding event like
> MGMT_EV_DISCOVERING, MGMT_EV_DEVICE_FOUND etc.
> 
> I'm quite lost in understanding who, where and how generates these
> MGMT_EV... events...
> Could anybody please explain this on a simple example or showing a
> piece of code in bluez sources where it is done...

The mgmt protocol is a protocol between user space and the kernel. User
space (normally bluetoothd) sends commands to the kernel, and the kernel
sends events to user space. You can find the kernel-side implementation
in net/bluetooth/mgmt.c.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Understanding Bluez mgmt events
  2017-05-16 14:24 ` Johan Hedberg
@ 2017-05-16 15:27   ` Natalya Rozhnova
  0 siblings, 0 replies; 3+ messages in thread
From: Natalya Rozhnova @ 2017-05-16 15:27 UTC (permalink / raw)
  To: linux-bluetooth

Hello Johan,

Thank you very much for your reply, it's much clearer now!

Natalya

2017-05-16 16:24 GMT+02:00 Johan Hedberg <johan.hedberg@gmail.com>:
> Hi Natalya,
>
> On Tue, May 16, 2017, Natalya Rozhnova wrote:
>> I'm trying to understand the mgmt events in Bluez.
>> If I understand correctly, the MGMT_OP_... commands are first sent as following:
>>
>> mgmt_send(adapter->mgmt, MGMT_OP_START_DISCOVERY, ...)
>>
>> And then it should trigger a corresponding event like
>> MGMT_EV_DISCOVERING, MGMT_EV_DEVICE_FOUND etc.
>>
>> I'm quite lost in understanding who, where and how generates these
>> MGMT_EV... events...
>> Could anybody please explain this on a simple example or showing a
>> piece of code in bluez sources where it is done...
>
> The mgmt protocol is a protocol between user space and the kernel. User
> space (normally bluetoothd) sends commands to the kernel, and the kernel
> sends events to user space. You can find the kernel-side implementation
> in net/bluetooth/mgmt.c.
>
> Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-16 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16  8:49 Understanding Bluez mgmt events Natalya Rozhnova
2017-05-16 14:24 ` Johan Hedberg
2017-05-16 15:27   ` Natalya Rozhnova

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.