Re: [PATCH 7/8] Bluetooth: Add new mgmt setting for LE advertising
From: Johan Hedberg <hidden>
Date: 2013-09-24 17:21:20
Hi Lizardo, On Tue, Sep 24, 2013, Anderson Lizardo wrote:
On Tue, Sep 24, 2013 at 10:02 AM, [off-list ref] wrote:quoted
This patch adds a new mgmt setting for LE advertising and hooks up the necessary places in the mgmt code to operate on the HCI_LE_PERIPHERAL flag (which corresponds to this setting). This patch does not yet add any new command for enabling the setting - that is left for a subsequent patch.How this code behaves if we enable/disable LE advertising using hciconfig hci0 leadv/noleadv? IIRC the LE_SET_ADV_ENABLE command will fail if advertising is already set on the controller.
You're right that a mix of mgmt and hciconfig will mix things up on the kernel side. This is something I was aware of but didn't investigate much further since I was assuming it would add too much complexity to the code. The principle has always been that we keep compatibility/good behavior with mixed mgmg/raw HCI access only as long as it doesn't needlessly complicate the code. That said, I'll take a another look if the flag setting could be moved to a hci_event.c handler from the request callback without requiring the addition of a second flag or state variable. This issue is not unique to this new setting but actually exists for many of them. What we probably need is a generic mgmt_send_new_settings function that hci_event.c handlers can call when they know that new_settings should be emitted. I suspect that might solve the issue. Johan