All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "michal.lowas-rzechonek@silvair.com" 
	<michal.lowas-rzechonek@silvair.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] mesh: Replace BeaconFlags with just IvUpdate
Date: Thu, 18 Jun 2020 15:40:56 +0000	[thread overview]
Message-ID: <0699780dc4a367561f9a14ba2adf3fe9cc060bb1.camel@intel.com> (raw)
In-Reply-To: <20200617202657.42474-1-michal.lowas-rzechonek@silvair.com>

Applied
On Wed, 2020-06-17 at 22:26 +0200, Michał Lowas-Rzechonek wrote:
> To import nodes, applications need just IvIndex and IvUpdate. KeyRefresh
> phase in under provisioner's control, so we don't need to expose it.
> 
> Moreover, BeaconFlags property dealt just with the primary net key, and
> each subnet key is refreshed separately.
> ---
>  doc/mesh-api.txt |  8 ++++----
>  mesh/node.c      | 12 ++++++++----
>  2 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt
> index 7fbab32b6..0f10a7c89 100644
> --- a/doc/mesh-api.txt
> +++ b/doc/mesh-api.txt
> @@ -431,11 +431,11 @@ Properties:
>  		This property indicates whether the periodic beaconing is
>  		enabled (true) or disabled (false).
>  
> -	uint8 BeaconFlags [read-only]
> +	boolean IvUpdate [read-only]
>  
> -		This property may be read at any time to determine the flag
> -		field setting on sent and received beacons of the primary
> -		network key.
> +		When true, indicates that the network is in the middle of IV
> +		Index Update procedure. This information is only useful for
> +		provisioning.
>  
>  	uint32 IvIndex [read-only]
>  
> diff --git a/mesh/node.c b/mesh/node.c
> index 6140fdf9f..87c3bb46f 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -32,6 +32,7 @@
>  #include "mesh/mesh-defs.h"
>  #include "mesh/mesh.h"
>  #include "mesh/net.h"
> +#include "mesh/net-keys.h"
>  #include "mesh/appkey.h"
>  #include "mesh/mesh-config.h"
>  #include "mesh/provision.h"
> @@ -2183,7 +2184,7 @@ static bool beacon_getter(struct l_dbus *dbus, struct l_dbus_message *msg,
>  	return true;
>  }
>  
> -static bool beaconflags_getter(struct l_dbus *dbus, struct l_dbus_message *msg,
> +static bool ivupdate_getter(struct l_dbus *dbus, struct l_dbus_message *msg,
>  					struct l_dbus_message_builder *builder,
>  					void *user_data)
>  {
> @@ -2191,10 +2192,13 @@ static bool beaconflags_getter(struct l_dbus *dbus, struct l_dbus_message *msg,
>  	struct mesh_net *net = node_get_net(node);
>  	uint8_t flags;
>  	uint32_t iv_index;
> +	bool ivu;
>  
>  	mesh_net_get_snb_state(net, &flags, &iv_index);
>  
> -	l_dbus_message_builder_append_basic(builder, 'y', &flags);
> +	ivu = flags & IV_INDEX_UPDATE;
> +
> +	l_dbus_message_builder_append_basic(builder, 'b', &ivu);
>  
>  	return true;
>  }
> @@ -2295,8 +2299,8 @@ static void setup_node_interface(struct l_dbus_interface *iface)
>  	l_dbus_interface_property(iface, "Features", 0, "a{sv}", features_getter,
>  									NULL);
>  	l_dbus_interface_property(iface, "Beacon", 0, "b", beacon_getter, NULL);
> -	l_dbus_interface_property(iface, "BeaconFlags", 0, "y",
> -						beaconflags_getter, NULL);
> +	l_dbus_interface_property(iface, "IvUpdate", 0, "b", ivupdate_getter,
> +									NULL);
>  	l_dbus_interface_property(iface, "IvIndex", 0, "u", ivindex_getter,
>  									NULL);
>  	l_dbus_interface_property(iface, "SequenceNumber", 0, "u",

      reply	other threads:[~2020-06-18 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 20:26 [PATCH BlueZ] mesh: Replace BeaconFlags with just IvUpdate Michał Lowas-Rzechonek
2020-06-18 15:40 ` 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=0699780dc4a367561f9a14ba2adf3fe9cc060bb1.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=michal.lowas-rzechonek@silvair.com \
    /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.