Detailed explanation of several types of BLE broadcast packets

Bluetooth broadcast type

Insert picture description here

Connectable non-directed broadcast (ADV_IND)

This is the most widely used and most common type of broadcast, including broadcast data and scan response data . It indicates that the current device can accept connection requests from any device. The device performing general broadcast can be scanned by the scanning device, or enter a connection as a slave device when receiving a connection request. General broadcast can be sent out without connection, in other words, there is no distinction between master and slave devices.

Connectable directed broadcast (ADV_DIRECT_IND)

The directional broadcast type is to connect as quickly as possible, commonly known as the connection back packet , this kind of message contains two addresses: the address of the broadcaster and the address of the initiator. After the initiator receives the directed broadcast message sent to itself, it can immediately send a connection request as a response.
The directional broadcast type has special timing requirements. The complete broadcast time must be repeated every 3.75ms. This requirement makes the scanning device only need to scan 3.75ms to receive the message of the directed broadcast device.
Of course, such fast transmission will flood the broadcast channel with packets, which will cause other devices in the area to be unable to broadcast. Therefore, directional broadcast cannot last longer than 1.28s. If the host does not actively request to stop, or the connection is not established, the controller will automatically stop broadcasting. Once it reaches 1.28s, the host can only use connectable non-directional broadcasts with much longer intervals to allow other devices to connect.
When using directed broadcast, the device cannot be actively scanned. In addition, the payload of the directional broadcast message cannot carry other additional data. The payload can only contain two necessary addresses.

Unconnectable non-directed broadcast (ADV_NONCONN_IND)

Just send broadcast data without being scanned or connected. This is also the only broadcast type that can be used with only transmitters and no receiver equipment. The unconnectable device will not enter the connected state, therefore, it can only switch between the broadcast state and the ready state according to the requirements of the host. Often used in Beacon projects.

Scannable non-directed broadcast (ADV_SCAN_IND)

Also known as discoverable broadcast, this broadcast cannot be used to initiate a connection, but allows other devices to scan the broadcast device. This means that the device can be discovered, and it can either send broadcast data or send scan response data in response to scanning, but it cannot establish a connection . This is a broadcast form suitable for broadcast data. Dynamic data can be included in broadcast data, and static data can be included in scan response data.

Guess you like

Origin blog.csdn.net/qq_24179601/article/details/105558307