Method and apparatus for establishing Bluetooth link, device, and storage medium
View Patent ↗Establishing a Bluetooth link may include: transmitting, by a master Bluetooth device, a connection notification to a slave Bluetooth device, the connection notification being configured to indicate the slave Bluetooth device as an agent of the master Bluetooth device to initiate paging to a second target device; initiating, by the slave Bluetooth device, paging to the second target device; transmitting, by the slave Bluetooth device in response that the second target device is paged successfully, connection information to the master Bluetooth device, the connection information being configured for the master Bluetooth device to perform continuous communication with the second target device; and establishing, by the master Bluetooth device, a second Bluetooth link with the second target device based on the connection information.
1 . A method for establishing a Bluetooth link in a master Bluetooth device, comprising:
transmitting a connection notification to a slave Bluetooth device, the connection notification being configured to indicate the slave Bluetooth device as an agent of the master Bluetooth device to initiate paging to a second target device;
receiving connection information from the slave Bluetooth device, the connection information being configured for the master Bluetooth device to perform continuous communication with the second target device; and
establishing a second Bluetooth link with the second target device based on the connection information;
wherein the establishing the second Bluetooth link with the second target device based on the connection information comprises:
determining a target frequency point based on the connection information; transmitting a link manager protocol (LMP) characteristic exchange request to the second target device at the target frequency point, the LMP characteristic exchange request comprising characteristic information of the master Bluetooth device; receiving an LMP characteristic exchange response from the second target device, the LMP characteristic exchange response comprising characteristic information of the second target device; and saving the characteristic information of the second target device, and transmitting an LMP establishment completion message to the second target device, the LMP establishment completion message being configured to indicate that establishment of the second Bluetooth link is completed; or
determining a target frequency point based on the connection information; transmitting a master device page response to the second target device at the target frequency point; transmitting, in response to receiving a slave device second page response from the second target device, an LMP characteristic exchange request to the second target device, the LMP characteristic exchange request comprising characteristic information of the master Bluetooth device; receiving an LMP characteristic exchange response from the second target device, the LMP characteristic exchange response comprising characteristic information of the second target device; and saving the characteristic information of the second target device, and transmitting an LMP establishment completion message to the second target device, the LMP establishment completion message being configured to indicate that establishment of the second Bluetooth link is completed.
2 . The method according to claim 1 , wherein the connection information comprises clock synchronization information used for enabling the master Bluetooth device to communicate with the second target device at a same frequency point.
3 . The method according to claim 1 , further comprising:
receiving a page failure notification from the slave Bluetooth device, the page failure notification being configured to indicate that the slave Bluetooth device fails to page the second target device.
4 . The method according to claim 1 , further comprising
initiating paging to a first target device; and
establishing, in response that the first target device is paged successfully, a first Bluetooth link with the first target device, wherein:
an establishment process of the second Bluetooth link is executed in parallel with an establishment process of the first Bluetooth link.
5 . The method according to claim 1 , wherein the master Bluetooth device comprises a master Bluetooth earphone, and the slave Bluetooth device comprises a slave Bluetooth earphone.
6 . A master Bluetooth device, comprising a processor and a memory having a computer program stored therein, the computer program, when executed by the processor, implementing a method for establishing a Bluetooth link in the master Bluetooth device, comprising:
transmitting a connection notification to a slave Bluetooth device, the connection notification being configured to indicate the slave Bluetooth device as an agent of the master Bluetooth device to initiate paging to a second target device;
receiving connection information from the slave Bluetooth device, the connection information being configured for the master Bluetooth device to perform continuous communication with the second target device; and
establishing a second Bluetooth link with the second target device based on the connection information;
wherein the establishing the second Bluetooth link with the second target device based on the connection information comprises:
determining a target frequency point based on the connection information; transmitting a link manager protocol (LMP) characteristic exchange request to the second target device at the target frequency point, the LMP characteristic exchange request comprising characteristic information of the master Bluetooth device; receiving an LMP characteristic exchange response from the second target device, the LMP characteristic exchange response comprising characteristic information of the second target device; and saving the characteristic information of the second target device, and transmitting an LMP establishment completion message to the second target device, the LMP establishment completion message being configured to indicate that establishment of the second Bluetooth link is completed; or
determining a target frequency point based on the connection information; transmitting a master device page response to the second target device at the target frequency point; transmitting, in response to receiving a slave device second page response from the second target device, an LMP characteristic exchange request to the second target device, the LMP characteristic exchange request comprising characteristic information of the master Bluetooth device; receiving an LMP characteristic exchange response from the second target device, the LMP characteristic exchange response comprising characteristic information of the second target device; and saving the characteristic information of the second target device, and transmitting an LMP establishment completion message to the second target device, the LMP establishment completion message being configured to indicate that establishment of the second Bluetooth link is completed.
7 . The master Bluetooth device according to claim 6 , wherein the connection information comprises clock synchronization information used for enabling the master Bluetooth device to communicate with the second target device at a same frequency point.
8 . The master Bluetooth device according to claim 6 , wherein the computer program, when executed by the processor, implements the method for establishing a Bluetooth link in the master Bluetooth device, further comprising:
receiving a page failure notification from the slave Bluetooth device, the page failure notification being configured to indicate that the slave Bluetooth device fails to page the second target device.
9 . The master Bluetooth device according to claim 6 , wherein the computer program, when executed by the processor, implements the method for establishing a Bluetooth link in the master Bluetooth device, further comprising:
initiating paging to a first target device; and
establishing, in response that the first target device is paged successfully, a first Bluetooth link with the first target device, wherein:
an establishment process of the second Bluetooth link is executed in parallel with an establishment process of the first Bluetooth link.
10 . The master Bluetooth device according to claim 6 , wherein the master Bluetooth device comprises a master Bluetooth earphone, and the slave Bluetooth device comprises a slave Bluetooth earphone.