This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Nrf beacon example packet size

Can we increase the packet size in Nrf52 Beacon example ? I want to send UUID=16 Bytes + Major=4 Bytes, Minor= 4 Bytes + RSSI= 1 Byte i.e Total =25 Bytes. I am using SDK13.

Parents Reply Children
  • Hello again,

    Manoj Hiwarkar said:
    Here the first five bytes 0201041AFF are occupying my space.

    This is the significance of the bytes in question:
    - 0x02 0x01 0x04 = length: 2, type: FLAG, content:  BR/EDR(Classic Bluetooth is not supported)
    - 0x1A 0xFF = length: 26, type: MANUFACTURER SPECIFIC

    If you intend to comply with the BLE specifications, none of these bytes can be removed.
    If you would like to pursue a proprietary radio protocol please let me know.

    You may remove the flags from your advertising data by commenting out the line 184 in the Beacon example, where it is added to the advertising data:

    advdata.flags                 = flags;


    Have a look in Core Specification Supplement (CSS) v7: "The Flags data type shall be included when any of the Flag bits are non-zero". Since our Softdevice only supports Bluetooth LE the "BR/EDR not supported"-bit must always be set and hence, the Flags data type must be included.

    You are free to remove the flags yourself - you may do whatever you want with your application - but you will not be complying to the BLE specification by removing this flag.
    Furthermore, I suspect this will cause troubles when communicating with devices using both BLE and classic Bluetooth- such as SmartPhones.
    But once again, you are free to do this yourself.

    I ask again, is there a particular reason why you need the major and minor to be 4 bytes?
    If you are struggling fitting all your data into your advertising data, you might want to look into using scan responses to provide the excess data.

    Best regards,
    Karl

Related