From: "Michał Lowas-Rzechonek" <michal.lowas-rzechonek@silvair.com>
To: Brian Gix <brian.gix@intel.com>
Cc: linux-bluetooth@vger.kernel.org, inga.stotland@intel.com
Subject: Re: [PATCH BlueZ] mesh: Implement provisioning loop-back
Date: Sat, 11 Jan 2020 00:47:09 +0100 [thread overview]
Message-ID: <20200110234709.ihnstfmahenstspp@kynes> (raw)
In-Reply-To: <20200110181437.31167-1-brian.gix@intel.com>
Hi Brian,
On 01/10, Brian Gix wrote:
> This allows one App using the mesh daemon to provision another.
This patch contains also some wording cosmetics and other PB-ADV fixes
that don't seem related to the loopback mechanism.
Could you please split this into a patchset?
> +static void loop_adv(struct pb_adv_session *session, const uint8_t *data,
> + uint16_t len)
> +{
> + struct idle_rx *rx = l_new(struct idle_rx, 1);
> +
> + rx->session = session;
> + rx->len = len;
> + memcpy(rx->data, data, len);
> +
> + l_idle_oneshot(idle_rx_adv, rx, NULL);
> +}
(...)
> + if (session->loop)
> + loop_adv(session->loop, buf, init_size + 10);
> + else
> + mesh_send_pkt(MESH_IO_TX_COUNT_UNLIMITED, 200,
> + buf, init_size + 10);
This condition check is repeated throughout the code. I think it would
be clearer to replace mesh_send_pkt usages with something like:
static void pb_adv_send(struct pb_adv_session *session, uint8_t count,
uint16_t interval, void *data, uint16_t len)
{
if (session->loop) {
struct idle_rx *rx = ...
} else {
mesh_send_pkt(count, interval, data, len);
}
}
--
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND
next prev parent reply other threads:[~2020-01-10 23:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 18:14 [PATCH BlueZ] mesh: Implement provisioning loop-back Brian Gix
2020-01-10 23:47 ` Michał Lowas-Rzechonek [this message]
2020-01-11 0:53 ` Gix, Brian
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=20200110234709.ihnstfmahenstspp@kynes \
--to=michal.lowas-rzechonek@silvair.com \
--cc=brian.gix@intel.com \
--cc=inga.stotland@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).