All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] Fixed issue in bluetooth-meshd which causes HCI
@ 2020-08-18 16:36 Daan Pape
  2020-08-18 16:36 ` [PATCH BlueZ 1/1] Fixed issue in bluetooth-meshd which causes HCI error 0x12 when LE scanning is enabled because no random address was set. This is fixed by using the default HCI own device address option Daan Pape
  0 siblings, 1 reply; 3+ messages in thread
From: Daan Pape @ 2020-08-18 16:36 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Daan Pape

I had compiled bluez for OpenWRT and was running the bluetooth-meshd
daemon with a Fanstel BT680T module which implement the Bluetooth 5.0
core specification.

The daemon did not properly start and failed with error:

LE Scan enable failed (0x12)

This error is described on page 2496 of the Bluetooth Core Specification
Version 5.2 and is caused by the fact that no random address was
initialized. The issue is resolved by falling back to using the default
HCI advertisement settings which use the public device address in it's
advertisements.

This is the first time that I contribute to Bluez so please forgive me
if I made any styling mistake in the patch format. I also did not include
my details in the 'AUTHORS' file just yet as I first wanted to wait
for your reaction. In case the patch is accepted my name can be added
to the 'AUTHORS' file as:

Daan Pape <daan@dptechnics.com>

Please do not hesitate to ask any further questions if neccesary.

Kind regards,
Daan Pape

Daan Pape (1):
  Fixed issue in bluetooth-meshd which causes HCI error 0x12 when LE
    scanning is enabled because no random address was set. This is fixed
    by using the default HCI own device address option.

 mesh/mesh-io-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH BlueZ 1/1] Fixed issue in bluetooth-meshd which causes HCI error 0x12 when LE scanning is enabled because no random address was set. This is fixed by using the default HCI own device address option.
  2020-08-18 16:36 [PATCH BlueZ 0/1] Fixed issue in bluetooth-meshd which causes HCI Daan Pape
@ 2020-08-18 16:36 ` Daan Pape
  2020-08-19  3:12   ` Gix, Brian
  0 siblings, 1 reply; 3+ messages in thread
From: Daan Pape @ 2020-08-18 16:36 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Daan Pape

---
 mesh/mesh-io-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 67b13a1b9..65fd1c7b9 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -321,7 +321,7 @@ static void scan_disable_rsp(const void *buf, uint8_t size,
 	cmd.type = pvt->active ? 0x01 : 0x00;	/* Passive/Active scanning */
 	cmd.interval = L_CPU_TO_LE16(0x0010);	/* 10 ms */
 	cmd.window = L_CPU_TO_LE16(0x0010);	/* 10 ms */
-	cmd.own_addr_type = 0x01;		/* ADDR_TYPE_RANDOM */
+	cmd.own_addr_type = 0x00; 		/* Public Device Address */
 	cmd.filter_policy = 0x00;		/* Accept all */
 
 	bt_hci_send(pvt->hci, BT_HCI_CMD_LE_SET_SCAN_PARAMETERS,
@@ -579,7 +579,7 @@ static void set_send_adv_params(const void *buf, uint8_t size,
 	cmd.min_interval = L_CPU_TO_LE16(hci_interval);
 	cmd.max_interval = L_CPU_TO_LE16(hci_interval);
 	cmd.type = 0x03; /* ADV_NONCONN_IND */
-	cmd.own_addr_type = 0x01; /* ADDR_TYPE_RANDOM */
+	cmd.own_addr_type = 0x00; /* Public Device Address */
 	cmd.direct_addr_type = 0x00;
 	memset(cmd.direct_addr, 0, 6);
 	cmd.channel_map = 0x07;
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ 1/1] Fixed issue in bluetooth-meshd which causes HCI error 0x12 when LE scanning is enabled because no random address was set. This is fixed by using the default HCI own device address option.
  2020-08-18 16:36 ` [PATCH BlueZ 1/1] Fixed issue in bluetooth-meshd which causes HCI error 0x12 when LE scanning is enabled because no random address was set. This is fixed by using the default HCI own device address option Daan Pape
@ 2020-08-19  3:12   ` Gix, Brian
  0 siblings, 0 replies; 3+ messages in thread
From: Gix, Brian @ 2020-08-19  3:12 UTC (permalink / raw)
  To: daan, linux-bluetooth

Hi Daan,

On Tue, 2020-08-18 at 18:36 +0200, Daan Pape wrote:
> ---
>  mesh/mesh-io-generic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
> index 67b13a1b9..65fd1c7b9 100644
> --- a/mesh/mesh-io-generic.c
> +++ b/mesh/mesh-io-generic.c
> @@ -321,7 +321,7 @@ static void scan_disable_rsp(const void *buf, uint8_t size,
>  	cmd.type = pvt->active ? 0x01 : 0x00;	/* Passive/Active scanning */
>  	cmd.interval = L_CPU_TO_LE16(0x0010);	/* 10 ms */
>  	cmd.window = L_CPU_TO_LE16(0x0010);	/* 10 ms */
> -	cmd.own_addr_type = 0x01;		/* ADDR_TYPE_RANDOM */
> +	cmd.own_addr_type = 0x00; 		/* Public Device Address */
>  	cmd.filter_policy = 0x00;		/* Accept all */
>  

Our policy is to *always* use random addressing for outbound mesh addressing.  So if this is the root cause of
the warning, we will want to fix it in such a way that random addressing works.  This should only be an issue
when starting up, so perhaps we just need to add a random address set into the startup command chain. 

>  	bt_hci_send(pvt->hci, BT_HCI_CMD_LE_SET_SCAN_PARAMETERS,
> @@ -579,7 +579,7 @@ static void set_send_adv_params(const void *buf, uint8_t size,
>  	cmd.min_interval = L_CPU_TO_LE16(hci_interval);
>  	cmd.max_interval = L_CPU_TO_LE16(hci_interval);
>  	cmd.type = 0x03; /* ADV_NONCONN_IND */
> -	cmd.own_addr_type = 0x01; /* ADDR_TYPE_RANDOM */
> +	cmd.own_addr_type = 0x00; /* Public Device Address */
>  	cmd.direct_addr_type = 0x00;
>  	memset(cmd.direct_addr, 0, 6);
>  	cmd.channel_map = 0x07;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-19  3:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 16:36 [PATCH BlueZ 0/1] Fixed issue in bluetooth-meshd which causes HCI Daan Pape
2020-08-18 16:36 ` [PATCH BlueZ 1/1] Fixed issue in bluetooth-meshd which causes HCI error 0x12 when LE scanning is enabled because no random address was set. This is fixed by using the default HCI own device address option Daan Pape
2020-08-19  3:12   ` Gix, Brian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.