From: Jakub Witowski <jakub.witowski@silvair.com>
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 [thread overview]
Message-ID: <20200114114914.25868-2-jakub.witowski@silvair.com> (raw)
In-Reply-To: <20200114114914.25868-1-jakub.witowski@silvair.com>
---
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
next prev parent reply other threads:[~2020-01-14 11:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 11:49 [PATCH 1/2] mesh: Add sequence nr getter to the doc Jakub Witowski
2020-01-14 11:49 ` Jakub Witowski [this message]
2020-01-14 14:50 ` Gix, Brian
2020-01-14 15:40 ` Michał Lowas-Rzechonek
2020-01-14 16:39 ` Gix, Brian
2020-01-14 16:53 ` michal.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=20200114114914.25868-2-jakub.witowski@silvair.com \
--to=jakub.witowski@silvair.com \
--cc=linux-bluetooth@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).