How Bluetooth Works
Bluetooth communication master-slave relationship
The Bluetooth technology stipulates that each pair of devices must have a master role and a slave role to communicate with each other. When communicating, the master must perform a lookup and initiate pairing. After the success of the link establishment, both parties will Can send and receive data. In theory, a Bluetooth master device can simultaneously communicate with 7 Bluetooth slave devices. A Bluetooth-enabled device can switch between two roles. It usually works in slave mode, waits for other master devices to connect, and when needed, switches to the master mode and initiates calls to other devices. When a Bluetooth device initiates a call in the master mode, it needs to know the other party's Bluetooth address, pairing password, and other information. After the pairing is completed, a call can be initiated directly.
Bluetooth call process
The Bluetooth master device initiates a call. The first step is to find a Bluetooth device that can be found around. After the master device finds the slave Bluetooth device, it pairs with the slave Bluetooth device. At this time, the slave device needs to input the PIN code of the slave device, and the device does not need to input the PIN code. After the pairing is complete, the slave Bluetooth device records the trust information of the master device. At this time, the master device can initiate a call to the slave device. When the paired device calls the next time, the device no longer needs to be paired again. Paired devices, Bluetooth headsets as slaves can also initiate link setup requests, but Bluetooth modules that do data communications generally do not initiate calls. After the link is successfully established, two-way data or voice communication can be performed between the master and slave ends. In the communication state, both the master and the slave devices can initiate the disconnection and disconnect the Bluetooth link.
Bluetooth one-to-one serial data transmission application
In the Bluetooth data transmission application, one-to-one serial data communication is one of the most common applications. The Bluetooth device presets the pairing information between two Bluetooth devices before leaving the factory. The master device pre-stores the PIN code of the slave device. Address, etc., the two ends of the device are automatically built upon powering up, transparent serial port transmission, no external circuit intervention. In a one-to-one application, the slave device can be set to two types. One is the silent state, that is, it can only communicate with the designated master and is not searched by other Bluetooth devices. The second is the development status, and it can be specified as the master to find. , It can also be found by other Bluetooth devices.