Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3360786ybt; Tue, 30 Jun 2020 00:20:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU1EgKnY2L3uZqKx5ZbArDfp6Qc1/pSUJhZQ0wgum1OS+2EMo/FQcvuaFVAmpDQvhL4JYp X-Received: by 2002:a17:906:6499:: with SMTP id e25mr17053932ejm.352.1593501638075; Tue, 30 Jun 2020 00:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593501638; cv=none; d=google.com; s=arc-20160816; b=w9IG3uLmPnVUjLnprB0Dgf2n90iJsRt6peYKxwWZtKfz9qYTuw9voXg6iMY3Az3G2o eqfFNzgDpXCMoe4kvkFu4V/+2I6mZY7JHYw1QmLEY26nSDQZsL2z+qWPiOZXqh4TqQLP RzMDrCw8IuJjk5hB9vdG3BMor6qOp74epDs0a+A/DHLaB/tDzMnoQYBSVjg8u+e6tyDu wn5mvEjjpw9oCWK1bG2btmwv9LjSlWTbKB9OQKK1S9v+Thn7YU0kkX34ACCjdQtCGmmY 3hu5e5dGwMHy5cZ7diJXdP1kZ7joiDRaPhDZJ3IouoKRhJ5ucDIu2h0Tz7IIftScpjBM 6yzA== 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:cc:to:from :ironport-sdr:ironport-sdr; bh=MKL++6+y8NVyGEQs/vHi+AtcKTgW/fESQsIy/Up2Dk8=; b=Zk4oOE0IEypWRYMA2LPpTBbufChDtpo9BKXJvNl4e8XzGzVGasOQcV6DRCrN+/eYoL g687Lde3mEuhWYE9lpB6JpEeBLh3gHlr3+fJX11SI1olVpEfoR5IuRERzmwnnJesXO28 bkEuEIXVj1Mnb4t2j1y1KcGGSHswLN1+EASbJ/5Pw+rl/io65/qoUBJMtesqmN8MKgMh PG/SPikeaQCtC8P505YO96Yn0SWWgD5Q4hrh47p0Cu26wvxcbaivSdD/i3ai72/I9Mca kG4s3MoPAhP1V7V0et/e8vXDXNFePjus0RJz8nfLT9+arkwV2T/3P6/lqgqo9xD6MBA5 tcig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ca5si1234940edb.511.2020.06.30.00.20.04; Tue, 30 Jun 2020 00:20:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S1730803AbgF3HTk (ORCPT + 99 others); Tue, 30 Jun 2020 03:19:40 -0400 Received: from mga18.intel.com ([134.134.136.126]:22973 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730793AbgF3HTk (ORCPT ); Tue, 30 Jun 2020 03:19:40 -0400 IronPort-SDR: LwqGGDkQlMTe9fGrG4B7vDIVz4wcKQWMbqpoAG6dq98kXRID+JIz+bW0+I0ncVl2k+WQ5h8RIE k9jnwpHZyc8g== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="133613602" X-IronPort-AV: E=Sophos;i="5.75,296,1589266800"; d="scan'208";a="133613602" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 00:19:39 -0700 IronPort-SDR: UI98di4ZscNcEKHaNdbofCJi+s78gQ4YZGygxsnVbM5up8A774SPJ9d67MV9xbFI2NHWcwlp9B a6jauQhNM/Pw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,296,1589266800"; d="scan'208";a="355698475" Received: from sdkini-mobl1.amr.corp.intel.com (HELO ingas-nuc1.sea.intel.com) ([10.254.110.226]) by orsmga001.jf.intel.com with ESMTP; 30 Jun 2020 00:19:39 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, michal.lowas-rzechonek@silvair.com, Inga Stotland Subject: [PATCH BlueZ 3/4] tools/mesh-cfgclient: Add options to "Models" property Date: Tue, 30 Jun 2020 00:19:35 -0700 Message-Id: <20200630071936.40437-4-inga.stotland@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200630071936.40437-1-inga.stotland@intel.com> References: <20200630071936.40437-1-inga.stotland@intel.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 This adds options dictionary to "Models" property to stay in sync with mesh-api changes. --- tools/mesh-cfgclient.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c index 0dd02fad8..59f079213 100644 --- a/tools/mesh-cfgclient.c +++ b/tools/mesh-cfgclient.c @@ -1448,14 +1448,26 @@ static void proxy_removed(struct l_dbus_proxy *proxy, void *user_data) } } +static void build_model(struct l_dbus_message_builder *builder, uint16_t mod_id, + bool pub_enable, bool sub_enable) +{ + l_dbus_message_builder_enter_struct(builder, "qa{sv}"); + l_dbus_message_builder_append_basic(builder, 'q', &mod_id); + l_dbus_message_builder_enter_array(builder, "{sv}"); + append_dict_entry_basic(builder, "Subscribe", "b", &sub_enable); + append_dict_entry_basic(builder, "Publish", "b", &pub_enable); + l_dbus_message_builder_leave_array(builder); + l_dbus_message_builder_leave_struct(builder); +} + static bool mod_getter(struct l_dbus *dbus, struct l_dbus_message *message, struct l_dbus_message_builder *builder, void *user_data) { - l_dbus_message_builder_enter_array(builder, "q"); - l_dbus_message_builder_append_basic(builder, 'q', &app.ele.mods[0]); - l_dbus_message_builder_append_basic(builder, 'q', &app.ele.mods[1]); + l_dbus_message_builder_enter_array(builder, "(qa{sv})"); + build_model(builder, app.ele.mods[0], false, false); + build_model(builder, app.ele.mods[1], false, false); l_dbus_message_builder_leave_array(builder); return true; @@ -1466,7 +1478,7 @@ static bool vmod_getter(struct l_dbus *dbus, struct l_dbus_message_builder *builder, void *user_data) { - l_dbus_message_builder_enter_array(builder, "(qq)"); + l_dbus_message_builder_enter_array(builder, "(qqa{sv})"); l_dbus_message_builder_leave_array(builder); return true; @@ -1517,9 +1529,10 @@ static void setup_ele_iface(struct l_dbus_interface *iface) /* Properties */ l_dbus_interface_property(iface, "Index", 0, "y", ele_idx_getter, NULL); - l_dbus_interface_property(iface, "VendorModels", 0, "a(qq)", + l_dbus_interface_property(iface, "VendorModels", 0, "a(qqa{sv})", vmod_getter, NULL); - l_dbus_interface_property(iface, "Models", 0, "aq", mod_getter, NULL); + l_dbus_interface_property(iface, "Models", 0, "a(qa{sv})", mod_getter, + NULL); /* Methods */ l_dbus_interface_method(iface, "DevKeyMessageReceived", 0, -- 2.26.2