Bluetooth connection process analysis
Bluetooth connection process analysis

Bluetooth connection process analysis

1. basic concept
The connection process of Bluetooth is very important, especially for Bluetooth technicians, this is very important. The process of managing it is a compulsory course. Although I have been in the Bluetooth industry for a long time, I have not done some things systematically before. I will take this opportunity to sort out the content here.
After the paging process is over, the link management process (LMP) is generally started, and the clock calibration, version, support features, names and some connection state initialization are completed at the beginning. The paging device (device A) will first initiate a LMP_host_connection_req PDU. When another device (device B) receives this message, it will notify the upper layer to receive the connection information, and device B will respond with an accept connection (LMP accepted PDU) ) or reject the connection (LMP_not_accepted PDU). At the same time, if the slave device (slave) needs a role switch, it will send a clock deflection information (LMP_slot_offset PDU) and switch request frame (LMP_switch_req PDU) after receiving a connection request frame (LMP_host_connection_req PDU). If the role switch is successful, the old slave device will reply with a command to accept the connection or reject the connection. If it fails, the other party will send a message rejecting the role switch with the reason code (0x14).
If the device that initiates paging receives a message that the other party refuses to connect. It will immediately send (LMP_detach) to disconnect the link by sending one.
If the slave device accepts the connection request from the master device. The Bluetooth encryption process may be invoked (because this is an optional item, it is determined according to the connection requirements of the master device or the slave device). If there is no need for encryption, the master device will send a connection completion message to the slave device. After both devices have sent the connection completion message, the connection process at the bottom of the system is over. The whole process is shown in the figure below:

Bluetooth connection process analysis

2. process analysis
In fact, the connection process of Bluetooth is more complicated. Compared with wifi, it has many more options, which makes it look particularly complicated. Therefore, when learning, you must have the thinking of simplifying the complex, starting with the simplest, the following figure is the complete Bluetooth connection flow chart, as shown below. This flowchart shows us the entire connection process, which at first glance is quite complicated. If you divide this process into two steps, it will be relatively simple. Look at the solid line first. This is the basic connection process, and it is an essential three steps. It is to create a connection, connect a request, establish a connection, and disconnect the four steps. Each step has a request and a reply, so the understanding is relatively simple. Those options, many of which are not related to software, only need to understand role switch and data flow. When there are other problems, turn over the protocol stack to see the estimate and understand, there are not many things. Sorting out this way, is your Bluetooth connection process clear?
There is also a more vivid description, just like the process of our sales beauty visiting customers:

Round 1: Initiate Connection:

Beauty Sales: Confirmed eyes, is the right person. Be proactive then. First cast a wink and say hello.
Client: Looking around, it seems to be talking to me. Can only be an answer. Accept or reject, it depends on people’s impression of you. Yes, hello, what’s the matter?
Another tragic result: I was busy and didn’t want to talk to you, so I replied directly. Sorry, I don’t know you. Rejected in one bite. There is nothing after that.

Second round: connect request:

Beauty Sales: I’m XXX, from what company, I want to communicate with you based on what product or something, can I have time to chat?
Customer: It depends on the mood of the customer. The boss agreed, then he would give an affirmative answer, and then we could talk about something.
Tragic result: I’m sorry, I’m busy, come back another day. The conversation is over.

The third round: handshake recognition.

Beauty Sales: Reach out and shake hands. It’s considered an acquaintance. Then, let’s get to the point and start talking about business.
Client: Shake hands, let’s chat in the conference room.

Bluetooth connection process analysis

3. Summary
After making agreements for many years, I discovered that many of the things in the agreement come from life. In fact, if you think about it, that’s how it is. The role of the agreement is to facilitate people to communicate. It is designed by people, and many things must be modeled based on human thinking and common patterns. Knowing this, aligning the scenes in life with the scenes of the agreement, it is estimated that you will soon know that the so-called agreement is actually very simple. Although the upside-down technique is relatively boring, if you go deep into it and look at the product as your child, it is estimated that it will add a lot of fun to the work.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link
Powered by Social Snap