linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Gix <brian.gix@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: inga.stotland@intel.com, michal.lowas-rzechonek@silvair.com,
	brian.gix@intel.com
Subject: [PATCH BlueZ 3/8] mesh: Add special Beacon handler for Provisioning
Date: Wed, 10 Jul 2019 16:07:52 -0700	[thread overview]
Message-ID: <20190710230757.8425-4-brian.gix@intel.com> (raw)
In-Reply-To: <20190710230757.8425-1-brian.gix@intel.com>

Provisioning uses the same AD type for Provisioning that
is also used by the Secure Network Beacon, but their
usage is distinct from each other.  This change allows
us to enable/disable Unprovisioned Device Beacon capture
without disrupting SNB handling.
---
 mesh/mesh-io-generic.c | 2 +-
 mesh/mesh-io.c         | 6 ++++--
 mesh/mesh-io.h         | 7 ++++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 42aaa0947..576c5df1b 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -40,7 +40,7 @@ struct mesh_io_private {
 	struct l_timeout *tx_timeout;
 	struct l_queue *rx_regs;
 	struct l_queue *tx_pkts;
-	uint8_t filters[3]; /* Simple filtering on AD type only */
+	uint8_t filters[4];
 	bool sending;
 	struct tx_pkt *tx;
 	uint16_t interval;
diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c
index 62a8c0e2c..94a92e885 100644
--- a/mesh/mesh-io.c
+++ b/mesh/mesh-io.c
@@ -86,12 +86,14 @@ struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts)
 
 	if (api->set) {
 		uint8_t pkt = MESH_AD_TYPE_NETWORK;
-		uint8_t bec = MESH_AD_TYPE_BEACON;
 		uint8_t prv = MESH_AD_TYPE_PROVISION;
+		uint8_t snb[2] = {MESH_AD_TYPE_BEACON, 0x01};
+		uint8_t prvb[2] = {MESH_AD_TYPE_BEACON, 0x00};
 
-		api->set(io, 1, &bec, 1, NULL, NULL);
+		api->set(io, 1, snb, sizeof(snb), NULL, NULL);
 		api->set(io, 2, &prv, 1, NULL, NULL);
 		api->set(io, 3, &pkt, 1, NULL, NULL);
+		api->set(io, 4, prvb, sizeof(prvb), NULL, NULL);
 	}
 
 	if (l_queue_push_head(io_list, io))
diff --git a/mesh/mesh-io.h b/mesh/mesh-io.h
index 6585205c7..1c10779aa 100644
--- a/mesh/mesh-io.h
+++ b/mesh/mesh-io.h
@@ -19,9 +19,10 @@
 
 struct mesh_io;
 
-#define MESH_IO_FILTER_BEACON	1
-#define MESH_IO_FILTER_PROV	2
-#define MESH_IO_FILTER_NET	3
+#define MESH_IO_FILTER_BEACON		1
+#define MESH_IO_FILTER_PROV		2
+#define MESH_IO_FILTER_NET		3
+#define MESH_IO_FILTER_PROV_BEACON	4
 
 #define MESH_IO_TX_COUNT_UNLIMITED	0
 
-- 
2.14.5


  parent reply	other threads:[~2019-07-10 23:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 23:07 [PATCH BlueZ 0/8] mesh: Provisioner Initiator added Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 1/8] doc: Cleanup API Provisioner1 interface Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 2/8] mesh: Fix support for Provisioner Initiator Brian Gix
2019-07-11  7:10   ` Michał Lowas-Rzechonek
2019-07-10 23:07 ` Brian Gix [this message]
2019-07-10 23:07 ` [PATCH BlueZ 4/8] mesh: Expose mapping function for D-Bus errors Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 5/8] mesh: Expose resources needed by Management1 interface Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 6/8] mesh: Fix implementation of Provisioner Initiator Brian Gix
2019-07-11  7:33   ` Michał Lowas-Rzechonek
2019-07-11 15:48     ` Gix, Brian
2019-07-10 23:07 ` [PATCH BlueZ 7/8] mesh: Implement DBus Provisioning methods Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 8/8] test: This extends the mesh tool to exercise " Brian Gix

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=20190710230757.8425-4-brian.gix@intel.com \
    --to=brian.gix@intel.com \
    --cc=inga.stotland@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=michal.lowas-rzechonek@silvair.com \
    /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).