Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5116909ybl; Tue, 14 Jan 2020 03:51:10 -0800 (PST) X-Google-Smtp-Source: APXvYqx2XN5/6wCk9HbToujrEv0a+QsGVj1Q5eQpzSb8DN+U5qnDD8SQczLaABvT8dUuCzZ+Vu7h X-Received: by 2002:aca:a883:: with SMTP id r125mr17326929oie.56.1579002670268; Tue, 14 Jan 2020 03:51:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579002670; cv=none; d=google.com; s=arc-20160816; b=dtbR73t5Ou8RtXTTY7GBZyQNVAgooGRJXf8w9jMXyXJ76B753gClMvi3wfBiCLXRt1 ycHzIYc1F0Xkpo4pvkTJjY4x1ysLsCU2bpp3GEHkEdNJvGSlFwNxpKql2iLQa9C3YVdB iTA+QzpN9V2Alr+re+sC839nF9EEud6MayyKfJqYYcc+qd799qDCG1qwrDrEfwLvmlTt ebp662o7f6Bfho7cb4dX/h0NnGgEnrNQ0WphXSVreuFnS+nr5qmfK8PmhnVo3eEGBvv+ ExV416yeMzypJSZ6gmFvmi3cOLHS+R5WfskTmn1s6Na4z+Bh6JTrOQow68v+if+Z2y// vpAA== 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=vR5T9kiBJOuiNv/ad0Ac6pxMIt2jlwazlEJaOlRR0p0=; b=RKia71k7vOgXVaLgdRiBSB2wmA43dVi7dYifQ73CojmEr2HacOguLFGkvIRl0OE3SH jlGjua19Jh0sErivkaZxHocVtPBLBFObVB/03pXkjc5Hb2S+pgLf9Mzknp68LV2mFqgy 44VpWQXp0o10Crf5lvjC33tZSgvfFEZmqet83vqQ5WOM1W7Z126eHOuWSGOMzgQubnXi FfbHlRQfFZujMyciofzn1ZtKVYmxQPJ9z0bidWtPqH9yBBgmSeHxlK7Hs1LMbb/DG7fy 1iuAJvmMGQnqch5FGFCWvnYLSBdylgr/8wzIN+NRjE0RRJ0MedaVuXw2Eax3GOYRX7f0 YvbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=tLTiGehs; 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 a10si7535543oid.84.2020.01.14.03.50.59; Tue, 14 Jan 2020 03:51:10 -0800 (PST) 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=tLTiGehs; 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 S1725956AbgANLtZ (ORCPT + 99 others); Tue, 14 Jan 2020 06:49:25 -0500 Received: from mail-lf1-f53.google.com ([209.85.167.53]:37289 "EHLO mail-lf1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgANLtZ (ORCPT ); Tue, 14 Jan 2020 06:49:25 -0500 Received: by mail-lf1-f53.google.com with SMTP id b15so9580073lfc.4 for ; Tue, 14 Jan 2020 03:49:24 -0800 (PST) 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=vR5T9kiBJOuiNv/ad0Ac6pxMIt2jlwazlEJaOlRR0p0=; b=tLTiGehs3ftJD5DQEKbtUEa3Lrg8J8QyN2oEnTmGyhvsQRGEINrZyUmSuPVw3GJtg5 nGmr5mbAtys0HIupPmKQtROn+TO2jQWBPNwYYf7NRUGZ/QLiY+89FLAFfJrywFoGZkDk eBuOU6zJy6jI+9MJA1YiKQTtgO6rvXVyFEDxlUn5exvXlotGtRMZFKiIKMqOhjyt6UDM sEfaH90NHQJy9hrf0E5osk6655V7VpFfz3rwMB5Qt3AyuLAfuWEDpsaXVAZZUrMN9hdB mAEZTm+loxJJx/FZb92muRZA23TrTldKoogMDtu9i6rZB70Sma6GmXPYlyNINurM+GEx sGCA== 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=vR5T9kiBJOuiNv/ad0Ac6pxMIt2jlwazlEJaOlRR0p0=; b=B/WYfLdkr6F3jlRX8dhE6+i8kzzTrkAA/UCD18z+OIDnSJQB33t/aKFXZtK96QqltU +0xLp8eVIvEs4c1rnIBserUSMzkwkyZH9LCj0q4VVRcOktcmum6ytnwgFlFUE7O0qfLV 9/vHxVK66iFEJXRObyvGh8BMEmCOcMa+AnF/3oHxdtcr3eU4Jsi9hmgcd2xC7sbf0bip a32M2HSNFSkTLCW7CI4hhVi0DbnYJ5AaOOIA40jrGAwW1Efo8J/ClBOjO87HUjv5+jlR p19yYAHcvjKZaGrMjYTHkVJMY5keHYgybitGGMRtVJF0iDYS3ClS81c/TWAUpywmueSE hFJA== X-Gm-Message-State: APjAAAVmkyzQjQwr4p1kaQ2mJdD+FjCq9fv371RtZ4/eY2AexHUz+ixQ r/R5DJL7qIacheFXhc0CZij7MozjKHsvYg== X-Received: by 2002:a19:6a0e:: with SMTP id u14mr1356433lfu.197.1579002563085; Tue, 14 Jan 2020 03:49:23 -0800 (PST) Received: from localhost.localdomain ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id g15sm7349578ljl.10.2020.01.14.03.49.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 03:49:22 -0800 (PST) From: Jakub Witowski To: linux-bluetooth@vger.kernel.org Subject: [PATCH 2/2] mesh: Add sequence nr getter code Date: Tue, 14 Jan 2020 12:49:14 +0100 Message-Id: <20200114114914.25868-2-jakub.witowski@silvair.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200114114914.25868-1-jakub.witowski@silvair.com> References: <20200114114914.25868-1-jakub.witowski@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 --- mesh/node.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mesh/node.c b/mesh/node.c index 3154d6bf4..723869cc0 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -2215,6 +2215,19 @@ static bool ivindex_getter(struct l_dbus *dbus, struct l_dbus_message *msg, return true; } +static bool seq_num_getter(struct l_dbus *dbus, struct l_dbus_message *msg, + struct l_dbus_message_builder *builder, + void *user_data) +{ + struct mesh_node *node = user_data; + struct mesh_net *net = node_get_net(node); + uint32_t seq_nr = mesh_net_get_seq_num(net); + + l_dbus_message_builder_append_basic(builder, 'u', &seq_nr); + + return true; +} + static bool lastheard_getter(struct l_dbus *dbus, struct l_dbus_message *msg, struct l_dbus_message_builder *builder, void *user_data) @@ -2284,6 +2297,8 @@ static void setup_node_interface(struct l_dbus_interface *iface) beaconflags_getter, NULL); l_dbus_interface_property(iface, "IvIndex", 0, "u", ivindex_getter, NULL); + l_dbus_interface_property(iface, "SequenceNumber", 0, "u", + seq_num_getter, NULL); l_dbus_interface_property(iface, "SecondsSinceLastHeard", 0, "u", lastheard_getter, NULL); l_dbus_interface_property(iface, "Addresses", 0, "aq", addresses_getter, -- 2.20.1