- Mastering IOT
- Colin Dow Perry Lea
- 491字
- 2021-06-24 15:35:30
BR/EDR operation
Classic Bluetooth (BR/EDR) mode is connection-orientated. If a device is connected, the link is maintained even if no data is in being communicated. Before any Bluetooth connection transpires, a device must be discoverable for it to respond to scans of a physical channel and subsequently respond with its device address and other parameters. A device must be in a connectable mode to monitor its page scan.
The connection process proceeds in three steps:
- Inquiry: In this phase, two Bluetooth devices have never associated or bonded; they know nothing of each other. The devices must discover each other through an inquiry request. If the other device is listening, it may respond with its BR_ADDR address.
- Paging: Paging or connecting forms a connection between the two devices. Each device knows the BD_ADDR of each other at this point.
- Connected: There are four sub-modes of the connection state. This is the normal state when two devices are actively communicating:
- Active mode: This is the normal mode of operation for transmission and receiving of Bluetooth data or waiting for the next transmission slot.
- Sniff mode: This is a power saving mode. The device is essentially asleep but will listen for transmissions during specific slots that can be changed programmatically (for example, 50 ms).
- Hold mode: This is a temporary low power mode initiated by the master or slave. It will not listen for transmissions like sniff mode, and the slave temporarily ignores ACL packets. While in this mode, switching to the connected state occurs very quickly.
- Park mode: As stated earlier, this mode is deprecated in Bluetooth 5.
A state diagram of these phases is as follows:
If this process completes successfully, the two devices can be forced to automatically connect when they are in range. The devices are now pairing. The one-time pairing process is most common in connecting smartphones to a vehicle stereo, but it can apply anywhere in the IoT as well. Paired devices will share a key that is used in the authentication process. More will be covered on keys and authentication in the security section of Bluetooth.