CN109548184B - Method and device for connecting mobile terminal and Bluetooth device and mobile terminal - Google Patents

Method and device for connecting mobile terminal and Bluetooth device and mobile terminal Download PDF

Info

Publication number
CN109548184B
CN109548184B CN201710702455.1A CN201710702455A CN109548184B CN 109548184 B CN109548184 B CN 109548184B CN 201710702455 A CN201710702455 A CN 201710702455A CN 109548184 B CN109548184 B CN 109548184B
Authority
CN
China
Prior art keywords
bluetooth
mobile terminal
pairing
equipment
bluetooth device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710702455.1A
Other languages
Chinese (zh)
Other versions
CN109548184A (en
Inventor
康健超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201710702455.1A priority Critical patent/CN109548184B/en
Publication of CN109548184A publication Critical patent/CN109548184A/en
Application granted granted Critical
Publication of CN109548184B publication Critical patent/CN109548184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method and a device for connecting a mobile terminal with Bluetooth equipment and the mobile terminal, wherein the method comprises the following steps: the mobile terminal detects whether a plurality of trigger messages matched with Bluetooth equipment are received or not; under the condition that a plurality of trigger messages are received, the mobile terminal respectively acquires the equipment information of each Bluetooth equipment so as to realize successful pairing with each Bluetooth equipment; under the condition of successful pairing with each Bluetooth device, the mobile terminal respectively establishes a corresponding RFECOMM channel with each Bluetooth device according to the acquired multiple device information. The invention changes the traditional single-to-single RFECOMM channel mode into the single-to-multiple RFECOMM channel mode, so that the mobile terminal can be paired and connected with a plurality of Bluetooth devices at the same time, and the problem that the mobile terminal in the prior art can only be paired and connected with one device earphone and the user experience is poor is solved.

Description

Method and device for connecting mobile terminal and Bluetooth device and mobile terminal
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a method and apparatus for connecting a mobile terminal with a bluetooth device, and a mobile terminal.
Background
With the development of wireless communication and short-range technologies, the use of bluetooth for mobile terminal devices is increasing, and data transmission between mobile terminals can be performed through bluetooth. Meanwhile, the scenes of pairing connection and use of the mobile terminal and the Bluetooth headset are more and more: when the car is started, the car can answer the call more conveniently by carrying the Bluetooth headset, or the Bluetooth headset is used for playing the audio and video. In the prior art, the mobile terminal equipment can only be paired with one piece of Bluetooth equipment, and can not be paired with a new earphone when being paired with the current equipment, so that a user needs to be paired manually when switching from one piece of equipment to another piece of equipment, which is time-consuming and has poor user experience.
Disclosure of Invention
The invention provides a method and a device for connecting a mobile terminal with Bluetooth equipment and the mobile terminal, which are used for solving the problem that the mobile terminal in the prior art can only be connected with one Bluetooth earphone in a pairing way.
In order to solve the above technical problems, in one aspect, the present invention provides a method for connecting a mobile terminal and a bluetooth device, including: the mobile terminal detects whether a plurality of trigger messages matched with Bluetooth equipment are received or not; under the condition that a plurality of triggering messages are received, the mobile terminal respectively acquires the equipment information of each Bluetooth equipment so as to realize successful pairing with each Bluetooth equipment; and under the condition of successful pairing with each Bluetooth device, the mobile terminal respectively establishes a corresponding RFECOMM channel with each Bluetooth device according to the acquired multiple device information.
Further, before the mobile terminal detects whether a plurality of trigger messages for pairing with the bluetooth device are received, the method further includes: the mobile terminal detects whether a modification request is received, wherein the modification request is used for modifying a preset maximum connection number of an accessible device in a predetermined protocol, and the predetermined protocol comprises: HFP (handles-free Profile) protocol and A2DP (Advanced Audio Distribution Profile) protocol; and under the condition that the modification request is received, modifying the preset maximum connection number according to the modification request.
Further, the mobile terminal obtains device information of each bluetooth device respectively to realize successful pairing with each bluetooth device, including: s21, the mobile terminal sends a pairing request to a first Bluetooth device to be accessed; s22, judging whether the number of successfully paired current connections is larger than a preset maximum connection number; s23, under the condition that the number of successfully paired Bluetooth devices is smaller than or equal to the preset maximum connection number, the mobile terminal acquires the device information of the first Bluetooth device to be accessed so as to realize successful pairing with the first Bluetooth device to be accessed, and sends a pairing request to the second Bluetooth device to be accessed; and S24, adding 1 to the number of successfully paired, and repeatedly executing S22 and S23 until the number of successfully paired is larger than the preset maximum connection number.
Further, the mobile terminal obtains the device information of each bluetooth device respectively, so as to realize successful pairing with each bluetooth device, and then the mobile terminal further comprises: generating a pairing identification code according to the equipment information of the Bluetooth equipment, wherein the equipment information comprises: the name and media intervention control layer (MAC, media Access Control) address of the bluetooth device; and storing the name, the MAC address and the pairing identification code of the Bluetooth equipment in a stack form.
Further, after the mobile terminal establishes the RFECOMM channels corresponding to the acquired multiple device information and each bluetooth device, the mobile terminal further includes: and under the condition that a request corresponding to the preset protocol is received, transmitting data corresponding to the preset protocol by using preset Bluetooth equipment, wherein the preset Bluetooth equipment is the Bluetooth equipment corresponding to the information stored last time in the information stored in a stack form.
In another aspect, the present invention further provides an apparatus for connecting a mobile terminal and a bluetooth device, including: the detection module is used for detecting whether a plurality of trigger messages matched with the Bluetooth equipment are received or not; the pairing module is used for acquiring the equipment information of each Bluetooth equipment under the condition that a plurality of trigger messages are received so as to realize successful pairing of the mobile terminal and each Bluetooth equipment; and the connection module is used for respectively establishing corresponding RFECOMM channels between the acquired multiple pieces of equipment information and each Bluetooth equipment under the condition that the mobile terminal and each Bluetooth equipment are successfully paired.
Further, the method further comprises the following steps: the detection module is further configured to detect whether a modification request is received, where the modification request is used to modify a preset maximum connection number of an accessible device in a predetermined protocol, and the predetermined protocol includes: HFP protocol and A2DP protocol; and the modification module is used for modifying the preset maximum connection number according to the modification request under the condition that the modification request is received.
Further, the pairing module is specifically configured to: s21, sending a pairing request to a first Bluetooth device to be accessed; s22, judging whether the number of successfully paired current connections is larger than a preset maximum connection number; s23, acquiring equipment information of the first Bluetooth equipment to be accessed under the condition that the number of successfully paired equipment is smaller than or equal to the preset maximum connection number so as to realize successful pairing with the first Bluetooth equipment to be accessed, and sending a pairing request to the second Bluetooth equipment to be accessed; and S24, adding 1 to the number of successfully paired, and repeatedly executing S22 and S23 until the number of successfully paired is larger than the preset maximum connection number.
Further, the method further comprises the following steps: the pairing module is further configured to generate a pairing identification code according to device information of the bluetooth device, where the device information includes: the name and MAC address of the bluetooth device; and the storage module is used for storing the name, the MAC address and the pairing identification code of the Bluetooth equipment in a stack form.
The invention changes the traditional single-to-single RFECOMM channel mode into the single-to-multiple RFECOMM channel mode, so that the mobile terminal can be paired and connected with a plurality of Bluetooth devices at the same time, and the problem that the mobile terminal in the prior art can only be paired and connected with one device earphone and the user experience is poor is solved.
Drawings
Fig. 1 is a flowchart of a method for connecting a mobile terminal and a bluetooth device according to a first embodiment of the present invention;
fig. 2 is a schematic diagram of an apparatus for connecting a mobile terminal and a bluetooth device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a mobile terminal according to a third embodiment of the present invention;
fig. 4 is a schematic diagram showing information storage in a stack according to a third embodiment of the present invention.
Detailed Description
In order to solve the problem that a mobile terminal in the prior art can only be connected with a Bluetooth headset in a pairing manner, the invention provides a method and a device for connecting the mobile terminal with Bluetooth equipment and the mobile terminal, and the invention is further described in detail below with reference to the accompanying drawings and the embodiment. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The first embodiment of the present invention provides a method for connecting a mobile terminal and a bluetooth device, wherein a flowchart of the method is shown in fig. 1, and specifically includes steps S101 to S103:
s101, a mobile terminal detects whether a plurality of trigger messages matched with Bluetooth equipment are received or not;
s102, under the condition that a plurality of trigger messages are received, the mobile terminal respectively acquires the equipment information of each Bluetooth equipment so as to realize successful pairing with each Bluetooth equipment;
and S103, under the condition of successful pairing with each Bluetooth device, the mobile terminal respectively establishes a corresponding RFECOMM channel with each Bluetooth device according to the acquired multiple device information.
Since the mobile terminal defaults to one connectable bluetooth device, the preset maximum connection number needs to be modified, so that the mobile terminal can be connected with a plurality of bluetooth devices simultaneously, that is, before the mobile terminal detects whether a plurality of trigger messages paired with the bluetooth devices are received, whether a modification request is received is detected, and under the condition that the modification request is received, the preset maximum connection number is modified according to the modification request. Wherein the modification request is used for modifying a preset maximum connection number of the accessible device in the predetermined protocol. Since the bluetooth device referred to in the present embodiment is a bluetooth headset, the predetermined protocols are HFP protocol and A2DP protocol.
When a user starts the Bluetooth function of the mobile terminal, the mobile terminal can automatically search all Bluetooth devices with the started Bluetooth function within the connectable range of the mobile terminal, the names of all the connectable Bluetooth devices are displayed on the screen of the mobile terminal, the user generates a trigger message for pairing with the Bluetooth devices by clicking the names of the Bluetooth devices, and when the user clicks a plurality of Bluetooth devices in sequence, the user generates a plurality of trigger messages.
Under the condition that a plurality of trigger messages are received, the mobile terminal respectively acquires the equipment information of each Bluetooth equipment to realize successful pairing with each Bluetooth equipment through the following steps:
s21, the mobile terminal sends a pairing request to a first Bluetooth device to be accessed;
s22, judging whether the number of successfully paired current connections is larger than a preset maximum connection number;
s23, under the condition that the number of successfully paired Bluetooth devices is smaller than or equal to the preset maximum connection number, the mobile terminal acquires the device information of the first Bluetooth device to be accessed so as to realize successful pairing with the first Bluetooth device to be accessed, and sends a pairing request to the second Bluetooth device to be accessed;
s24, adding 1 to the number of successfully paired, and repeatedly executing S22 and S23 until the number of successfully paired is larger than the preset maximum connection number.
After the mobile terminal is successfully paired with each Bluetooth device, the device information of the Bluetooth device is acquired to generate a pairing identification code, wherein the device information of the Bluetooth device comprises the name of the Bluetooth device and a unique MAC address corresponding to the Bluetooth device. The mobile terminal stores the name, the MAC address and the pairing identification code of the Bluetooth device in a stack mode. It should be appreciated that the earlier the information corresponding to the bluetooth device paired with the mobile terminal is stored in the stack.
After the mobile terminal establishes connection with a plurality of earphone devices, the mobile terminal can answer the call or play audio and video through the Bluetooth device. And under the condition that a request corresponding to a preset protocol is received, transmitting data corresponding to the preset protocol by using preset Bluetooth equipment, wherein the preset Bluetooth equipment is the Bluetooth equipment corresponding to the information stored last time in the information stored in a stack form. For example, the mobile terminal is sequentially connected with the bluetooth headset a, the bluetooth headset B and the bluetooth headset C, and then the information of the bluetooth headset in the stack is the bluetooth headset C, the bluetooth headset B and the bluetooth headset a from top to bottom, and in the case that the mobile terminal receives the request corresponding to the HFP protocol, the bluetooth device corresponding to the information stored in the stack form and stored in the last time in time is used, which is the bluetooth headset C in this embodiment.
The traditional single-to-single RFECOMM channel mode is changed into a single-to-multiple RFECOMM channel mode, so that the mobile terminal can be paired and connected with a plurality of Bluetooth devices at the same time, and the problem that the mobile terminal in the prior art can only be paired and connected with one device earphone and the user experience is poor is solved.
The second embodiment of the present invention provides an apparatus for connecting a mobile terminal and a bluetooth device, the structure of which is shown in fig. 2, and the apparatus for connecting a mobile terminal and a bluetooth device includes a detection module 201, a pairing module 202, and a connection module 203 that are sequentially coupled. The detection module 201 is configured to detect whether a plurality of trigger messages paired with the bluetooth device are received; the pairing module 202 is configured to obtain device information of each bluetooth device when receiving a plurality of trigger messages, so as to achieve successful pairing between the mobile terminal and each bluetooth device; the connection module 203 is configured to establish a corresponding RFECOMM channel with each bluetooth device according to the obtained plurality of device information when the mobile terminal and each bluetooth device are successfully paired.
Since the mobile terminal defaults to one connectable bluetooth device, the preset maximum connection number needs to be modified, so that the mobile terminal can be connected to a plurality of bluetooth devices simultaneously, that is, before the mobile terminal detects whether a plurality of trigger messages paired with the bluetooth devices are received, whether a modification request is received is detected by the detection module 201, and in the case that the modification request is received, the modification module modifies the preset maximum connection number according to the modification request. Wherein the modification request is used for modifying a preset maximum connection number of the accessible device in the predetermined protocol. Since the bluetooth device referred to in the present embodiment is a bluetooth headset, the predetermined protocols are HFP protocol and A2DP protocol.
When a user starts the Bluetooth function of the mobile terminal, the mobile terminal can automatically search all Bluetooth devices with the started Bluetooth function within the connectable range of the mobile terminal, the names of all the connectable Bluetooth devices are displayed on the screen of the mobile terminal, the user generates a trigger message for pairing with the Bluetooth devices by clicking the names of the Bluetooth devices, and when the user clicks a plurality of Bluetooth devices in sequence, the user generates a plurality of trigger messages.
Preferably, the pairing module 202 specifically performs the following steps when pairing between the mobile terminal and the bluetooth device:
s31, sending a pairing request to a first Bluetooth device to be accessed;
s32, judging whether the number of successfully paired current connections is larger than a preset maximum connection number;
s33, acquiring equipment information of the first Bluetooth equipment to be accessed under the condition that the number of successfully paired equipment is smaller than or equal to the preset maximum connection number, so as to realize successful pairing with the first Bluetooth equipment to be accessed, and sending a pairing request to the second Bluetooth equipment to be accessed;
s34, adding 1 to the number of successfully paired, and repeatedly executing S32 and S33 until the number of successfully paired is larger than the preset maximum connection number.
After pairing with each bluetooth device is successful, the pairing module 202 obtains device information of the bluetooth device to generate a pairing identification code, where the device information of the bluetooth device includes a name of the bluetooth device and a unique MAC address corresponding to the bluetooth device. The device for connecting the mobile terminal and the Bluetooth device further comprises a storage module, which is coupled with at least the pairing module and is used for storing the name, the MAC address and the pairing identification code of the Bluetooth device in a stack mode. It should be appreciated that the earlier the information corresponding to the bluetooth device paired with the mobile terminal is stored in the stack.
The device for connecting the mobile terminal and the Bluetooth equipment changes the traditional single-to-single RFECOMM channel mode into a single-to-multiple RFECOMM channel mode, so that the mobile terminal can be paired and connected with a plurality of Bluetooth equipment at the same time, and the problem that the mobile terminal in the prior art can only be paired and connected with one equipment earphone and the user experience is poor is solved.
A third embodiment of the present invention provides a mobile terminal, whose structure schematic diagram is shown in fig. 3. As shown in fig. 3, the mobile terminal includes the following modules coupled to each other: bluetooth module 301 and setup module 302. The bluetooth module 301 mainly includes an authentication unit 3011 (corresponding to a modification module in the second embodiment of the present invention), a pairing unit 3012 (corresponding to a pairing module in the second embodiment of the present invention), a connection unit 3013 (corresponding to a connection module in the second embodiment of the present invention), a call unit 3014, and an audio/video playing unit 3015; the setting module 302 presents the user with setting options for setting the bluetooth name of the mobile terminal, whether it is visible, and the maximum number of connections, mainly in the form of a bluetooth menu.
Further, after clicking the bluetooth menu in the setting module 302, the user opens the setting option, has a maximum connection number option, and after selecting, the user can input the maximum connection number that the mobile terminal needs to access. The default maximum connection number of the software bottom layer of the mobile terminal is 1, when the user inputs the maximum connection number N to be accessed, the value is sent to the software bottom layer through the authentication unit 3011, and the maximum connection number of the HFP protocol and the A2DP protocol supported by the mobile terminal is modified to the maximum connection number N required by the user by the software bottom layer, at this time, the maximum connection number displayed in the setting module 302 is N set by the user.
In this embodiment, after the bottom layer modifies the maximum connection number of the HFP protocol and the A2DP protocol, when the user searches for available bluetooth devices nearby, the pairing unit 3012 may pair with multiple bluetooth headset devices at the same time, and may access a second headset to be accessed at the same time in the process of clicking the first headset to be accessed. When the mobile terminal is paired with the first bluetooth headset, the basic information (name and MAC address) of the bluetooth headset is saved and a unique pairing identification code is generated, and the basic information of the bluetooth headset can be read by using the API of bluetooth. In the process of acquiring the basic information of the first Bluetooth headset device, the mobile terminal can be paired with the second Bluetooth headset to acquire and store the basic information of the second Bluetooth headset. The name and the MAC address of each successfully paired bluetooth headset are stored in a stack, and the pairing identification codes of the mobile terminal and each bluetooth headset are stored in the stack at the same time, as shown in fig. 4, the earlier the information corresponding to the bluetooth device paired with the mobile terminal is stored in the stack. The mobile terminal can be paired with a plurality of Bluetooth devices simultaneously, the pairing process is changed from a traditional serial mode into a parallel mode, the pairing connection efficiency is improved, and the pairing connection process of the terminal and the plurality of Bluetooth devices is quickened. In order to increase user experience, when the number of paired devices exceeds the preset maximum connection number in the authentication unit, a prompt of a user popup prompt that the number of devices to be paired is full and a new device cannot be accessed is given.
After pairing is successful, the mobile terminal can be paired with a plurality of Bluetooth headsets, firstly, a Bluetooth device set which is already paired with the current terminal device is queried through scanning, secondly, whether the device to be accessed has a Bluetooth connection service started or not is judged, finally, a connection unit 3013 initiates a connection request, connection is initiated in a stack from bottom to top according to the information of the paired Bluetooth headsets, the connection request is initiated in parallel, the connection request is initiated to each device according to the device MAC address information stored in the stack, and the mobile terminal and each headset have a Bluetooth socket on the same RFECOMM after the connection is established successfully, so that a plurality of RFECOMM channels are established when the mobile terminal is paired with the plurality of headsets, namely, a traditional single-to-single RFECOMM channel mode is changed into a single-to-multiple RFECOMM channel mode. When the number of connected devices exceeds the maximum number of connections preset in the authentication module, a prompt that the user pops up a prompt that the device to be accessed is full and a new device cannot be accessed is given.
When the mobile terminal calls in or out, if the mobile terminal and the bluetooth headset have already established a pairing connection, the call unit 3014 sends an instruction to judge the supporting condition of the HFP protocol and the A2DP protocol of the currently connected bluetooth headset, that is, when the bluetooth headset supports the HFP protocol, call sound can be correctly transmitted from the bluetooth headset supporting the HFP protocol, and when the bluetooth headset does not support the HFP protocol, call sound cannot be transmitted from the bluetooth headset not supporting the HFP protocol. When the mobile terminal is powered off to other mobile terminals, according to the stack storage sequence when the Bluetooth headset is connected with the mobile terminal in a pairing mode, if the Bluetooth headset which is connected with the mobile terminal last successfully supports the HFP protocol, the Bluetooth headset which is connected with the mobile terminal last successfully is activated, and after the other party is connected with the telephone, only the Bluetooth headset which is connected with the mobile terminal last successfully can communicate with the other party. In the conversation process, if the last connected Bluetooth earphone is closed, the conversation can be automatically switched to the last connected Bluetooth earphone for conversation according to the stack storage sequence, and the conversation can be normally carried out as long as the connected HFP earphone is not closed. However, when the last bluetooth headset successfully connected with the mobile terminal does not support the HFP protocol, the last bluetooth headset successfully connected with the mobile terminal is activated according to the stack storage sequence, and when the other party is connected with the phone, only the last bluetooth headset successfully connected with the mobile terminal can communicate with the other party. Under the condition that the mobile terminal calls, a plurality of Bluetooth headsets which are connected by the mobile terminal and support the HFP protocol have incoming call ringtones, at the moment, a user can select any headset which supports the HFP protocol to answer, and after answering, the headset can call.
When audio and video playing is performed on the mobile terminal, the audio and video playing unit 3015 can judge whether the currently connected Bluetooth headset supports the A2DP protocol, if so, audio and video playing sound can be correctly played from all Bluetooth handsets supporting the A2DP protocol, namely, a plurality of users are simultaneously supported to listen to the content played by the mobile phone; when the mobile terminal is connected with one Bluetooth earphone in a pairing mode to play audio and video, after the mobile terminal is connected with a second Bluetooth earphone in a pairing mode, the two earphone can play audio and video simultaneously if both support an A2DP protocol and play the same content, and when one Bluetooth earphone is disconnected, the disconnected Bluetooth earphone does not continue to play audio and video, but the audio and video of the other Bluetooth earphone is not delayed. When the mobile terminal is paired with the Bluetooth headset to play the audio and video, all the Bluetooth headsets supporting the A2DP protocol are closed, the audio and video can be paused to play, when at least two Bluetooth headsets supporting the A2DP protocol are actively reconnected successfully, the connected Bluetooth headsets are clicked to play the audio and video, and the connected Bluetooth headsets resume to listen to the audio and video.
If an incoming call exists in the audio/video playing process, at this time, the communication unit 3014 detects which Bluetooth earphones stored in the earphone stack support the HFP protocol, and all Bluetooth earphones supporting the HFP protocol have ringing sounds, at this time, a user can select any earphone to communicate; if a certain Bluetooth earphone supports the HFP protocol and supports the A2DP protocol, but because the priority of the HFP protocol is higher than that of the A2DP protocol, the Bluetooth earphone generates ringing sound and the audio and video pauses to play when the mobile terminal has an incoming call, and if a user selects to use other Bluetooth earphone to answer the call, the audio and video can continue to play after the call is answered. If the Bluetooth headset is ready to be powered off in the process of playing the audio and video, at the moment, the communication unit 3014 detects whether the Bluetooth headset which is finally connected with the mobile terminal in a pairing way in the headset stack storage supports the HFP protocol, and if the Bluetooth headset supports the HFP protocol, the headset has ringing sound; if the Bluetooth headset is not supported, the Bluetooth headset is judged from top to bottom in a stack by analogy until the Bluetooth headset supporting the HFP protocol is detected, and if a certain Bluetooth headset supports the HFP protocol and supports the A2DP protocol at the same time, the Bluetooth headset can generate ringing sound and pause audio and video playing because the priority of the HFP protocol is higher than that of the A2DP protocol, and the audio and video playing can be continued when the call is ended.
In order to facilitate the use of the user and view the connection state of the current mobile terminal, in this embodiment, a widget menu is provided in the mobile terminal, where the widget menu is disposed on the home screen of the mobile terminal and is used to display the connection state of the mobile terminal and the bluetooth headset, so that the user can conveniently view the information such as the number of connected headsets and the current electric quantity of the headset. When the user clicks the widget menu on the screen, the user can quickly enter the bluetooth menu of the setting module 302, that is, the widget menu and the setting module 302 always keep an interactive state.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and accordingly the scope of the invention is not limited to the embodiments described above.

Claims (10)

1. A method for connecting a mobile terminal to a bluetooth device, comprising:
the mobile terminal detects whether a plurality of trigger messages matched with Bluetooth equipment are received or not;
under the condition that a plurality of triggering messages are received, the mobile terminal respectively acquires the equipment information of each Bluetooth equipment so as to realize successful pairing with each Bluetooth equipment;
under the condition of successful pairing with each Bluetooth device, the mobile terminal respectively establishes corresponding RFECOMM channels according to the acquired multiple device information and each Bluetooth device, so that the mobile terminal establishes connection with the multiple Bluetooth devices simultaneously in a single-to-multiple RFECOMM channel mode;
under the condition that the mobile terminal calls or goes to the electricity to carry out the call, the call is carried out through the Bluetooth equipment which is successfully connected with the mobile terminal; in the communication process, if the Bluetooth device which is currently communicating is closed, the communication is switched to the Bluetooth device which is connected with the mobile terminal successfully last time before the Bluetooth device.
2. The method of claim 1, wherein before the mobile terminal detects whether a plurality of trigger messages for pairing with the bluetooth device are received, further comprising:
the mobile terminal detects whether a modification request is received, wherein the modification request is used for modifying a preset maximum connection number of an accessible device in a predetermined protocol, and the predetermined protocol comprises: HFP protocol and A2DP protocol;
and under the condition that the modification request is received, modifying the preset maximum connection number according to the modification request.
3. The method of claim 1, wherein the mobile terminal obtains device information of each bluetooth device separately to achieve successful pairing with each bluetooth device, comprising:
s21, the mobile terminal sends a pairing request to a first Bluetooth device to be accessed;
s22, judging whether the number of successfully paired current connections is larger than a preset maximum connection number;
s23, under the condition that the number of successfully paired Bluetooth devices is smaller than or equal to the preset maximum connection number, the mobile terminal acquires the device information of the first Bluetooth device to be accessed so as to realize successful pairing with the first Bluetooth device to be accessed, and sends a pairing request to the second Bluetooth device to be accessed;
and S24, adding 1 to the number of successfully paired, and repeatedly executing S22 and S23 until the number of successfully paired is larger than the preset maximum connection number.
4. A method according to any one of claims 1 to 3, wherein the mobile terminal obtains device information of each bluetooth device separately to enable successful pairing with the respective bluetooth device, further comprising:
generating a pairing identification code according to the equipment information of the Bluetooth equipment, wherein the equipment information comprises: name of bluetooth device and media intervention control layer MAC address;
and storing the name, the MAC address and the pairing identification code of the Bluetooth equipment in a stack form.
5. The method of claim 4, wherein after the mobile terminal establishes the RFECOMM channel with each bluetooth device according to the acquired plurality of device information, the method further comprises:
and under the condition that a request corresponding to a preset protocol is received, transmitting data corresponding to the preset protocol by using preset Bluetooth equipment, wherein the preset Bluetooth equipment is the Bluetooth equipment corresponding to the information stored last time in the information stored in a stack form.
6. An apparatus for connecting a mobile terminal to a bluetooth device, comprising:
the detection module is used for detecting whether a plurality of trigger messages matched with the Bluetooth equipment are received or not;
the pairing module is used for acquiring the equipment information of each Bluetooth equipment under the condition that a plurality of trigger messages are received so as to realize successful pairing of the mobile terminal and each Bluetooth equipment;
the connection module is used for respectively establishing corresponding RFECOMM channels between the mobile terminal and each Bluetooth device according to the acquired multiple device information under the condition that the mobile terminal and each Bluetooth device are successfully paired, so that the mobile terminal can be simultaneously connected with the multiple Bluetooth devices in a single-to-multiple RFECOMM channel mode; under the condition that the mobile terminal calls or goes to call, the mobile terminal calls through the Bluetooth equipment which is successfully connected with the mobile terminal; in the communication process, if the Bluetooth device which is currently communicating is closed, the communication is switched to the Bluetooth device which is connected with the mobile terminal successfully last time before the Bluetooth device.
7. The apparatus as recited in claim 6, further comprising:
the detection module is further configured to detect whether a modification request is received, where the modification request is used to modify a preset maximum connection number of an accessible device in a predetermined protocol, and the predetermined protocol includes: HFP protocol and A2DP protocol;
and the modification module is used for modifying the preset maximum connection number according to the modification request under the condition that the modification request is received.
8. The apparatus of claim 6, wherein the pairing module is specifically configured to:
s21, sending a pairing request to a first Bluetooth device to be accessed;
s22, judging whether the number of successfully paired current connections is larger than a preset maximum connection number;
s23, acquiring equipment information of the first Bluetooth equipment to be accessed under the condition that the number of successfully paired equipment is smaller than or equal to the preset maximum connection number so as to realize successful pairing with the first Bluetooth equipment to be accessed, and sending a pairing request to the second Bluetooth equipment to be accessed;
and S24, adding 1 to the number of successfully paired, and repeatedly executing S22 and S23 until the number of successfully paired is larger than the preset maximum connection number.
9. The apparatus of any one of claims 6 to 8, further comprising:
the pairing module is further configured to generate a pairing identification code according to device information of the bluetooth device, where the device information includes: name of bluetooth device and media intervention control layer MAC address;
and the storage module is used for storing the name, the MAC address and the pairing identification code of the Bluetooth equipment in a stack form.
10. A mobile terminal, comprising: apparatus for connecting a mobile terminal with a bluetooth device as claimed in any one of claims 6 to 9.
CN201710702455.1A 2017-08-16 2017-08-16 Method and device for connecting mobile terminal and Bluetooth device and mobile terminal Active CN109548184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710702455.1A CN109548184B (en) 2017-08-16 2017-08-16 Method and device for connecting mobile terminal and Bluetooth device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710702455.1A CN109548184B (en) 2017-08-16 2017-08-16 Method and device for connecting mobile terminal and Bluetooth device and mobile terminal

Publications (2)

Publication Number Publication Date
CN109548184A CN109548184A (en) 2019-03-29
CN109548184B true CN109548184B (en) 2024-03-08

Family

ID=65827803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710702455.1A Active CN109548184B (en) 2017-08-16 2017-08-16 Method and device for connecting mobile terminal and Bluetooth device and mobile terminal

Country Status (1)

Country Link
CN (1) CN109548184B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460984B (en) * 2019-08-16 2022-07-01 中科微电技术(深圳)有限公司 Multi-Bluetooth control method, system, terminal and storage based on distributed storage
CN112469009A (en) 2019-09-06 2021-03-09 中兴通讯股份有限公司 Bluetooth data transmission method, device, terminal and storage medium
CN110996305B (en) * 2019-11-12 2024-01-05 宇龙计算机通信科技(深圳)有限公司 Method and device for connecting Bluetooth equipment, electronic equipment and medium
CN111432386B (en) * 2020-03-30 2021-08-27 歌尔科技有限公司 Connection switching method, device, equipment and storage medium of Bluetooth headset
CN111918258B (en) * 2020-07-29 2024-05-03 东软集团股份有限公司 Method, device and equipment for realizing Bluetooth service connection
TWI826781B (en) * 2021-04-29 2023-12-21 鈺寶科技股份有限公司 Wireless communication system with automatic pairing mechanism and automatic pairing method of wireless communication
CN113407076A (en) * 2021-06-04 2021-09-17 荣耀终端有限公司 Method for starting application and electronic equipment
CN114125735B (en) * 2021-12-03 2023-04-21 Oppo广东移动通信有限公司 Earphone connection method and device, computer readable storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101785198A (en) * 2007-08-31 2010-07-21 摩托罗拉公司 The automatic a plurality of method of matching and the equipment that are used for bluetooth equipment
CN103391121A (en) * 2013-07-31 2013-11-13 北京爱德发科技有限公司 Method for pairing and connecting multiple devices and Bluetooth device
CN103518418A (en) * 2012-09-27 2014-01-15 华为终端有限公司 Connecting method between Bluetooth devices and device
CN103636141A (en) * 2012-11-16 2014-03-12 华为终端有限公司 Method for establishing Bluetooth connection, mobile terminal, Bluetooth devices and system
CN104184502A (en) * 2014-08-28 2014-12-03 许磊 Bluetooth pairing device and method
CN105101058A (en) * 2015-07-13 2015-11-25 惠州Tcl移动通信有限公司 Method and equipment for realizing cooperative works of multiple Bluetooth headsets

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101544431B1 (en) * 2008-11-21 2015-08-13 삼성전자주식회사 Apparatus and method for connecting with bluetooth devices in a terminal using audio channel

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101785198A (en) * 2007-08-31 2010-07-21 摩托罗拉公司 The automatic a plurality of method of matching and the equipment that are used for bluetooth equipment
CN103518418A (en) * 2012-09-27 2014-01-15 华为终端有限公司 Connecting method between Bluetooth devices and device
CN103636141A (en) * 2012-11-16 2014-03-12 华为终端有限公司 Method for establishing Bluetooth connection, mobile terminal, Bluetooth devices and system
CN103391121A (en) * 2013-07-31 2013-11-13 北京爱德发科技有限公司 Method for pairing and connecting multiple devices and Bluetooth device
CN104184502A (en) * 2014-08-28 2014-12-03 许磊 Bluetooth pairing device and method
CN105101058A (en) * 2015-07-13 2015-11-25 惠州Tcl移动通信有限公司 Method and equipment for realizing cooperative works of multiple Bluetooth headsets

Also Published As

Publication number Publication date
CN109548184A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109548184B (en) Method and device for connecting mobile terminal and Bluetooth device and mobile terminal
US8103315B2 (en) Portable terminal device
US10957319B2 (en) Speech processing method, device and computer readable storage medium
CN105611055B (en) Call method and device
CN109644216A (en) A kind of method and terminal of Bluetooth communication
WO2018082335A1 (en) Method, apparatus, system, and device for connecting bluetooth device
CA2727061A1 (en) Text alternative to established voice call session
CN104025558A (en) A wireless headset and a headset system for transferring call between two telecommunication devices
CN102857807A (en) Communication terminal voice control method and digital television terminal
CA2784651C (en) Apparatus and method in a wireless device for reestablishing a call
CN101572570B (en) Message processing method and system of wireless network card through mobile termination
EP3116201B1 (en) Cordless phone apparatus, cordless phone system, and method for transferring data
CN114844736B (en) Equipment and call control method
CN113395576B (en) Scene switching method, computer equipment and storage medium
CN112312368A (en) Data processing method, device, equipment and storage medium
CN103891258B (en) There is the docking system of the automatic music playback via bluetooth
CN113810887B (en) Bluetooth protocol connection method and device, storage medium and related equipment
CN107222634B (en) Incoming call control method and device, storage medium and electronic equipment
US10277726B2 (en) Mobile to landline dialer
JP5877485B1 (en) Telephone device and incoming call ringing control method
CN114844735B (en) Display equipment and voice forwarding method
JP6537159B1 (en) Communication control device and communication control program
WO2023109282A1 (en) Incoming call processing method and apparatus, electronic device, and storage medium
GB2476705A (en) Routing multiple communication sessions within a local area such as a home or apartment
CN114449093A (en) Device control method, incoming call processing device, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant