Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

BLE set custom Packet Header.

Hello, industry. Two questions for you:

1. To test fault-tolerance of our BLE scanning device we need to generate and advertise from another BLE device custom faulty (!) BLE packets.

As we understand, 
BLE data format = Preamble (1 byte) + Access address (4 bytes) + [Packet Payload] (2-39 bytes) + CRC (3 bytes).
Packet Payload = Header (2 bytes) + [Payload] (0-37 bytes).
Payload = AdvA (6 bytes) + AdvData (0-31 bytes)

SoftDevice API allows us to modify only Broadcast Data (AdvData = 31 byte), which does not break what we need.

So we are looking for a way how to modify with custom data all of the mentioned data structures:

Preamble (1 byte)
Access address (4 bytes)
PDU Type (2 bytes)
MAC address (6 bytes)

2. What part in BLE data format (if any) defines the total overall packet length to be accepted by BLE scan device?

Related