Maximum length of manufacturer specific data

Hello,

I am using a nrf5340 together with nrf Connect SDK v2.4.2. 

I use extended advertising to be able to send manufacturer specific data.

For now I am able to send 184 bytes of data including my company id.

According to Bluetooth specification it is possible to send more manufacturer specific data in one advertising packet. It should be 252 bytes: (How many bytes can you include in a BLE advertising packet? | Novel Bits)

In my application the data of the advertising packet also includes the device name which is 30 bytes long and the 128-Bit UUID. 

So I calculated the size of the extended advertising packet as follows:

# Access Address: 4 bytes
# Packet Header:  2 bytes
# Extended Advertising Header: 10 bytes
# Advertising Data:
#   Flags: 3 bytes
#   128 Bit UUID: 18 bytes
#   Manufacturer Specific: 254 bytes(252 bytes data inkl. 2 bytes Company ID)
#   Device Name: 30 bytes
# Sum: 321 bytes

In prj.conf I set CONFIG_BT_EXT_ADV to yes and CONFIG_BT_DEVICE_NAME_MAX to 30 bytes.

In hci_rpmsg.conf I set CONFIG_BT_EXT_ADV to yes and CONFIG_BT_CTLR_ADV_DATA_LEN_MAX to 400 bytes which should be big enough.
Here is a screenshot from Wireshark with 184 bytes manufacturer specific data:

It seems the size is limited to CONFIG_BT_CTLR_DATA_LENGTH_MAX which I can set maximum to 251 bytes ?!

What must I change / add to to use 252 bytes of manufacturer specific data?

Regards

Jan

Parents Reply Children
  • I checked it again:

    • did a pristine build in VS Code 
    • I used Erase and Flash and after that Debug.
    • (Also Debugging with Ozone showed the same error.)

    After that I had a deeper look in the prj.conf-File:

    CONFIG_BT_CTLR_ADV_EXT=y and CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=1650 were marked with a warning.

    I removed CONFIG_BT_CTLR_ADV_EXT=y and copied CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=1650 to the child image config file hci_rpmsg.conf

    I had to change the file name hci_rpmsg.conf to hci_ipc.conf.

    After that the example worked as intended and helped me to answer my question.

    Regards

    Jan

Related