Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1026943ybb; Wed, 8 Apr 2020 14:58:47 -0700 (PDT) X-Google-Smtp-Source: APiQypIYtSgBj064gc9SR66qaU4kVkRcLFWJLtn3Z7sGQu5D6+2U6gMS+GKnVgScoD8dla5u7/Fc X-Received: by 2002:a9d:1402:: with SMTP id h2mr7538939oth.74.1586383126907; Wed, 08 Apr 2020 14:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586383126; cv=none; d=google.com; s=arc-20160816; b=lGonSDeUaiJq0agHEp0KjtbceSGaaqbXoAeW22m+njAaxDM8w8Nc4ZYhe7NhYeK5Lh usKpjCq6ZNhb4l5nxwS3arVvpJAWak3Su7WHNCkdGH/6R6Rv8K3A91NcKq49kvaUP5+p /HKMCyGM27QyKc7tpg/gLcjDYfQjwQ05i67wk93DVjlELTCSuSipWcRZ7yuDF2hsflHL frVu3jkXBBHX+PF4TJ2T5mjNgJEMv4SscTalg7zB1mTWdx7A0eln+YGj4Tx/QxgYjrLI OlKQmWifsL/jXjmJbvidNL/rnSjKVTVls4SmnseT6I5h6K9Be3AxAguzxmAGkOVFSQ8u eKnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wb2l5MlE5PDSa/vPETkuDpxKceTJxVH4B42sQMrryig=; b=My/wLQHoRyQRp6ihN/n+t6s0FSSxBGfFLa2bbh2B/hArksWWIV3R/VvBDhb/GVh/kt 1+lDzGoaVqSmE/xwLiU6gDtgkXvB9XZghzaiGuSWWrXiT7zbU8whMZX+0czVCpg9/iOe TOgi6oLzAP2izXe9HTgL5Tdq6LTJkhwbirKL+bCVp2MT4tBYJQXgAl1mh77yld48MZSf 00chZKcYw+SvM6GtV9rup4CwUhRncTMrNhMmCXmcEr9yQnWLTK3n1Y08OhPKkLC2ESMP 5a+KTDbXlinwIr6hCiNLFCNuhEIgZm5mbQ5CnSA+PwT5d3TkxgIb2kcC1pLNoZWwmo88 o5Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=Dtohcq88; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si3232529otg.319.2020.04.08.14.58.35; Wed, 08 Apr 2020 14:58:46 -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; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=Dtohcq88; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728913AbgDHUxJ (ORCPT + 99 others); Wed, 8 Apr 2020 16:53:09 -0400 Received: from mail-lj1-f178.google.com ([209.85.208.178]:43673 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729318AbgDHUxJ (ORCPT ); Wed, 8 Apr 2020 16:53:09 -0400 Received: by mail-lj1-f178.google.com with SMTP id g27so9142993ljn.10 for ; Wed, 08 Apr 2020 13:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wb2l5MlE5PDSa/vPETkuDpxKceTJxVH4B42sQMrryig=; b=Dtohcq88cp3mbc2xBG8HFDICPDxPOnk36R65EceeByu6izAKKmSSlJ2KOVUcSThiNU 8fVwXiVgrKWJj1jT5DrE6ef5qSGlst8gY7Lkj+dmO57AZeZ1QdiieHjoStO6O1Aci6q1 CflL6av9edLeDwG0E0MaQZUKn9FkiGn2IxRKdJ27ZkAPjTwJ89g+ZHr1CffkY90Ztn1f 96O92heHqn3h/RvcjYyq+1PQ3OSMxYxqshxefx9myQwa7JqGgd5RuTEi+KP2ihTBfoT+ QHYrYQPOSomd7VmWFHg6VKXb7jylKzXlEoUoRey7v/APioKaAzS7lI03VmRkeqOANcYi 0g/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wb2l5MlE5PDSa/vPETkuDpxKceTJxVH4B42sQMrryig=; b=gCQaGpBGNTj7ogmYBtBaj+iB2K39YSRj8mdWL+isaFFEDELaQTGEqdyCDklk1lUo63 Sn3YcQJtJl/R5ZD7sPXA1vXq6Nrs9RLSvIZjwuaieg20iHaWIlnSQK5irL14HDUpPo9r encmP5K4voUIjAlUajCRsmH9mY3XTDJ1Ei4/inoboHpFcRZeEJ1Ad0otqW0/EZD+RE3C Px8/shxIxyYOubNrV540mxrZBia3+H6cyN6vOuQkzPCaIadTde86yD0RwrraqaK3MMor pP5gB6QZM0yNY8+yL/oTLr2stelXZhZzh8YJJKjXUgqTT1KdTDmm+7qV53E9iyJ1z5u6 X1/w== X-Gm-Message-State: AGi0Puaw+84gzoBR8taLgygFz5eld3L4rKdRNY2bfg35+yvX2TkvRfi6 SAZSnxoAYmrFy+u98n86XfOcejP7Eig= X-Received: by 2002:a2e:b610:: with SMTP id r16mr6269823ljn.254.1586379185585; Wed, 08 Apr 2020 13:53:05 -0700 (PDT) Received: from kynes.internet.domowy (apn-37-7-76-34.dynamic.gprs.plus.pl. [37.7.76.34]) by smtp.gmail.com with ESMTPSA id r24sm14168976ljn.25.2020.04.08.13.53.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 13:53:05 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20Lowas-Rzechonek?= To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/4] doc/mesh: Change API to deliver tokens via JoinComplete Date: Wed, 8 Apr 2020 22:52:53 +0200 Message-Id: <20200408205255.45112-3-michal.lowas-rzechonek@silvair.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200408205255.45112-1-michal.lowas-rzechonek@silvair.com> References: <20200408205255.45112-1-michal.lowas-rzechonek@silvair.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org If Application is not be able to reliably store the token, the daemon will end up with a uncontrollable node in its database. Let's fix the issue by always delivering tokens using JoinComplete call, and expecting a reply - if the application return an error, daemon will get rid of the node. --- doc/mesh-api.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt index c7374703b..08e34096d 100644 --- a/doc/mesh-api.txt +++ b/doc/mesh-api.txt @@ -29,6 +29,10 @@ Methods: therefore attempting to call this function using already registered UUID results in an error. + When provisioning finishes, the daemon will call either + JoinComplete or JoinFailed method on object implementing + org.bluez.mesh.Application1 interface. + PossibleErrors: org.bluez.mesh.Error.InvalidArguments org.bluez.mesh.Error.AlreadyExists, @@ -123,7 +127,7 @@ Methods: PossibleErrors: org.bluez.mesh.Error.InvalidArguments - uint64 token CreateNetwork(object app_root, array{byte}[16] uuid) + void CreateNetwork(object app_root, array{byte}[16] uuid) This is the first method that an application calls to become a Provisioner node, and a Configuration Client on a newly @@ -155,11 +159,14 @@ Methods: unicast address (0x0001), and create and assign a net_key as the primary network net_index (0x000). + When creation finishes, the daemon will call JoinComplete method + on object implementing org.bluez.mesh.Application1 interface. + PossibleErrors: org.bluez.mesh.Error.InvalidArguments org.bluez.mesh.Error.AlreadyExists, - uint64 token Import(object app_root, array{byte}[16] uuid, + void Import(object app_root, array{byte}[16] uuid, array{byte}[16] dev_key, array{byte}[16] net_key, uint16 net_index, dict flags, uint32 iv_index, uint16 unicast) @@ -204,11 +211,8 @@ Methods: The unicast parameter is the primary unicast address of the imported node. - The returned token must be preserved by the application in - order to authenticate itself to the mesh daemon and attach to - the network as a mesh node by calling Attach() method or - permanently remove the identity of the mesh node by calling - Leave() method. + When import finishes, the daemon will call JoinComplete method + on object implementing org.bluez.mesh.Application1 interface. PossibleErrors: org.bluez.mesh.Error.InvalidArguments, @@ -770,6 +774,10 @@ Methods: permanently remove the identity of the mesh node by calling Leave() method. + If this method returns an error, the daemon will assume that the + application failed to preserve the token, and will remove the + freshly created node. + void JoinFailed(string reason) This method is called when the node provisioning initiated by -- 2.26.0