Date   

Re: zephyr question

Carles Cufi
 

Hi there,

 

I just tried this but instead of using menuconfig I changed my prj.conf like this:

 

diff --git a/samples/bluetooth/peripheral_hr/prj.conf b/samples/bluetooth/peripheral_hr/prj.conf

index 08ebfd7e4..77e989c84 100644

--- a/samples/bluetooth/peripheral_hr/prj.conf

+++ b/samples/bluetooth/peripheral_hr/prj.conf

@@ -4,3 +4,6 @@ CONFIG_BT_SMP=y

CONFIG_BT_PERIPHERAL=y

CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor"

CONFIG_BT_DEVICE_APPEARANCE=833

+

+CONFIG_SERIAL=n

+CONFIG_UART_CONSOLE=n

 

 

With this I ran samples/bluetooth/peripheral_hr 5 times on a PCA10040 and tested it (connecting with an iPhone running LightBlue) and had no issues at all.

 

Which Zephyr version are you using? I tried the latest master.

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of Hsu, Hanyu
Sent: 26 June 2018 16:29
To: zephyr-devel@...
Cc: Dunk Chen <dunk.chen@...>; Bochang Lian (
連柏蒼) (bochang_lian@...) <bochang_lian@...>
Subject: [Zephyr-devel] zephyr question

 

Hi Sir,

 

We occurred some question when we use zephyr in nRF52832.

 

We found there were some chips cannot boot-up w/ Zephyr sample code (disable UART), but can boot up well w/ Nordic original sample code (ble_app_hrs).

But if we enabled the UART function of Zephyr sample code, the failure chip can boot up well.

 

Below is our test environment and procedure.

 

  1. We use zephyr sample 'peripheral_hr'  to test and the result as below.

For attached file,

- peripheral_hr_uart: The board configuration of PCA10040 in Zephy.

- peripheral_hr_no_uart: The board configuration of Nordic PCA1004. Disable UART through “menuconfig”

 

  1. For the block in red, we dump the debug information of back trace through J-link.

 

  1.  Test procedure of Zephyr:
  1. Download and install zephyr SDK and zephyr ( http://docs.zephyrproject.org/1.8.0/getting_started/getting_started.html)
  1. Enter samples/bluetooth/peripheral_hr
  1. Create the firmware of peripheral_hr: make BOARD=nrf52_pca10040 -> It’s the firmware of “peripheral_hr_uart” (w/ UART).
  1. Create the firmware of “peripheral_hr” that remove UART: procedure as below.

          1) make BOARD=nrf52_pca10040  menuconfig

2) Disable ‘Console drivers', 'Serial Drivers': Enter path “Device Drivers

          3) make BOARD=nrf52_pca10040 -> for the firmware of “peripheral_hr_no_uart

 

NO

序號

peripheral_hr_uart

peripheral_hr no uart

2

91000195760281

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x96cdd3c2 in ?? () 

#5 0x9ef66fc2 in ?? () 

6

91000195760221

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x000090b2 in mayfly_run (callee_id=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/util/mayfly.c:138 

#5 0x00010e92 in _isr_wrapper () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\isr_wrapper.S:126 

#6 <signal handler called> 

#7 0x36bf0d32 in ?? () 

#8 0x5447ef66 in ?? () 

17

91000195760393

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x000090b2 in mayfly_run (callee_id=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/util/mayfly.c:138 

#5 0x00010e92 in _isr_wrapper () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\isr_wrapper.S:126 

#6 <signal handler called> 

#7 0xff324b36 in ?? () 

#8 0xaf7e65d2 in ?? () 

23

91000195760180

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x4ee6f87e in ?? () 

#5 0x0000a2f4 in ticker_job_list_insert (insert_head=<optimized out>, 

instance=0x200012b0 <_instance>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/ticker/ticker.c:831 

#6 ticker_job (instance=0x200012b0 <_instance>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/ticker/ticker.c:1135 

#7 0x000090ba in mayfly_run (callee_id=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/util/mayfly.c:141 

#8 0x00010e92 in _isr_wrapper () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\isr_wrapper.S:126 

#9 <signal handler called> 

#10 0xe9c5b7ba in ?? () 

#11 0x78fe918e in ?? () 

 


Re: advertising data

Johan Hedberg
 

Hi Tamra,

The format of the data (behind ad->data with length ad->len) is
specified in the Bluetooth Core Specification (5.0) Volume 3, Part C,
section 11 (page 2086 in the pdf). In practice it's just a sequence of
<1 byte length><1 byte type><N byte payload> elements, and you can use
the recently added bt_data_parse() API to help parse these.

You'll find defines for the various data types in
include/bluetooth/hci.h with the prefix BT_DATA_*. The actual formats
and meanings of the different types are defined in the Core
Specification Supplement document. Both the Core Specification and the
Supplement can be found here:

https://www.bluetooth.com/specifications/bluetooth-core-specification

Johan

On Tue, Jun 26, 2018, Tamra Oyama wrote:
Hi all,

Thanks for the help. From what I can tell "*ad*" from "*struct
net_buf_simple *ad*" is the payload, and so I'm wondering what format is
the payload in. (i.e if i convert it to binary where in the Bluetooth spec
can I find what these values mean?

Thanks,
Tamra


On Tue, Jun 26, 2018 at 6:37 AM, Johan Hedberg <johan.hedberg@...>
wrote:

Hi,

On Tue, Jun 26, 2018, Luiz Augusto von Dentz wrote:
On Tue, Jun 26, 2018 at 3:55 AM, Tamra <tamrako@...> wrote:
I'm looking at the central_hr example. I was wondering what
information is
packed into the net_buf_simple *ad? The function and output is below.

static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t
type,
struct net_buf_simple *ad)

[DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31,
RSSI
-83 data: 2818606536
The type you will be able to find in the assigned number for GAP:

https://www.bluetooth.com/specifications/assigned-
numbers/generic-access-profile

AD payload format for each type is described in the CSS, for instance
type 3 is <<Complete List of 16-bit Service UUIDs>> which consists in
a list of 16-bit Service UUIDs.
Actually the event type is no the AD type, sorry about that, so 0x03
refers to BT_LE_ADV_NONCONN_IND.
I'd like to add here that we've just merged a new helper API for parsing
the advertising data:

https://github.com/zephyrproject-rtos/zephyr/pull/8560

This pull request also included updating the central_hr sample, so you
might want to take a second look at that code.

Johan


Re: advertising data

Zou, Jun Qing
 

You might also want to try Nordic’s “nRF Connect” on Android.

It could show you all the details of hex received in advertising and scan response packet, in raw and parsed mode.

 

BR, zou

 

From: devel@... [mailto:devel@...] On Behalf Of Tamra
Sent: Wednesday, June 27, 2018 10:01 AM
To: Johan Hedberg <johan.hedberg@...>
Cc: Luiz Augusto von Dentz <luiz.dentz@...>; Zephyr Devel <devel@...>
Subject: Re: [Zephyr-devel] advertising data

 

Hi all,

 

Thanks for the help. From what I can tell "ad" from  "struct net_buf_simple *ad" is the payload, and so I'm wondering what format is the payload in. (i.e if i convert it to binary where in the Bluetooth spec can I find what these values mean?

 

Thanks,

Tamra

 

 

On Tue, Jun 26, 2018 at 6:37 AM, Johan Hedberg <johan.hedberg@...> wrote:

Hi,

On Tue, Jun 26, 2018, Luiz Augusto von Dentz wrote:
> > On Tue, Jun 26, 2018 at 3:55 AM, Tamra <tamrako@...> wrote:
> >> I'm looking at the central_hr example. I was wondering what information is
> >> packed into the net_buf_simple *ad? The function and output is below.
> >>
> >> static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type,
> >>              struct net_buf_simple *ad)
> >>
> >> [DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31, RSSI
> >> -83 data: 2818606536
> >
> > The type you will be able to find in the assigned number for GAP:
> >
> > https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
> >
> > AD payload format for each type is described in the CSS, for instance
> > type 3 is <<Complete List of 16-bit Service UUIDs>> which consists in
> > a list of 16-bit Service UUIDs.
>
> Actually the event type is no the AD type, sorry about that, so 0x03
> refers to BT_LE_ADV_NONCONN_IND.

I'd like to add here that we've just merged a new helper API for parsing
the advertising data:

        https://github.com/zephyrproject-rtos/zephyr/pull/8560

This pull request also included updating the central_hr sample, so you
might want to take a second look at that code.

Johan

 


Re: advertising data

Tamra <tamrako@...>
 

Hi all,

Thanks for the help. From what I can tell "ad" from  "struct net_buf_simple *ad" is the payload, and so I'm wondering what format is the payload in. (i.e if i convert it to binary where in the Bluetooth spec can I find what these values mean?

Thanks,
Tamra


On Tue, Jun 26, 2018 at 6:37 AM, Johan Hedberg <johan.hedberg@...> wrote:
Hi,

On Tue, Jun 26, 2018, Luiz Augusto von Dentz wrote:
> > On Tue, Jun 26, 2018 at 3:55 AM, Tamra <tamrako@...> wrote:
> >> I'm looking at the central_hr example. I was wondering what information is
> >> packed into the net_buf_simple *ad? The function and output is below.
> >>
> >> static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type,
> >>              struct net_buf_simple *ad)
> >>
> >> [DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31, RSSI
> >> -83 data: 2818606536
> >
> > The type you will be able to find in the assigned number for GAP:
> >
> > https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
> >
> > AD payload format for each type is described in the CSS, for instance
> > type 3 is <<Complete List of 16-bit Service UUIDs>> which consists in
> > a list of 16-bit Service UUIDs.
>
> Actually the event type is no the AD type, sorry about that, so 0x03
> refers to BT_LE_ADV_NONCONN_IND.

I'd like to add here that we've just merged a new helper API for parsing
the advertising data:

        https://github.com/zephyrproject-rtos/zephyr/pull/8560

This pull request also included updating the central_hr sample, so you
might want to take a second look at that code.

Johan


zephyr question

Hsu, Hanyu <Hanyu.Hsu@...>
 

Hi Sir,

 

We occurred some question when we use zephyr in nRF52832.

 

We found there were some chips cannot boot-up w/ Zephyr sample code (disable UART), but can boot up well w/ Nordic original sample code (ble_app_hrs).

But if we enabled the UART function of Zephyr sample code, the failure chip can boot up well.

 

Below is our test environment and procedure.

 

1.    We use zephyr sample 'peripheral_hr'  to test and the result as below.

For attached file,

- peripheral_hr_uart: The board configuration of PCA10040 in Zephy.

- peripheral_hr_no_uart: The board configuration of Nordic PCA1004. Disable UART through “menuconfig”

 

2.    For the block in red, we dump the debug information of back trace through J-link.

 

3.     Test procedure of Zephyr:

a.      Download and install zephyr SDK and zephyr ( http://docs.zephyrproject.org/1.8.0/getting_started/getting_started.html)

b.      Enter samples/bluetooth/peripheral_hr

c.       Create the firmware of peripheral_hr: make BOARD=nrf52_pca10040 -> It’s the firmware of “peripheral_hr_uart” (w/ UART).

d.      Create the firmware of “peripheral_hr” that remove UART: procedure as below.

          1) make BOARD=nrf52_pca10040  menuconfig

2) Disable ‘Console drivers', 'Serial Drivers': Enter path “Device Drivers

          3) make BOARD=nrf52_pca10040 -> for the firmware of “peripheral_hr_no_uart

 

NO

序號

peripheral_hr_uart

peripheral_hr no uart

2

91000195760281

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x96cdd3c2 in ?? () 

#5 0x9ef66fc2 in ?? () 

6

91000195760221

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x000090b2 in mayfly_run (callee_id=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/util/mayfly.c:138 

#5 0x00010e92 in _isr_wrapper () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\isr_wrapper.S:126 

#6 <signal handler called> 

#7 0x36bf0d32 in ?? () 

#8 0x5447ef66 in ?? () 

17

91000195760393

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x000090b2 in mayfly_run (callee_id=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/util/mayfly.c:138 

#5 0x00010e92 in _isr_wrapper () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\isr_wrapper.S:126 

#6 <signal handler called> 

#7 0xff324b36 in ?? () 

#8 0xaf7e65d2 in ?? () 

23

91000195760180

pass in test 5 times

#0 k_cpu_idle () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\cpu_idle.S:135 

#1 0x00010de8 in _SysFatalErrorHandler (reason=<optimized out>, 

pEsf=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core/sys_fatal_error_handler.c:70 

#2 0x00010d52 in __usage_fault () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\fault_s.S:108 

#3 <signal handler called> 

#4 0x4ee6f87e in ?? () 

#5 0x0000a2f4 in ticker_job_list_insert (insert_head=<optimized out>, 

instance=0x200012b0 <_instance>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/ticker/ticker.c:831 

#6 ticker_job (instance=0x200012b0 <_instance>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/ticker/ticker.c:1135 

#7 0x000090ba in mayfly_run (callee_id=<optimized out>) 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/subsys/bluetooth/controller/util/mayfly.c:141 

#8 0x00010e92 in _isr_wrapper () 

at D:/msys64/home/fresh.lee/smart_button_debug/zephyr-zephyr-v1.8.0/arch/arm/core\isr_wrapper.S:126 

#9 <signal handler called> 

#10 0xe9c5b7ba in ?? () 

#11 0x78fe918e in ?? () 

 


Release readiness meeting cancelled

Carles Cufi
 

Hi all,

We have had to cancel the Release Readiness meeting today due to technical issues with the conferencing system.

Apologies for the late notice.

Regards,

Carles


Re: advertising data

Johan Hedberg
 

Hi,

On Tue, Jun 26, 2018, Luiz Augusto von Dentz wrote:
On Tue, Jun 26, 2018 at 3:55 AM, Tamra <tamrako@...> wrote:
I'm looking at the central_hr example. I was wondering what information is
packed into the net_buf_simple *ad? The function and output is below.

static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type,
struct net_buf_simple *ad)

[DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31, RSSI
-83 data: 2818606536
The type you will be able to find in the assigned number for GAP:

https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile

AD payload format for each type is described in the CSS, for instance
type 3 is <<Complete List of 16-bit Service UUIDs>> which consists in
a list of 16-bit Service UUIDs.
Actually the event type is no the AD type, sorry about that, so 0x03
refers to BT_LE_ADV_NONCONN_IND.
I'd like to add here that we've just merged a new helper API for parsing
the advertising data:

https://github.com/zephyrproject-rtos/zephyr/pull/8560

This pull request also included updating the central_hr sample, so you
might want to take a second look at that code.

Johan


Re: ticker timer #nrf52840 #ble #nrf52832

Carles Cufi
 

Hi there,

 

I copied Vinayak who is the original author of the ticker.

There is no real material available publicly at this point.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of swapnil
Sent: 26 June 2018 13:12
To: devel@...
Subject: [Zephyr-devel] ticker timer #ble #nrf52832 #nrf52840

 

Hello, I am trying to understand ticker timer. and have confusion between user id's, what is the difference between RADIO_TICKER_USER_ID_WORKER  and RADIO_TICKER_USER_ID_APP?
is there any material available to understand the ticker timer? 
Thank you in advance


ticker timer #nrf52840 #ble #nrf52832

swapnil <swapnil2007kadam@...>
 

Hello, I am trying to understand ticker timer. and have confusion between user id's, what is the difference between RADIO_TICKER_USER_ID_WORKER  and RADIO_TICKER_USER_ID_APP?
is there any material available to understand the ticker timer? 
Thank you in advance


Re: advertising data

Luiz Augusto von Dentz
 

Hi Tamra,

On Tue, Jun 26, 2018 at 11:35 AM, Luiz Augusto von Dentz
<luiz.dentz@...> wrote:
Hi Tamra,

On Tue, Jun 26, 2018 at 3:55 AM, Tamra <tamrako@...> wrote:
Hi all,

I'm looking at the central_hr example. I was wondering what information is
packed into the net_buf_simple *ad? The function and output is below.

static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type,
struct net_buf_simple *ad)

[DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31, RSSI
-83 data: 2818606536
The type you will be able to find in the assigned number for GAP:

https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile

AD payload format for each type is described in the CSS, for instance
type 3 is <<Complete List of 16-bit Service UUIDs>> which consists in
a list of 16-bit Service UUIDs.
Actually the event type is no the AD type, sorry about that, so 0x03
refers to BT_LE_ADV_NONCONN_IND.

Thank you,
Tamra


--
Luiz Augusto von Dentz




--
Luiz Augusto von Dentz


Re: advertising data

Luiz Augusto von Dentz
 

Hi Tamra,

On Tue, Jun 26, 2018 at 3:55 AM, Tamra <tamrako@...> wrote:
Hi all,

I'm looking at the central_hr example. I was wondering what information is
packed into the net_buf_simple *ad? The function and output is below.

static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type,
struct net_buf_simple *ad)

[DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31, RSSI
-83 data: 2818606536
The type you will be able to find in the assigned number for GAP:

https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile

AD payload format for each type is described in the CSS, for instance
type 3 is <<Complete List of 16-bit Service UUIDs>> which consists in
a list of 16-bit Service UUIDs.

Thank you,
Tamra


--
Luiz Augusto von Dentz


advertising data

Tamra <tamrako@...>
 

Hi all,

I'm looking at the central_hr example. I was wondering what information is packed into the net_buf_simple *ad? The function and output is below.

static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type,
             struct net_buf_simple *ad)

[DEVICE]: 34:3c:99:ab:65:6d (random), AD evt type 3, AD data len 31, RSSI -83 data: 2818606536

Thank you,
Tamra


Re: Json descripte

Leandro Pereira
 

Christian,

On 06/25/2018 11:13 AM, christian tavares wrote:
Hello! I have a json and I would like to descript it, but the problem that json is a array objects of array objects. I was seeing the include/json.h and I can't find the way to describe that json.
The JSON parser is quite unorthodox, so it can be quite tricky to declare the descriptor. However, it's quite efficient, type-safe, and can also be used to generate JSON, so once you get the hang of it. you'll see it's not that hard to use, all things considered.

The first step is identifying how to lay the structs down. It's maybe a good idea to start with the innermost struct; please disregard the names, I don't have a lot of context to come up with better ones:

struct product {
const char *test;
const char *mode;
};

Then you can create an struct containing these structs. Since you're going to have an array, you also need a size_t item to hold the number of elements in that array; you'll see it referenced down below when the descriptors are being declared:

#define PRODUCT_LIST_MAX_ITEMS 32
struct product_list {
struct product products[PRODUCT_LIST_MAX_ITEMS];
size_t products_len;
};

And another one, containing the manifest of product lists:

struct manifest {
struct product_list items[PRODUCT_LIST_MAX_ITEMS];
size_t items_len;
};

(In this case, you'll have space for 1024 (32 * 32) items, which might be a *lot* to allocate, in say, the stack of your typical thread in Zephyr; please adjust as required, maybe using different constants for different structs... I would need more context to come up with better sizes.)

Once you have all this, you can start working by defining the descriptors. I usually start with the simplest structs (the ones without nested objects, such as other objects, or arrays):

static const struct json_obj_descr product_desc[] = {
JSON_OBJ_DESCR_PRIM(struct product,
test, JSON_TOK_STRING),
JSON_OBJ_DESCR_PRIM(struct product,
mode, JSON_TOK_STRING),
};

(I don't know much how the JSON you're working with is generated, but if you have the choice of using stronger types -- instead of strings --
please do it. The parser will refuse to parse values that have types different than the ones declared in the descriptors.)

Then define the descriptor for the product_list struct:

static const struct json_obj_descr product_list_desc[] = {
JSON_OBJ_DESCR_ARRAY(struct product_list,
products,
PRODUCT_LIST_MAX_ITEMS,
products_len,
product_desc,
ARRAY_SIZE(product_desc)),
};

Then define the descriptor for the manifest struct:

static const struct json_obj_descr manifest_desc[] = {
JSON_OBJ_DESCR_ARRAY(struct manifest,
items,
PRODUCT_LIST_MAX_ITEMS,
items_len,
product_list_desc,
ARRAY_SIZE(product_list_desc)),
};

Then you can just use json_obj_parse() by pointing it to manifest_desc as the descriptor array, and a pointer to a struct manifest allocated somewhere.

Also note that I wrote this directly while composing the message; I haven't compiled this. So there might be some mismatched parenthesis or missing punctuation somewhere.

Hope this helps,
Leandro


Json descripte

christian tavares
 

Hello! I have a json and I would like to descript it, but the problem that json is a array objects of array objects. I was seeing the include/json.h and I can't find the way to describe that json. 

The format is : 

{
"product":[
[
{
"test":"1",
"mode":"test",
}
],
[
{
"test":"2",
"mode":"test",
}
]
]
}

Someone could help me ?


Re: Pairing method table

Szymon Janc
 

Hi,

On Thursday, 21 June 2018 10:57:24 CEST Zou, Jun Qing wrote:
Hi,

In
https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/h
ost/conn.c

L96: #endif /* CONFIG_BT_BREDR */

Should this line be at line 80 instead (table 5.7 applies to BLE as well)?
This is for Secure Simple Pairing (SSP) which is used only on BR/EDR.
BLE pairing is done in host via Security Manager (SMP) and you can find
equivalent tables in subsys/bluetooth/host/smp.c

--
pozdrawiam
Szymon Janc


Pairing method table

Zou, Jun Qing
 

Hi,

 

In https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/host/conn.c

 

L96: #endif /* CONFIG_BT_BREDR */

 

Should this line be at line 80 instead (table 5.7 applies to BLE as well)?

 

---

JUN QING ZOU  Software Engineer, Sales

Nordic Semiconductor | +81 (0)90 3965 3909

 


Re: Bluetooth services/features

Theis Orthmann Blickfeldt Jørgensen (TTJO)
 

You should use int bt_gatt_discover(struct bt_conn *conn, struct bt_gatt_discover_params *params); found in gatt.h. Also you should register a CB-function of type typedef u8_t (*bt_gatt_discover_func_t)(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct bt_gatt_discover_params *params); - also found in gatt.h.
You will get a CB for each discovered service/charateristic (Depending on what you give as discovery-param).

In general look at gatt.h line #777 - #908.

 

 

Venlig hilsen/kind regards

Theis Orthmann Blickfeldt Jørgensen

Embedded Software Developer, M.Sc.EE.

 

Oticon A/S

Kongebakken 9

DK-2765 Smørum

 

ttjo@...

www.oticon.com

 


Re: Bluetooth services/features

Carles Cufi
 

Hi Tamra,

 

Are you looking to use classical Bluetooth or Bluetooth Low Energy? SDP is a classical Bluetooth protocol.

 

Carles

 

From: <devel@...> on behalf of Tamra <tamrako@...>
Date: Thursday, 21 June 2018 at 03:14
To: "zephyr-devel@..." <zephyr-devel@...>
Subject: [Zephyr-devel] Bluetooth services/features

 

Hi Zephyr Team,

 

I'm trying to find out what services bluetooth devices have just by scanning without making a connection with the device, similarly to the scan_cb function and print these services/features. Is there a function that does this? I've looked at the bt_sdp_get_features function but got stuck when I couldn't find where the struct, bt_sdp_client_result was defined.

 

Any help or advice would be greatly appreciated!

 

Thank you,

Tamra


Re: Bluetooth services/features

Luiz Augusto von Dentz
 

Hi Tamra,

Have a look at 'bt' shell module gatt-discovery* command:

https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/shell/gatt.c#L148

On Thu, Jun 21, 2018 at 10:20 AM, Tamra <tamrako@...> wrote:
Thanks Carles. I’ll look into that now.

On Wed, Jun 20, 2018 at 9:19 PM Cufi, Carles <Carles.Cufi@...>
wrote:

GATT is the profile and ATT the protocol. That’s what you use in BLE to
discover services and interact with values.



Carles



From: Tamra Oyama <tamrako@...>
Sent: 21 June 2018 09:00
To: Cufi, Carles <carles.cufi@...>;
zephyr-devel@...
Subject: Re: [Zephyr-devel] Bluetooth services/features



Low energy. What would be that function/protocol?



On Wed, Jun 20, 2018 at 8:59 PM Cufi, Carles <Carles.Cufi@...>
wrote:

Hi Tamra,



Are you looking to use classical Bluetooth or Bluetooth Low Energy? SDP is
a classical Bluetooth protocol.



Carles



From: <devel@...> on behalf of Tamra
<tamrako@...>
Date: Thursday, 21 June 2018 at 03:14
To: "zephyr-devel@..."
<zephyr-devel@...>
Subject: [Zephyr-devel] Bluetooth services/features



Hi Zephyr Team,



I'm trying to find out what services bluetooth devices have just by
scanning without making a connection with the device, similarly to the
scan_cb function and print these services/features. Is there a function that
does this? I've looked at the bt_sdp_get_features function but got stuck
when I couldn't find where the struct, bt_sdp_client_result was defined.



Any help or advice would be greatly appreciated!



Thank you,

Tamra
--
Luiz Augusto von Dentz


Re: Bluetooth services/features

Tamra <tamrako@...>
 

Low energy. What would be that function/protocol?


On Wed, Jun 20, 2018 at 8:59 PM Cufi, Carles <Carles.Cufi@...> wrote:

Hi Tamra,

 

Are you looking to use classical Bluetooth or Bluetooth Low Energy? SDP is a classical Bluetooth protocol.

 

Carles

 

From: <devel@...> on behalf of Tamra <tamrako@...>
Date: Thursday, 21 June 2018 at 03:14
To: "zephyr-devel@..." <zephyr-devel@...>
Subject: [Zephyr-devel] Bluetooth services/features

 

Hi Zephyr Team,

 

I'm trying to find out what services bluetooth devices have just by scanning without making a connection with the device, similarly to the scan_cb function and print these services/features. Is there a function that does this? I've looked at the bt_sdp_get_features function but got stuck when I couldn't find where the struct, bt_sdp_client_result was defined.

 

Any help or advice would be greatly appreciated!

 

Thank you,

Tamra

3881 - 3900 of 8692