Re: [PATCH BlueZ] mesh: Implement provisioning loop-back

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux