Linux bluetooth development
 help / color / mirror / Atom feed
From: "Stotland, Inga" <inga.stotland@intel.com>
To: "michal.lowas-rzechonek@silvair.com" 
	<michal.lowas-rzechonek@silvair.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Cc: "jakub.witowski@silvair.com" <jakub.witowski@silvair.com>,
	"Gix, Brian" <brian.gix@intel.com>
Subject: Re: [PATCH BlueZ v5 1/4] mesh: Add ImportLocalNode API documentation
Date: Wed, 17 Jul 2019 19:36:36 +0000	[thread overview]
Message-ID: <915ea1c10883aaf1e4d42c5a749bfda964b54b51.camel@intel.com> (raw)
In-Reply-To: <20190717083650.26346-2-michal.lowas-rzechonek@silvair.com>

[-- Attachment #1: Type: text/plain, Size: 4285 bytes --]

Hi Mical, Jakub, Brian...


On Wed, 2019-07-17 at 10:36 +0200, Michał Lowas-Rzechonek wrote:
> From: Jakub Witowski <jakub.witowski@silvair.com>
> 
> This updates the mesh-api.txt with new ImportLocalNode() API.
> ---
>  doc/mesh-api.txt | 52 ++++++++++++++++++++++++++++++++++++++------
> ----
>  1 file changed, 41 insertions(+), 11 deletions(-)
> 
> diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt
> index 0ac2fdfd1..7c2a1fafa 100644
> --- a/doc/mesh-api.txt
> +++ b/doc/mesh-api.txt
> @@ -151,16 +151,31 @@ Methods:
>  			org.bluez.mesh.Error.InvalidArguments
>  			org.bluez.mesh.Error.AlreadyExists,
>  
> -	 uint64 token ImportLocalNode(string json_data)
> +	uint64 token ImportLocalNode(object app_root, array{byte}[16]
> uuid,
> +							string
> data_type, array{byte} import_data)


I apologize for the backtracking, but I would like to revisit this API.

I feel like having "object app_root" is unnecessary and also, creates
some gnarly pathways within the code.

What exactly is the problem for requiring the composition data to be
part of the import_data? It's just weird to say "oh, it may be there or
it may be not".

Getting rid of the app_root and mandating the composition to be part of
the import_data allows:

1) Avoid checking whether this is a "full" configuration or the
"minimal" one

2) Efficiently re-use the existing code:
Adding an API call like this one may be sufficient

mesh_config_import(const char *cfg_dir,
                   const uint8_t uuid[16],
                   const uint8 *import_data, <import__len>?,
                   mesh_config_node_func_t cb,
                   void *user_data)

We can just re-factor the code that parses and populates a single node
from the stored configuration. user_data may contain whatever we need
to preserve in order to respond to d-bus call.

>  
>  		This method creates a local mesh node based on node
>  		configuration that has been generated outside
> bluetooth-meshd.
>  
> -		The json_data parameter is a full JSON representation
> of a node
> -		configuration file. The format must conform to the
> schema
> -		defined in "Mesh Node Configuration Schema" section.
> Any
> -		included token will be ignored in favor of a locally
> generated
> -		token value.
> +		The app_root parameter is a D-Bus object root path of
> the
> +		application that implements org.bluez.mesh.Application1
> +		interface.
> +
> +		The import_data parameter contains a representation of
> a
> +		provisioned node. Format of this representation depends
> on
> +		value of data_type parameter.
> +
> +		Allowed data_type values are: "json".
> +
> +		When data_type is "json", bluetooth-meshd daemon treats
> +		import_data is a JSON document following <TBD> schema.
> See the
> +		examples at the end of this document.
> +
> +		The import_data parameter can contain either minimal,
> or
> +		complete representation of a provisioned node.
> +
> +		When a complete representation is provided, it is
> validated
> +		against composition data provided by the application.
>  
>  		The returned token must be preserved by the application
> in
>  		order to authenticate itself to the mesh daemon and
> attach to
> @@ -173,8 +188,8 @@ Methods:
>  
>  		PossibleErrors:
>  			org.bluez.mesh.Error.InvalidArguments,
> -			org.bluez.mesh.Error.AlreadyExists
> -			org.bluez.mesh.Error.NotFound,
> +			org.bluez.mesh.Error.AlreadyExists,
> +			org.bluez.mesh.Error.NotSupported,
>  			org.bluez.mesh.Error.Failed
>  
>  Mesh Node Hierarchy
> @@ -1064,6 +1079,21 @@ Properties:
>  		Uniform Resource Identifier points to out-of-band (OOB)
>  		information (e.g., a public key)
>  
> -Mesh Node Configuration Schema
> -==============================
> -<TBD>
> +Mesh Node Configuration Examples
> +================================
> +Minimal JSON representation for ImportLocalNode():
> +
> +{
> +	"IVindex":0,
> +	"IVupdate":0,
> +	"unicastAddress":"0012",
> +	"deviceKey":"7daa45cd1e9e11a4b86eeef7d01efa11",
> +	"netKeys":[
> +		{
> +			"index":"0000",
> +			"key":"2ddfef86d67144c394428ea3078f86f9",
> +			"keyRefresh":0
> +		}
> +	],
> +	"sequenceNumber":15  /* optional */
> +}

Regards, Inga

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3265 bytes --]

  reply	other threads:[~2019-07-17 19:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17  8:36 [PATCH BlueZ v5 0/4] Implement ImportLocalNode D-Bus API Michał Lowas-Rzechonek
2019-07-17  8:36 ` [PATCH BlueZ v5 1/4] mesh: Add ImportLocalNode API documentation Michał Lowas-Rzechonek
2019-07-17 19:36   ` Stotland, Inga [this message]
2019-07-17 19:47     ` michal.lowas-rzechonek
2019-07-17 21:14       ` Gix, Brian
2019-07-18  8:16         ` michal.lowas-rzechonek
2019-07-17  8:36 ` [PATCH BlueZ v5 2/4] mesh: Extract read_* functions in mesh-config-json Michał Lowas-Rzechonek
2019-07-17  8:36 ` [PATCH BlueZ v5 3/4] mesh: Implement ImportLocalNode() method Michał Lowas-Rzechonek
2019-07-17  8:36 ` [PATCH BlueZ v5 4/4] mesh: Convert void pointers to anonymous unions in managed_obj_request:wq Michał Lowas-Rzechonek

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=915ea1c10883aaf1e4d42c5a749bfda964b54b51.camel@intel.com \
    --to=inga.stotland@intel.com \
    --cc=brian.gix@intel.com \
    --cc=jakub.witowski@silvair.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox