From: "Gix, Brian" <brian.gix@intel.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Cc: "Hedberg, Johan" <johan.hedberg@intel.com>,
"Stotland, Inga" <inga.stotland@intel.com>
Subject: Re: [PATCH BlueZ] mesh: Add MGMT bypass when specifying controller
Date: Mon, 4 Feb 2019 20:11:13 +0000 [thread overview]
Message-ID: <1549311072.22761.3.camel@intel.com> (raw)
In-Reply-To: <20190131205022.6689-1-brian.gix@intel.com>
Applied
On Thu, 2019-01-31 at 12:50 -0800, Brian Gix wrote:
> If Daemon is started with an explicit controller specified, the
> MGMT search for an unused shared controller is bypassed, and
> the controller is opened directly.
> ---
> mesh/mesh.c | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/mesh/mesh.c b/mesh/mesh.c
> index 881b6ed73..e49653ef8 100644
> --- a/mesh/mesh.c
> +++ b/mesh/mesh.c
> @@ -304,7 +304,7 @@ bool mesh_init(uint16_t index, const char *config_dir)
> if (initialized)
> return true;
>
> - if (!init_mgmt()) {
> + if (index == MGMT_INDEX_NONE && !init_mgmt()) {
> l_error("Failed to initialize mesh management");
> return false;
> }
> @@ -326,12 +326,18 @@ bool mesh_init(uint16_t index, const char *config_dir)
> if (!storage_load_nodes(config_dir))
> return false;
>
> - l_debug("send read index_list");
> - if (mgmt_send(mgmt_mesh, MGMT_OP_READ_INDEX_LIST,
> - MGMT_INDEX_NONE, 0, NULL,
> - read_index_list_cb, NULL, NULL) <= 0)
> - return false;
> -
> + if (index == MGMT_INDEX_NONE) {
> + /* Use MGMT to find a candidate controller */
> + l_debug("send read index_list");
> + if (mgmt_send(mgmt_mesh, MGMT_OP_READ_INDEX_LIST,
> + MGMT_INDEX_NONE, 0, NULL,
> + read_index_list_cb, NULL, NULL) <= 0)
> + return false;
> + } else {
> + /* Open specified controller without searching */
> + start_io(mesh.req_index);
> + return mesh.io != NULL;
> + }
> return true;
> }
>
prev parent reply other threads:[~2019-02-04 20:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 20:50 [PATCH BlueZ] mesh: Add MGMT bypass when specifying controller Brian Gix
2019-02-04 20:11 ` Gix, Brian [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1549311072.22761.3.camel@intel.com \
--to=brian.gix@intel.com \
--cc=inga.stotland@intel.com \
--cc=johan.hedberg@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.