- Broadcaster working mode
Bluetooth broadcasting is a function that devices above Bluetooth 4.0 must support. It does not involve the upper connection layer and protocol layer. Therefore, the information transmitted by the data packet broadcast by Bluetooth has better real-time performance and compatibility on the Bluetooth device. In the broadcast mode, the Bluetooth module regularly and continuously sends broadcast data packets of a certain length to the surroundings. The data can be searched by the scanner. The module can continue to broadcast in low-power mode, which is applied to extremely low power consumption. Small data volume, one-way transmission applications. The important function of the Bluetooth broadcast channel is to discover devices, initiate connections and distribute data.
The broadcast mode mainly has two usage scenarios: (1) One-way, connectionless data communication, the data sender broadcasts data on the broadcast channel, and the data receiver scans and receives the data; the broadcaster will be used as a server. Its purpose It is to periodically transmit data to the device, but does not support any connection. Such as beacons, billboards, indoor positioning, material tracking, etc. (2) Connection-oriented establishment, such as Bluetooth slave devices broadcast messages and then searched by the master device The only difference between connection, broadcaster and slave mode is that it cannot be connected by the host and can only broadcast data.
Bluetooth broadcasts generally broadcast its own mac address, name, and supported features to the outside. The broadcast is mainly used to be discovered by other devices, not for data transmission. The length of the broadcast packet is a fixed byte. Although there can be data customized by the manufacturer, the data is also limited.
There are two types of broadcast packets: Advertising Data and Scan Response. The broadcast packet must be broadcast by each device, and the response packet is optional. The length of each packet is a fixed byte N , the length N of the data packet expands with the improvement of the Bluetooth protocol standard. For example, the data packet of Bluetooth 5.0 is upgraded from 31 bytes of Bluetooth 4.2 to 255 bytes, and the data packet is divided into two parts: valid data and invalid data. The length of each broadcast packet must be N bytes, if it is less than N bytes, the rest will be filled with 0, and this part of the data is invalid.
- Observer working mode
In the observer mode, the module is not connected in this mode. Compared with the one-to-many sending broadcast in the broadcaster mode, the observer can receive data one-to-many. In this mode, the device can only listen and read broadcast data in the air. The only difference from the host is that it cannot initiate a connection, and can only continuously scan the slave.
The observer working mode can be applied to the application occasion of the data collection concentrator, such as sensor concentrator collection and other functions; another typical example is the Bluetooth gateway, the Bluetooth module is in the observer mode, no broadcast, it can scan the surrounding broadcast equipment, But cannot ask to connect with the broadcasting device.
It can be seen that different types of Bluetooth modules can have different working modes according to different usage scenarios, not just simple point-to-point communication. With the upgrading of Bluetooth protocol standards, Bluetooth technology is also constantly improving. Different working modes The Bluetooth module can play different roles, adapt to different technical applications, and play its required functions.