Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1288933ybi; Wed, 17 Jul 2019 12:37:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBpXBCZ8XroJqHohRW+wtXRoeyF/EG3MQdkook4p5Rgkz2G92SgDBZep/hU2POR5UZr57p X-Received: by 2002:a63:6d6:: with SMTP id 205mr44219390pgg.262.1563392231437; Wed, 17 Jul 2019 12:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563392231; cv=none; d=google.com; s=arc-20160816; b=RCHtes2TJr7AFkd3lW2ld8nYPn/itZGoBMAwgVTvJj+ub1w2iYc6amPDUpv4vHqfeH t1dzqASs1pPRkU2d0M7HdYvtQiNAjH4vcjEVeKFD6yJGHQBQdjNr28TL2O9lMmIrrr6g kQu3STGM1T/XGvMQlNjEeRovKSF9SNxkfFA/OnNkCHMfI2lPG5eJF///aJSg2rO/Or0W kqOtz/NYSnGhUK9i7EVw/TrxwMF0ZQkbcwJtm92mVC27kbp1WZprtyAveyARV6nvbOEf o+uMT6eT1VSL+WogRXL2ypPq5IHyx/gjTt0aOHj/Opw0UMakfmKvSNwkXZch5h/9qJJD 3e4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=Yq/HGgW36UZkDvBxAIVQvmm+5yHTRTRwYd4C0RbmKYY=; b=ohRdTER+ItwL9dIRlkEtpZ6ASm0o/UtcwHXhIFBaONghB4CM5WX66P3N99yNERkhzr Tn79it34K6TnsJpztPpjCN6F03v3wcmXeoCwpckMYRc3jSnTl/ropetuOfVUjepR07E8 0vmwneC20I4poj/28FV9VQgEhpz1FemDXx5C9wUmNzvsDQFty2C/oYHGuWpPERTKuNTF l7zta3V4ATNJds4B9f8BI61ii4EvpIlFt2FGPmgC6GyxbqL0IGRJZfjSiHvwV3cW2SaM 5/AKtAsf5Fjy/cNeiAJdNNKWzlLJIoBHva13QycwClJK3Z4fFY74H0KrKyEAr2/t1k/C YR/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si25539153pfb.230.2019.07.17.12.36.56; Wed, 17 Jul 2019 12:37:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728825AbfGQTgj (ORCPT + 99 others); Wed, 17 Jul 2019 15:36:39 -0400 Received: from mga02.intel.com ([134.134.136.20]:33305 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbfGQTgj (ORCPT ); Wed, 17 Jul 2019 15:36:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 12:36:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,275,1559545200"; d="p7s'?scan'208";a="343136759" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga005.jf.intel.com with ESMTP; 17 Jul 2019 12:36:38 -0700 Received: from orsmsx152.amr.corp.intel.com (10.22.226.39) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 17 Jul 2019 12:36:38 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.44]) by ORSMSX152.amr.corp.intel.com ([169.254.8.114]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 12:36:37 -0700 From: "Stotland, Inga" To: "michal.lowas-rzechonek@silvair.com" , "linux-bluetooth@vger.kernel.org" CC: "jakub.witowski@silvair.com" , "Gix, Brian" Subject: Re: [PATCH BlueZ v5 1/4] mesh: Add ImportLocalNode API documentation Thread-Topic: [PATCH BlueZ v5 1/4] mesh: Add ImportLocalNode API documentation Thread-Index: AQHVPHrRSRdWVWuYrkOiqop882Ac1KbPqkcA Date: Wed, 17 Jul 2019 19:36:36 +0000 Message-ID: <915ea1c10883aaf1e4d42c5a749bfda964b54b51.camel@intel.com> References: <20190717083650.26346-1-michal.lowas-rzechonek@silvair.com> <20190717083650.26346-2-michal.lowas-rzechonek@silvair.com> In-Reply-To: <20190717083650.26346-2-michal.lowas-rzechonek@silvair.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.251.159.19] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-CaZftizhwAEjUnAkOG1Q" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-CaZftizhwAEjUnAkOG1Q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mical, Jakub, Brian... On Wed, 2019-07-17 at 10:36 +0200, Micha=C5=82 Lowas-Rzechonek wrote: > From: Jakub Witowski >=20 > This updates the mesh-api.txt with new ImportLocalNode() API. > --- > doc/mesh-api.txt | 52 ++++++++++++++++++++++++++++++++++++++------ > ---- > 1 file changed, 41 insertions(+), 11 deletions(-) >=20 > 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, > =20 > - 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, ?, 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. > =20 > This method creates a local mesh node based on node > configuration that has been generated outside > bluetooth-meshd. > =20 > - 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 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. > =20 > 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: > =20 > 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 > =20 > Mesh Node Hierarchy > @@ -1064,6 +1079,21 @@ Properties: > Uniform Resource Identifier points to out-of-band (OOB) > information (e.g., a public key) > =20 > -Mesh Node Configuration Schema > -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > - > +Mesh Node Configuration Examples > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > +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 --=-CaZftizhwAEjUnAkOG1Q Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbDCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0 d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDAeFw0xMzEyMTEwMDAwMDBa Fw0yMDA1MzAxMDQ4MzhaMHkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEUMBIGA1UEBxM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