linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "jakub.witowski@silvair.com" <jakub.witowski@silvair.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Cc: "Stotland, Inga" <inga.stotland@intel.com>
Subject: Re: [PATCH BlueZ v2] mesh: Allow to set-up the CRPL with application
Date: Tue, 2 Jul 2019 17:50:10 +0000	[thread overview]
Message-ID: <1562089808.23933.0.camel@intel.com> (raw)
In-Reply-To: <20190702123141.19673-1-jakub.witowski@silvair.com>

Patch Applied

On Tue, 2019-07-02 at 14:31 +0200, Jakub Witowski wrote:
> This adds an optional CRPL property to org.bluez.mesh.Application1
> interface, allowing to indicate the depth of reply protection list.
> ---
>  doc/mesh-api.txt |  4 ++++
>  mesh/node.c      | 18 +++++++++++++-----
>  2 files changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt
> index 4e0a8bff1..893a1a6c0 100644
> --- a/doc/mesh-api.txt
> +++ b/doc/mesh-api.txt
> @@ -724,6 +724,10 @@ Properties:
>  
>  		A 16-bit vendor-assigned product version identifier
>  
> +	uint16 CRPL [read-only, optional]
> +
> +		A 16-bit minimum number of replay protection list entries
> +
>  
>  Mesh Element Hierarchy
>  ======================
> diff --git a/mesh/node.c b/mesh/node.c
> index 7383793d9..adc2aa93e 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -1312,10 +1312,6 @@ static bool create_node_config(struct mesh_node *node)
>  static void set_defaults(struct mesh_node *node)
>  {
>  	/* TODO: these values should come from mesh.conf */
> -	if (!node->comp)
> -		node->comp = l_new(struct node_composition, 1);
> -
> -	node->comp->crpl = DEFAULT_CRPL;
>  	node->lpn = MESH_MODE_UNSUPPORTED;
>  	node->proxy = MESH_MODE_UNSUPPORTED;
>  	node->friend = MESH_MODE_UNSUPPORTED;
> @@ -1338,8 +1334,10 @@ static bool get_app_properties(struct mesh_node *node, const char *path,
>  
>  	l_debug("path %s", path);
>  
> -	if (is_new)
> +	if (is_new) {
>  		node->comp = l_new(struct node_composition, 1);
> +		node->comp->crpl = DEFAULT_CRPL;
> +	}
>  
>  	while (l_dbus_message_iter_next_entry(properties, &key, &variant)) {
>  
> @@ -1372,6 +1370,16 @@ static bool get_app_properties(struct mesh_node *node, const char *path,
>  				return false;
>  
>  			node->comp->vid = value;
> +
> +		} else if (!strcmp(key, "CRPL")) {
> +			if (!l_dbus_message_iter_get_variant(&variant, "q",
> +									&value))
> +				return false;
> +
> +			if (!is_new && node->comp->crpl != value)
> +				return false;
> +
> +			node->comp->crpl = value;
>  		}
>  	}
>  

      reply	other threads:[~2019-07-02 17:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 12:31 [PATCH BlueZ v2] mesh: Allow to set-up the CRPL with application Jakub Witowski
2019-07-02 17:50 ` 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=1562089808.23933.0.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=inga.stotland@intel.com \
    --cc=jakub.witowski@silvair.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).