Bluetooth connection method, electronic device and computer-readable storage medium
By scanning and determining the Bluetooth device type in the electronic device and sending relevant confirmation requests to negotiate the Bluetooth protocol, the problem of connection failure of high and low versions of Bluetooth devices is solved, and the connection success rate and data transmission stability are improved.
Patent Information
- Application Number
- CN202410293149.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-03-13
AI Technical Summary
In the prior art, terminal devices using the higher version of Bluetooth protocol and terminal devices using the lower version of Bluetooth protocol are prone to failure when connecting.
By broadcasting an inquiry request message in an electronic device, scanning and determining the type of Bluetooth device, sending a confirmation request related to its Bluetooth protocol version number to negotiate the Bluetooth protocol used to transmit media data, ensuring successful connection between devices.
Improves the success rate of Bluetooth connection between electronic devices with different versions of Bluetooth protocols, ensuring the stability and reliability of data transmission.
Smart Images

Figure CN119277354B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a Bluetooth connection method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Current terminal devices generally support Bluetooth, which enables wireless communication between two terminal devices within a short range. Specifically, Bluetooth connection between two terminal devices can achieve wireless control, data transmission, media playback and other functions, bringing great convenience to people's use of terminal devices.
[0003] However, currently, when a terminal device using a higher version of the Bluetooth protocol is connected to a terminal device using a lower version of the Bluetooth protocol, a connection failure problem may occur. Summary of the Invention
[0004] In view of this, the present application provides a Bluetooth connection method, an electronic device, and a computer-readable storage medium, which can improve the success rate of Bluetooth connections between electronic devices using different versions of Bluetooth protocols.
[0005] In a first aspect, the present application provides a Bluetooth connection method, which is applied to an electronic device. In response to an operation of turning on the Bluetooth function, the electronic device broadcasts an inquiry request message and enters a scanning state, so that a classic Bluetooth device can be discovered through the broadcast inquiry request message, or a low-power Bluetooth device can be discovered through scanning. When the electronic device receives an inquiry response message from a first Bluetooth device, the electronic device scans the first Bluetooth device. In response to the operation of selecting the first Bluetooth device, the electronic device establishes a first data connection channel with the first Bluetooth device. Afterwards, the electronic device can send a first confirmation request to the first Bluetooth device through the first data connection channel, wherein the first confirmation request includes a first Bluetooth protocol version number, the first Bluetooth protocol version number is a pre-set Bluetooth protocol version number, and the pre-set Bluetooth protocol version number is less than the version number of the Bluetooth protocol supported by the electronic device; the first confirmation request is used to request the first Bluetooth device to confirm the Bluetooth protocol version number of the electronic device; and negotiate with the first Bluetooth device a Bluetooth protocol for transmitting media data to transmit media data through the first data connection channel.
[0006] In some examples, the operation of turning on the Bluetooth function may be a user clicking on a control for turning on the Bluetooth function, etc. In some examples, the operation of selecting the first Bluetooth device may be a user clicking on an identifier of the first Bluetooth device.
[0007] In the above implementation, the first Bluetooth protocol version number is a Bluetooth protocol version number that is pre-set according to the Bluetooth protocol version numbers that can be supported by classic Bluetooth.
[0008] In the above implementation, since the electronic device is the first Bluetooth device scanned by receiving the inquiry response sent back by the first Bluetooth device, the electronic device can confirm that the first Bluetooth device is a classic Bluetooth device. Then, the electronic device can send a first confirmation request including the first Bluetooth protocol version number to the first Bluetooth device. After the first Bluetooth device receives the first confirmation request, if the first Bluetooth protocol version number is large, the first Bluetooth device will not confirm the Bluetooth protocol version number of the electronic device, that is, the first Bluetooth device will not feedback a message to the electronic device based on the first confirmation request. Therefore, the electronic device can send a first confirmation request including a pre-set first Bluetooth protocol version number to ensure that the pre-set first Bluetooth protocol version number is not too large, thereby ensuring that the first Bluetooth device can confirm the Bluetooth protocol version number of the electronic device, and then ensure that media data can be successfully transmitted between the electronic device and the first Bluetooth device. In this way, the success rate of Bluetooth connection between electronic devices using different versions of Bluetooth protocols can be improved.
[0009] In a possible implementation of the first aspect, when an electronic device receives a low-power Bluetooth broadcast message from a second Bluetooth device, in response to an operation of selecting the second Bluetooth device, the electronic device may establish a second data connection channel with the second Bluetooth device and send a second confirmation request to the second Bluetooth device through the second data connection channel. The second confirmation request includes a second Bluetooth protocol version number, which is the Bluetooth protocol version number of the Bluetooth protocol supported by the electronic device, and the second confirmation request is used to request the second Bluetooth device to confirm the Bluetooth protocol version number of the electronic device. The Bluetooth protocol for transmitting media data is negotiated with the second Bluetooth device to transmit the media data through the second data connection channel.
[0010] In the above implementation, since the electronic device scans the second Bluetooth device by receiving a Bluetooth low energy broadcast message from the second Bluetooth device, the electronic device can confirm that the second Bluetooth device is a Bluetooth low energy device.
[0011] In the above implementation, after the second Bluetooth device receives the second confirmation request, it can directly send feedback based on the second confirmation request to the electronic device. There is no situation where feedback is not sent to the electronic device because the second Bluetooth protocol version number is too large or too small. Therefore, the second Bluetooth protocol version number included in the second confirmation request can directly be the Bluetooth protocol version number of the Bluetooth protocol supported by the electronic device. In this way, the second data connection channel between the electronic device and the second Bluetooth device can be guaranteed to transmit media data.
[0012] In a possible implementation of the first aspect, an electronic device includes a host, a classic Bluetooth controller, and a low-power Bluetooth controller. In response to an operation to enable a Bluetooth function, the electronic device broadcasts an inquiry request message, and a process of entering a scanning state includes: in response to the operation to enable the Bluetooth function, the host sends a first command to the classic Bluetooth controller and sends a second command to the low-power Bluetooth controller; in response to the first command, the classic Bluetooth controller broadcasts the inquiry request message; and in response to the second command, the low-power Bluetooth controller enters a scanning state.
[0013] In the above implementation process, the host sends the first command and the second command to the classic Bluetooth controller and the low-power Bluetooth controller respectively, so that the classic Bluetooth controller and the low-power Bluetooth controller can respectively execute the action of scanning Bluetooth devices, thereby ensuring that the electronic device can scan classic Bluetooth devices and low-power Bluetooth devices at the same time.
[0014] In a second aspect, the present application provides a Bluetooth connection method, which is applied to an electronic device. In response to an operation of turning on the Bluetooth function, the electronic device can scan for Bluetooth devices in a discoverable state. In response to an operation on a target Bluetooth device among the scanned Bluetooth devices, the electronic device establishes a data connection channel with the target Bluetooth device, and sends a confirmation request to the target Bluetooth device through the data connection channel, wherein the confirmation request includes a target Bluetooth protocol version number, and the target Bluetooth protocol version number is related to the protocol type of the Bluetooth protocol of the target Bluetooth device; the confirmation request is used to request the target Bluetooth device to confirm the Bluetooth protocol version number of the electronic device; and negotiate with the target Bluetooth device a Bluetooth protocol for transmitting media data to transmit the media data through the data connection channel.
[0015] In the above implementation, a discoverable Bluetooth device refers to a Bluetooth device that can receive an inquiry request message sent by an electronic device, or a Bluetooth device that can send a low-power Bluetooth broadcast message to an electronic device that enters a scanning state.
[0016] In the above implementation, the target Bluetooth protocol version number included in the request confirmation is related to the protocol type of the Bluetooth protocol of the target Bluetooth device. Therefore, after the electronic device sends the confirmation request through the data connection channel established between the electronic device and the target Bluetooth device, the target Bluetooth device can feedback a message to the electronic device, ensuring that the electronic device can continue to communicate with the target Bluetooth device and that media data can be transmitted between the electronic device and the target Bluetooth device through the data connection channel. In this way, the connection success rate between the electronic device and the target Bluetooth device can be improved.
[0017] In a possible implementation of the second aspect, when the protocol type of the Bluetooth protocol of the target Bluetooth device is classic Bluetooth, the target Bluetooth protocol version number is a pre-set Bluetooth protocol version number; when the protocol type of the Bluetooth protocol of the target Bluetooth device is low power Bluetooth, the target Bluetooth protocol version number is the Bluetooth protocol version number of the Bluetooth protocol of the electronic device.
[0018] If the target Bluetooth device's Bluetooth protocol type is Classic Bluetooth, the target Bluetooth device will determine whether the target Bluetooth protocol version number is greater than a preset threshold. If the target Bluetooth protocol version number is greater than the preset threshold, the target Bluetooth device will not confirm the Bluetooth protocol version number of the electronic device. In other words, the target Bluetooth device will not send feedback to the electronic device in response to the confirmation request. As a result, the electronic device and the target Bluetooth device will not be able to continue communicating. Therefore, if the target Bluetooth device's Bluetooth protocol type is Classic Bluetooth, the target Bluetooth protocol version number in the confirmation request can be set to a pre-set Bluetooth protocol version number to ensure that the target Bluetooth device will send feedback to the electronic device based on the confirmation request.
[0019] If the target Bluetooth device's Bluetooth protocol type is Bluetooth Low Energy, the target Bluetooth device will directly feedback a response to the electronic device after receiving the confirmation request. Therefore, if the target Bluetooth device's Bluetooth protocol type is Bluetooth Low Energy, the target Bluetooth protocol version number in the confirmation request can directly be the Bluetooth protocol version number of the electronic device's Bluetooth protocol.
[0020] In this way, it can be ensured that the electronic device sends a confirmation request according to the protocol type of the Bluetooth protocol of the target Bluetooth device, so as to ensure that the electronic device can receive the message fed back by the target Bluetooth device based on the confirmation request.
[0021] In one possible implementation of the second aspect, before sending a confirmation request to the target Bluetooth device via the data connection channel, the method further includes: determining the protocol type of the Bluetooth protocol of the target Bluetooth device based on the manner in which the target Bluetooth device is scanned. The manner in which the electronic device scans for classic Bluetooth devices differs from the manner in which it scans for low-power Bluetooth devices. Therefore, the electronic device can directly and accurately determine the protocol type of the Bluetooth protocol of the target Bluetooth device based on the manner in which the target Bluetooth device is scanned. Thus, a confirmation request is sent based on the protocol type of the target Bluetooth device, ensuring communication between the electronic device and the target Bluetooth device.
[0022] In a possible implementation of the second aspect, the process of an electronic device scanning a Bluetooth device in a discoverable state is as follows: the electronic device broadcasts an inquiry request message and enters a scanning state. The electronic device can scan for classic Bluetooth devices by broadcasting an inquiry request message; the electronic device that enters the scanning state can scan for low-power Bluetooth devices. Subsequently, based on the manner in which the target Bluetooth device is scanned, the electronic device determines the protocol type of the Bluetooth protocol of the target Bluetooth device. The process includes: if an inquiry response message is received from the target Bluetooth device, the electronic device determines that the protocol type of the Bluetooth protocol of the target Bluetooth device is classic Bluetooth; if a low-power Bluetooth broadcast message is received from the target Bluetooth device, the electronic device determines that the protocol type of the Bluetooth protocol of the target Bluetooth device is low-power Bluetooth.
[0023] In this way, the electronic device can determine the protocol type of the Bluetooth protocol of the target Bluetooth device by scanning the target Bluetooth device, so as to send a confirmation request according to the protocol type of the target Bluetooth device to ensure communication between the electronic device and the target Bluetooth device.
[0024] In a possible implementation of the second aspect, the electronic device includes a host, a classic Bluetooth controller, and a low-power Bluetooth controller; in response to an operation to turn on the Bluetooth function, the electronic device broadcasts an inquiry request message, and the process of entering a scanning state includes: in response to the operation to turn on the Bluetooth function, the host sends a first command to the classic Bluetooth controller and sends a second command to the low-power Bluetooth controller; in response to the first command, the classic Bluetooth controller broadcasts an inquiry request message; in response to the second command, the low-power Bluetooth controller enters a scanning state.
[0025] In the above implementation process, the host sends the first command and the second command to the classic Bluetooth controller and the low-power Bluetooth controller respectively, so that the classic Bluetooth controller and the low-power Bluetooth controller can respectively execute the action of scanning Bluetooth devices, thereby ensuring that the electronic device can scan classic Bluetooth devices and low-power Bluetooth devices at the same time.
[0026] In a third aspect, the present application provides an electronic device, which includes a Bluetooth module, a memory and one or more processors; the Bluetooth module, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the method of the first aspect and any possible design method thereof, or the method of the second aspect and any possible involving method thereof.
[0027] In a fourth aspect, the present application provides a computer-readable storage medium comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method of the first aspect and any possible design thereof, or the method of the second aspect and any possible involving thereof.
[0028] In a fifth aspect, the present application provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, enables the electronic device to execute the method described in the first aspect and any possible design method thereof, or the method described in the second aspect and any possible involving method thereof.
[0029] In a sixth aspect, the present application provides a device, which is included in an electronic device, and has the function of implementing the electronic device behavior in any of the above aspects and possible implementation methods. This function can be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes at least one module or unit corresponding to the above function. For example, a broadcast module or unit, a scanning module or unit, a determination module or unit, and a storage module or unit, etc.
[0030] In a seventh aspect, an embodiment of the present application provides a chip system, which includes a processor and may also include a memory, for implementing any one of the methods provided in aspects 3 to 5 above. The chip system may be composed of a chip or may include a chip and other discrete devices.
[0031] It can be understood that the electronic device described in the third aspect and any possible design method provided above, the computer-readable storage medium described in the fourth aspect, and the computer program product described in the fifth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of the structure of a Bluetooth communication system provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a Bluetooth connection interaction provided in an embodiment of the present application Figure 1 ;
[0034] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of a Bluetooth core system of a Bluetooth device provided in an embodiment of the present application;
[0036] Figure 5A flowchart of a Bluetooth connection method provided in an embodiment of the present application;
[0037] Figure 6 An operation diagram of a Bluetooth connection method provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of a Bluetooth connection interaction provided in an embodiment of the present application Figure 2 ;
[0039] Figure 8 A schematic diagram of a Bluetooth connection interaction provided in an embodiment of the present application Figure 3 . DETAILED DESCRIPTION
[0040] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0041] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0042] Before introducing the embodiments of the present application, the technologies involved in the embodiments of the present application are first introduced in detail.
[0043] Bluetooth is a technology that enables short-range wireless communication via radio waves. Bluetooth technology is often used to transmit data between electronic devices over a short distance.
[0044] Bluetooth is generally categorized by protocol type into two types: classic Bluetooth and Bluetooth low energy (BLE). Classic Bluetooth refers to Bluetooth that supports Bluetooth basic rate or enhanced data rate, and is therefore also called BR Bluetooth or EDR Bluetooth. Bluetooth low energy is also known as LE (low energy) Bluetooth.
[0045] Bluetooth devices can be divided into dual-mode Bluetooth devices and single-mode Bluetooth devices according to their support for Bluetooth protocols. Dual-mode Bluetooth devices refer to Bluetooth devices that support both classic Bluetooth and low-power Bluetooth, while single-mode Bluetooth devices refer to Bluetooth devices that only support classic Bluetooth or only support low-power Bluetooth.
[0046] Bluetooth technology effectively simplifies communication between devices such as desktop computers, laptops, and mobile communication terminals. Furthermore, Bluetooth technology also simplifies communication between these devices and the internet, making data transmission between these devices and the internet faster and more efficient. Consequently, most current devices support Bluetooth.
[0047] The power consumption of Bluetooth Low Energy is lower than that of Classic Bluetooth, but the transmission speed of Classic Bluetooth is higher than that of Bluetooth Low Energy. Therefore, the type of Bluetooth supported in general terminal devices is determined according to their usage scenarios and usage requirements. For example, in general, terminal devices that require low power consumption, such as smart bracelets, generally support Bluetooth Low Energy. Bluetooth devices that support Bluetooth Low Energy can be called Bluetooth Low Energy devices. Terminal devices that require high transmission speeds and transmit large amounts of data, such as in-vehicle devices, generally support Classic Bluetooth. Bluetooth devices that support Classic Bluetooth can be called Classic Bluetooth devices. The above-mentioned low-power Bluetooth devices and classic Bluetooth devices are both called single-mode Bluetooth devices. Terminal devices that are commonly used to connect to different types of Bluetooth devices, such as mobile phones and tablets, generally support both Classic Bluetooth and Bluetooth Low Energy at the same time and are dual-mode Bluetooth devices.
[0048] like Figure 1 As shown in the figure, a mobile phone is a dual-mode Bluetooth device, a car device is a classic Bluetooth device, and a smart bracelet is a low-power Bluetooth device. The mobile phone can connect to the car device via classic Bluetooth, and can also connect to the smart bracelet via low-power Bluetooth.
[0049] Generally speaking, a higher version of the Bluetooth protocol is compatible with a lower version of the Bluetooth protocol, so a Bluetooth device using a higher version of the Bluetooth protocol can connect to a Bluetooth device using a lower version of the Bluetooth protocol. Figure 1 The Bluetooth protocol version of the mobile phone is 5.4. Figure 1 The Bluetooth protocol version of the vehicle device is 4.2, and Figure 1 If the Bluetooth protocol version of the smart bracelet is 5.3, the mobile phone and the car device can be connected through the Bluetooth protocol version 4.2, and the mobile phone and the smart bracelet can be connected through the Bluetooth protocol version 5.3.
[0050] However, currently, when a Bluetooth device using a higher version of the Bluetooth protocol is connected to a Bluetooth device using a lower version of the Bluetooth protocol, there is a problem of connection failure.
[0051] For example, Figure 2 As shown, device M and device N are connected via Bluetooth. Device M's Bluetooth protocol version is 5.4, while device N's Bluetooth protocol version is 4.2. After device N receives the inquiry request sent by device M, device N sends an inquiry response to device M, indicating that device M has discovered device N. After receiving the inquiry response from device N, device M can send a data connection channel establishment paging request to device N. Device N then sends a data connection channel establishment paging response back to device M, completing the data connection channel establishment. After the data connection channel is established, data can be transmitted between devices M and N.
[0052] The above-mentioned data connection channel is also called a physical link. The data connection channel established through Bluetooth technology includes an asynchronous connectionless link (ACL) and a synchronous connection-oriented link (SCO). ACL is used to transmit data that is not sensitive to time requirements, such as file data and control signaling, while SCO is used to transmit time-sensitive communications, such as voice data. The data connection channel established in the above embodiment may include one physical link, or multiple physical links of the same type or different types. The number and type of physical links included in the data connection channel established between two Bluetooth devices are determined by the specific usage scenario.
[0053] like Figure 2As shown, after establishing a data connection channel, device M sends a Bluetooth protocol version number confirmation request A to device N. The Bluetooth protocol version number confirmation request A includes the version number of the Bluetooth protocol used by device M. After device N receives the version number of the Bluetooth protocol used by device M, it compares the version numbers of the Bluetooth protocols used by device M and device N, and determines whether to respond to the Bluetooth protocol version number confirmation request A sent by device M based on the judgment result. Specifically, if device N determines that the Bluetooth protocol version number used by device N is 4.2, which is lower than the Bluetooth protocol version number 5.4 used by device M, device N does not respond to the Bluetooth protocol version number confirmation request A sent by device M. As a result, the data connection channel between device M and device N is disconnected, and subsequent Bluetooth pairing between device M and device N is no longer possible.
[0054] In order to avoid the problem of connection failure between Bluetooth devices, an embodiment of the present application provides the following Bluetooth connection method. After turning on the Bluetooth function, the electronic device can scan other Bluetooth devices. When the user selects a target Bluetooth device among the scanned Bluetooth devices, the electronic device can establish a data connection channel for transmitting data between the electronic device and the target Bluetooth device. Afterwards, the electronic device can send a Bluetooth protocol version number confirmation request to the target Bluetooth device through the data connection channel based on the Bluetooth type supported by the target Bluetooth device. The Bluetooth protocol version number included in the Bluetooth protocol version number confirmation request is related to the type of Bluetooth protocol supported by the target Bluetooth device. In the case where the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is classic Bluetooth, the Bluetooth protocol version number included in the Bluetooth protocol version number confirmation request is a pre-set first version number. In the case where the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is low power Bluetooth, the Bluetooth protocol version number included in the Bluetooth protocol version number confirmation request is a second version number. Wherein, the second version number is the version number of the Bluetooth protocol adopted by the electronic device.
[0055] In some embodiments, the first version number is less than the second version number.
[0056] In order to better understand the embodiments of the present application, the terminal device provided in the embodiments of the present application is first introduced.
[0057] The Bluetooth connection method provided in the embodiment of the present application can be applied to an electronic device 100. The electronic device 100 can specifically be a mobile phone, a tablet computer, a smart screen, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device, or other electronic device with Bluetooth functionality. The embodiment of the present application does not limit the specific type of the electronic device 100 or the operating system installed.
[0058] Figure 3 : The figure shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195.
[0059] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0060] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0061] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0062] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0063] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0064] It is understandable that the electronic device 100 may adopt different interface connection modes in the above embodiments, or a combination of multiple interface connection modes.
[0065] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.
[0066] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0067] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network.
[0068] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.
[0069] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs sound signals through an audio device (including but not limited to the speaker 170A, the receiver 170B, etc.) or displays images or videos through the display screen 194.
[0070] The wireless communication module 160 can provide wireless communication solutions for application on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0071] Wireless communication module 160 can be one or more devices that integrate at least one communication processing module. Wireless communication module 160 receives electromagnetic waves via antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to processor 110. Wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0072] In some embodiments, the Bluetooth function is specifically performed by the Bluetooth core system in the electronic device (such as a mobile phone, a smart bracelet, and a car device). In the embodiment of the present application, for ease of understanding, the Bluetooth core system of the electronic device is simplified as Figure 4 The structure shown. Figure 4 As shown in the figure, the Bluetooth core system can be abstracted into a Bluetooth host (HOST), a Bluetooth controller (controller), and a host controller interface (HCI). The Bluetooth core system of a dual-mode Bluetooth device includes a host and two controllers: a classic Bluetooth controller for performing classic Bluetooth operations and a low-power Bluetooth controller for performing low-power Bluetooth operations.
[0073] The host can be understood as the Bluetooth application layer (user application). In the case of a mobile phone, the host in the phone's Bluetooth core system can be understood as the Bluetooth application. After the phone receives a user's input on the Bluetooth function, the host in the phone can respond to the user's input by sending a corresponding command to the controller. Accordingly, the controller can be understood as a logical entity, a Bluetooth chip, that can execute commands issued by the host and return return value events to the host.
[0074] Communication between the host and controller is based on the HCI. Specifically, the host sends commands to the controller via the HCI. Events returned by the controller are notified to the host via the HCI. In other words, the HCI acts as an intermediate layer. The commands and events transmitted between the host and controller are defined by the HCI protocol in the Bluetooth protocol specification. In addition, communication between Bluetooth devices is achieved through over-the-air communication between the controllers of the two Bluetooth devices. The over-the-air communication is defined by the link manager protocol (LMP) or the link layer protocol (LL).
[0075] In some examples, the processor 110 may include the aforementioned host, and the wireless communication module 160 may include the aforementioned Bluetooth chip. The processor 110 may send commands to the wireless communication module 160 for scanning and connecting to Bluetooth devices. The wireless communication module 160 transmits or receives electromagnetic waves via the antenna 2 to scan or connect to Bluetooth devices via electromagnetic waves, thereby achieving communication between the electronic device and other Bluetooth devices.
[0076] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0077] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
[0078] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0079] The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture still images or videos.
[0080] In some embodiments, an object's optical image is projected onto a photosensitive element through the lens of camera 193. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format, such as RGB or YUV. In some embodiments, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than one.
[0081] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0082] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0083] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0084] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function.
[0085] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0086] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, speakers, receivers, microphones, headphone jacks, and application processors.
[0087] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. The speaker, also known as a "speaker", is used to convert audio electrical signals into sound signals. The receiver, also known as a "handset", is used to convert audio electrical signals into sound signals. The microphone, also known as a "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack is used to connect wired headphones. The headphone jack can be a USB interface 130, or it can be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0088] The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor 180K, an ambient light sensor, a bone conduction sensor, and the like.
[0089] The touch sensor 180K, also known as a "touch panel," can be mounted on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen." The touch sensor 180K detects touch operations applied to or near the touch sensor. The touch sensor transmits the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194.
[0090] The buttons 190 include a power button, a volume button, and the like.
[0091] Motor 191 can generate vibration prompts.
[0092] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0093] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the electronic device 100 by inserting or removing the SIM card into or from the SIM card interface 195. The electronic device 100 may support one or N SIM card interfaces, where N is a positive integer greater than one.
[0094] The following describes the Bluetooth connection method provided in the embodiments of the present application with reference to the accompanying drawings.
[0095] Figure 5 This application provides a flow chart of a Bluetooth connection method. Figure 5 As shown, the method may include:
[0096] S501: In response to an operation of turning on a Bluetooth function, scan Bluetooth devices and determine the Bluetooth type of the Bluetooth protocol supported by the Bluetooth devices.
[0097] In some embodiments, when the electronic device is a dual-mode Bluetooth device, the electronic device can perform classic Bluetooth scanning and low-power Bluetooth scanning at the same time in response to the operation of turning on the Bluetooth function. The following is an example of a mobile phone with a dual-mode Bluetooth device. Figure 6 As shown, the mobile phone displays the Bluetooth setting interface. In response to the user's operation on the Bluetooth function opening control, such as clicking, the mobile phone turns on the Bluetooth function and initiates BR scanning and BLE scanning. Through scanning, the mobile phone can scan other Bluetooth devices in a discoverable state. Figure 6 As shown, after turning on the Bluetooth function, the Bluetooth settings interface can display a Bluetooth device list, which includes the identifiers of the scanned Bluetooth devices. For example, if the phone scans device N, device P, and device O, the Bluetooth device list will include device N, device P, and the device name of the device.
[0098] In the above embodiment, the user's operation of turning on the Bluetooth function control can be the operation of turning on the Bluetooth function in this application. In the above embodiment, the action of the electronic device performing classic Bluetooth scanning can be the action of the electronic device broadcasting an inquiry request message in this application, and the action of the electronic device performing low-power Bluetooth scanning can be the action of the electronic device entering a scanning state in this application.
[0099] In some embodiments, the host of an electronic device sends a scan command to a controller to discover other Bluetooth devices. In response to turning on Bluetooth, the host can send a command to the controller instructing it to scan for Bluetooth devices. After receiving the command, the controller begins scanning for Bluetooth devices.
[0100] Table 1 provides a brief comparison between classic Bluetooth and Bluetooth low energy:
[0101] Table 1
[0102]
[0103] As shown in Table 1 above, the scanning methods, host connection commands, and controller connection methods are all different between classic Bluetooth and low-power Bluetooth. Therefore, classic Bluetooth devices can only connect to classic Bluetooth devices, low-power Bluetooth devices can only connect to low-power Bluetooth devices, and dual-mode Bluetooth devices can connect to both classic Bluetooth devices and low-power Bluetooth devices.
[0104] Exemplarily, when a classic Bluetooth device scans a Bluetooth device in a discoverable state in an inquiry manner, the classic Bluetooth device sends an inquiry request message to the outside. When a low-power Bluetooth device scans a Bluetooth device in a discoverable state in a low-power scanning manner, the low-power Bluetooth device is in a low-power scanning state and does not send a request to the outside. Accordingly, a classic Bluetooth device in a discoverable state can receive an inquiry request message sent by the classic Bluetooth, so the classic Bluetooth device can scan other classic Bluetooth devices through the inquiry scanning manner. In addition, a low-power Bluetooth device in a discoverable state broadcasts a low-power Bluetooth broadcast message to the outside, so that a low-power Bluetooth device in a low-power scanning state can receive a low-power Bluetooth broadcast message, so the low-power Bluetooth device can scan other low-power Bluetooth devices through the low-power scanning manner.
[0105] That is to say, when the electronic device is a dual-mode Bluetooth device, the electronic device with the Bluetooth function turned on uses two different scanning methods to scan to ensure that the electronic device can scan classic Bluetooth devices and low-power Bluetooth devices in a discoverable state. Correspondingly, when the electronic device is a single-mode Bluetooth device that only supports classic Bluetooth, the electronic device with the Bluetooth function turned on only uses the inquiry scanning method to scan classic Bluetooth devices in a discoverable state. When the electronic device is a single-mode Bluetooth device that only supports low-power Bluetooth, the electronic device with the Bluetooth function turned on only uses the low-power scanning method to scan low-power Bluetooth devices in a discoverable state.
[0106] In some embodiments, when the electronic device is a dual-mode Bluetooth device, in response to the operation of turning on the Bluetooth function, the HOST of the electronic device sends corresponding scanning commands to the classic Bluetooth controller and the low-power Bluetooth controller, respectively, to instruct the classic Bluetooth controller and the low-power Bluetooth controller to scan other Bluetooth devices in a discoverable state.
[0107] In some examples, the electronic device uses an inquiry scanning method to scan Bluetooth devices. The specific implementation is as follows: the host in the electronic device sends a classic Bluetooth scan command to the classic Bluetooth controller to instruct the classic Bluetooth controller to send a classic Bluetooth inquiry request message. Exemplarily, the classic Bluetooth scan command can be an inquiry command (inquiry command), for example, the inquiry command is: 01 04 05 33 8B 9E 0A 00. After receiving the classic Bluetooth scan command, the classic Bluetooth controller sends a classic Bluetooth inquiry request message, for example, a classic Bluetooth inquiry data packet. The format of the classic Bluetooth inquiry data packet is fixed and has no payload. Exemplarily, the format of the classic Bluetooth inquiry data packet is generally an ID packet.
[0108] The classic Bluetooth scan command sent by the HOST to the classic Bluetooth controller is the first command in this application.
[0109] After receiving the Classic Bluetooth inquiry request message, the peer Bluetooth device sends a Classic Bluetooth inquiry feedback message to the electronic device. The peer Bluetooth device refers to the Bluetooth device that receives the Classic Bluetooth inquiry request message sent by the electronic device. It is understood that the peer Bluetooth device can receive the Classic Bluetooth inquiry request message and send a Classic Bluetooth inquiry feedback message. Therefore, the peer Bluetooth device is a Classic Bluetooth device scanned using the inquiry scanning method.
[0110] In the above embodiment, the peer Bluetooth device may be the first Bluetooth device in this application, and the classic Bluetooth inquiry request message may be the inquiry request message in this application.
[0111] For example, after receiving a classic Bluetooth inquiry data packet of type ID packet, the peer Bluetooth device may reply with a classic Bluetooth inquiry response data packet. For example, the inquiry response data packet replied by the peer Bluetooth device may be an FHS (FHS is the abbreviation of frequency-hopping spread, which means frequency hopping technology in Chinese) packet. The FHS packet is a control packet that includes the Bluetooth device address and the Bluetooth device clock. Generally, a Bluetooth device sends an FHS packet to another Bluetooth device to ensure that the clocks and frequency hopping are consistent between the two Bluetooth devices. In addition, after receiving a data packet sent by another device, the Bluetooth device sends an FHS packet for response to the other Bluetooth device. Specifically, the FHS packet sent by the peer Bluetooth device may be: 10 9C 01F9 FD 78B3 9B D6 70 94 83FB A0 0C 42 5A 28 20 00 00 11 1A.
[0112] The electronic device then receives the Classic Bluetooth query feedback message from the peer Bluetooth device. Specifically, the Classic Bluetooth controller in the electronic device receives the Classic Bluetooth query feedback packet from the peer Bluetooth device. The Classic Bluetooth controller in the electronic device then sends the received Classic Bluetooth query feedback packet to the host in the electronic device. At this point, the electronic device has scanned the peer Bluetooth device.
[0113] In some examples, the specific implementation of the electronic device using low-power scanning to scan Bluetooth devices is as follows: the HOST in the electronic device sends a low-power Bluetooth scan command to the low-power Bluetooth controller to indicate that the low-power Bluetooth controller is in a state of listening to low-power Bluetooth broadcast messages. Exemplarily, the low-power Bluetooth scan command can be a low-power scan (BLE scan) command, and the BLE scan command can be a LE set extended scan enable command (LE set extended scan enable command). For example, the LE set extended scan enable command is: 4220 06 01 00 00 00 00 00. After receiving the low-power Bluetooth scan command, the low-power Bluetooth controller enters a state of listening to low-power Bluetooth broadcast messages. The low-power Bluetooth controller in the state of listening to low-power Bluetooth broadcast messages can listen to low-power Bluetooth broadcast messages sent by other low-power Bluetooth devices in a discoverable state.
[0114] The low-power Bluetooth scan command sent by the HOST to the low-power Bluetooth controller is the second command in this application.
[0115] Among them, a low-power Bluetooth device in a discoverable state can periodically broadcast a low-power Bluetooth broadcast message to the outside world. Exemplarily, the low-power Bluetooth broadcast message can be a low-power Bluetooth broadcast packet, such as a connectable undirected adv packet. For example, the connectable undirected adv packet can be: 40 23AB 5D DF 75AC F7 02 01 06 19 16 95FE 58 40 3B 02 66AB 5D DF 75AC F7ED D3 BB 0F DB 7DDC F1 49 33 74D5 EC 49.
[0116] Afterwards, the electronic device can receive the Bluetooth Low Energy broadcast message broadcast by the peer Bluetooth device in the discoverable state. Specifically, the Bluetooth Low Energy controller in the electronic device can monitor the Bluetooth Low Energy broadcast packet sent by the peer Bluetooth device. Afterwards, the Bluetooth Low Energy controller in the electronic device sends the received Bluetooth Low Energy broadcast packet to the host in the electronic device. At this point, the electronic device has scanned the peer Bluetooth device.
[0117] Optionally, after receiving a Bluetooth low energy broadcast message broadcast by a peer Bluetooth device in a discoverable state, the electronic device may send a scan confirmation message to confirm whether the peer Bluetooth device is the Bluetooth device that sent the Bluetooth low energy broadcast message. This can avoid the situation where the peer Bluetooth device immediately shuts down, turns off its Bluetooth function, or exceeds a preset connection distance after sending the Bluetooth low energy broadcast message, resulting in the electronic device being unable to establish a connection with the peer Bluetooth device.
[0118] In some examples, after a Bluetooth low energy controller that is listening for Bluetooth low energy broadcast messages receives a Bluetooth low energy broadcast packet, it sends the Bluetooth low energy broadcast packet to a host. Subsequently, the host sends a scan confirmation command to the Bluetooth low energy controller, enabling the Bluetooth low energy controller to send a scan confirmation message to a peer Bluetooth device. For example, the scan confirmation message sent by the Bluetooth low energy controller may be a scan request packet, such as the following: C3 0C 88 23CD 62 73 6B AB 5D DF75AC F7 E6 38 66. After receiving the scan confirmation message, the peer Bluetooth device responds with a scan response message to the electronic device. For example, based on the received scan request packet, the peer Bluetooth device responds with a scan response packet, such as the following: 44 0A AB 5D DF75AC F7 03FF 8F 03 4F C9 EF.
[0119] In some embodiments, after scanning a Bluetooth device, the electronic device can determine whether the Bluetooth device is a classic Bluetooth device or a low-power Bluetooth device based on the process of scanning the Bluetooth device. In other words, during the process of scanning the Bluetooth device, the electronic device can determine the Bluetooth type of the Bluetooth protocol supported by the scanned Bluetooth device based on the process of scanning the Bluetooth device.
[0120] In some examples, the electronic device can determine whether the Bluetooth device is a classic Bluetooth device or a low-power Bluetooth device based on the messages exchanged between the Bluetooth device and the electronic device during the process of scanning Bluetooth devices. For example, the electronic device scans device N and device P. In the process of scanning device N, the electronic device receives an inquiry feedback message sent by device N and confirms that device N has been scanned. Since the inquiry feedback message is an interactive message in the scanning mode of the classic Bluetooth device, the electronic device can confirm that device N is a classic Bluetooth device, that is, confirm that the Bluetooth type of the Bluetooth protocol supported by device N is classic Bluetooth. In the process of scanning device P, the electronic device receives a low-power Bluetooth broadcast message sent by device P and confirms that device P has been scanned. Since the low-power Bluetooth broadcast message is an interactive message in the scanning mode of the low-power Bluetooth device, the electronic device can confirm that device P is a low-power Bluetooth device, that is, confirm that the Bluetooth type of the Bluetooth protocol supported by device N is low-power Bluetooth.
[0121] In the above embodiment, device N may be the first Bluetooth device in this application, and device P may be the second Bluetooth device in this application.
[0122] S502: In response to the selection operation of the target Bluetooth device, a data connection channel is established with the target Bluetooth device.
[0123] In some embodiments, after the mobile phone scans the Bluetooth devices, it can determine the target Bluetooth device from the scanned Bluetooth devices. In some examples, such as Figure 6 As shown, the mobile phone displays a Bluetooth device list in the display interface, and the Bluetooth device list includes the identifiers of all Bluetooth devices scanned by the mobile phone. Afterwards, in response to the user selecting an identifier of a Bluetooth device in the Bluetooth device list, the mobile phone can determine the Bluetooth device selected by the user as the target Bluetooth device. For example, Figure 6 As shown, the user wants to use device N in the Bluetooth device list as the target Bluetooth device, so the user can click the identifier of device N. In response to the user's operation on the identifier of device N, the electronic device can use device N as the target Bluetooth device.
[0124] In some embodiments, after the electronic device determines the target Bluetooth device, it can establish a data connection channel with the target Bluetooth device. Specifically, the electronic device can send a data connection channel establishment request to the target Bluetooth device, and after receiving a data connection channel establishment feedback sent by the target Bluetooth device, establish the data connection channel with the target Bluetooth device.
[0125] As can be seen from the above embodiments, after scanning a Bluetooth device, the electronic device can determine the Bluetooth type of the Bluetooth protocol supported by the Bluetooth device. Therefore, the electronic device can also determine the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device selected by the user. The electronic device can then send a request to the target Bluetooth device for establishing a data connection channel based on the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device.
[0126] In some examples, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is Classic Bluetooth, the specific implementation of the electronic device sending the data connection channel establishment request to the target Bluetooth device is as follows:
[0127] First, the electronic device sends a paging request message to the target Bluetooth device. This paging request message is used to page the target Bluetooth device. Specifically, the paging request message can be Data Packet 1, which includes the Low Address Part (LAP) of the target Bluetooth device to ensure that the target Bluetooth device can receive Data Packet 1. Generally, each Bluetooth device corresponds to one LAP, and different Bluetooth devices have different LAPs.
[0128] After receiving the paging request message, the target Bluetooth device sends a paging response message back to the electronic device. Specifically, the paging response message can be Data Packet 2, which includes the electronic device's LAP to ensure that the electronic device can receive Data Packet 2. The electronic device's receipt of Data Packet 2 indicates that the target Bluetooth device can establish a data connection channel with the electronic device.
[0129] Afterwards, the electronic device sends a Classic Bluetooth connection channel establishment request message to the target Bluetooth device. The Classic Bluetooth connection channel establishment request message is used to request to establish a data connection channel with the target Bluetooth device. Specifically, the Classic Bluetooth connection channel establishment request message can be an FHS packet, for example, the FHS packet is: 90 4A 03AA 8B D0 9D 45 11 12 94B5F0 68 0C02 5A 81 0D 43 01B5 81.
[0130] After receiving the Classic Bluetooth connection channel establishment request message, the target Bluetooth device feeds back a Classic Bluetooth connection channel establishment response message to the electronic device. The Classic Bluetooth connection channel establishment response message is used to indicate that the target Bluetooth device confirms the establishment of a data connection channel with the electronic device. Specifically, the Classic Bluetooth connection channel establishment response message can be data packet 3.
[0131] At this point, the data connection channel between the electronic device and the target Bluetooth device that supports the Bluetooth protocol of Classic Bluetooth is successfully established.
[0132] In the above embodiment, the HOST of the electronic device can send a connection establishment message to the classic Bluetooth controller to instruct the classic Bluetooth controller to send a data connection channel establishment request. For example, according to Table 1 of the above embodiment, the connection command used by the host of the classic Bluetooth is the HCI create connection command, and the controller connection mode of the classic Bluetooth is the paging mode. Then, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is classic Bluetooth, the connection establishment message sent by the HOST of the electronic device to the classic Bluetooth controller is the HCI create connection command. After the classic Bluetooth controller receives the HCI create connection command, the data connection channel establishment request sent to the target Bluetooth device is a paging request message.
[0133] In the above embodiment, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is classic Bluetooth, the data connection channel established between the electronic device and the target Bluetooth device is the first data connection channel in this application, and is also the target data connection channel in this application.
[0134] In some examples, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is Bluetooth Low Energy, the specific implementation of the electronic device sending the data connection channel establishment request to the target Bluetooth device is as follows:
[0135] First, the electronic device sends a first low-power connection request message to the target Bluetooth device. The first low-power connection request message is used to indicate that the electronic device is ready to establish a data connection channel with the target Bluetooth device. Exemplarily, the first low-power connection request message sent by the electronic device may include a transmission time, indicating that the electronic device will send the next message at the transmission time. Specifically, the first low-power connection request message may be a connection indication packet. For example, the connection indication packet may be:
[0136] C5 22 38 5F 21 0D E8 74AB 5D DF 75AC F7 C9 B4 85 84 9F CC 31 01
[0137] 16 00 18 00 00 00F4 01 03 08 00FE 1F B0 FA 67 24
[0138] Afterwards, the electronic device continues to send a second low-power connection request message to the target Bluetooth device. The second low-power connection request message is used to indicate that the electronic device needs to exchange relevant parameters for establishing a data connection channel with the target Bluetooth device. Specifically, the second low-power connection request message can be a link layer control protocol feature exchange message (link layer control protocol feature exchange), which can include parameters for the electronic device to establish a data connection channel with the target Bluetooth device. For example, LLCP feature exchange can be: 03 0908FF F9 01F7 FF 00 00 00 4B1F 25.
[0139] After the target Bluetooth device receives the first low-power connection request message, it can prepare to receive the second low-power connection request message according to the first low-power connection request message. Afterwards, after the target Bluetooth device receives the second low-power connection request message, it can feedback a low-power connection response message to the electronic device. The low-power connection response message is used to indicate that the target Bluetooth device agrees to establish a data connection channel with the electronic device. The low-power connection response message can be a link layer control protocol feature response (link layer control protocol feature respons), for example, the LLCP feature respons can be: 0B 09 09 01 00 00 0000 00 00 00 25 86B5.
[0140] At this point, the data connection channel between the electronic device and the target Bluetooth device supporting the Bluetooth low energy protocol is successfully established.
[0141] In the above embodiment, the specific implementation of the electronic device sending the first low-power connection request message to the target Bluetooth device is: the HOST of the electronic device can send a connection establishment message to the low-power Bluetooth controller to instruct the low-power Bluetooth controller to send the first low-power connection request message. For example, according to Table 1 of the above embodiment, the connection command adopted by the host of the low-power Bluetooth is the low-power create connection (LE create connection) command, and the connection method of the controller of the low-power Bluetooth is the method of sending a connection packet (CONNECT_IND). Then, in the case that the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is low-power Bluetooth, the connection establishment message sent by the HOST of the electronic device to the low-power Bluetooth controller is the LE create connection command. After the low-power Bluetooth controller receives the LE create connection command, the first low-power connection request message sent to the target Bluetooth device is CONNECT_IND.
[0142] In the above embodiment, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is low-energy Bluetooth, the data connection channel established between the electronic device and the target Bluetooth device is the second data connection channel in this application, and is also the target data connection channel in this application.
[0143] After the data connection channel between the electronic device and the target Bluetooth device is successfully established, the electronic device may execute the following S503:
[0144] S503: Send a Bluetooth protocol version confirmation request to the target Bluetooth device via the data connection channel, wherein the Bluetooth protocol version confirmation request is related to the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device.
[0145] After a data connection channel is established between a classic Bluetooth device and an electronic device, the classic Bluetooth device will determine whether to continue communicating with the electronic device based on whether the version number of the Bluetooth protocol used by the electronic device is greater than the preset Bluetooth protocol version number. If the version number of the Bluetooth protocol used by the electronic device is greater than the preset Bluetooth protocol version number, the classic Bluetooth device will not respond to any subsequent requests sent by the electronic device. This will cause the data connection channel between the electronic device and the classic Bluetooth device to be disconnected due to a long period of no data transmission. After a data connection channel is established between a low-power Bluetooth device and an electronic device, the low-power Bluetooth device will not determine whether to continue communicating with the electronic device based on the version number of the Bluetooth protocol used by the electronic device. In other words, the low-power Bluetooth device will respond to any request sent by the electronic device.
[0146] Based on the above reasons, when executing S503, the electronic device can send a Bluetooth protocol version number confirmation request related to the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device to the target Bluetooth device, so as to ensure that the target Bluetooth device can continue to respond to requests sent by subsequent electronic devices after receiving the Bluetooth protocol version number confirmation request, so as to ensure that the data connection channel is not disconnected.
[0147] In some embodiments, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is Classic Bluetooth, the Bluetooth protocol version number confirmation request sent by the electronic device to the target Bluetooth device includes a pre-set Bluetooth protocol version number. When the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is Bluetooth Low Energy, the Bluetooth protocol version number confirmation request sent by the electronic device to the target Bluetooth device includes the Bluetooth version number of the Bluetooth protocol actually adopted by the electronic device.
[0148] The pre-set Bluetooth protocol version number may be determined during development and testing based on the preset Bluetooth protocol version numbers to which all classic Bluetooth devices can respond. Specifically, the lowest preset Bluetooth protocol version number may be determined from the preset Bluetooth protocol version numbers to which all classic Bluetooth devices can respond as the pre-set Bluetooth protocol version number.
[0149] For example, during the development and testing process, there are three classic Bluetooth devices, each of which can respond to Bluetooth protocol versions 4.1, 4.3, and 5.0, respectively. 4.1 is the lowest preset Bluetooth protocol version number, so the electronic device can determine that 4.1 is the pre-set Bluetooth protocol version number. Then, if the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth is classic Bluetooth and the Bluetooth protocol version number actually used by the electronic device is 5.4, the Bluetooth protocol version number confirmation request sent by the electronic device to the target Bluetooth device includes the Bluetooth protocol version number 4.1.
[0150] For example, when the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is low-energy Bluetooth, and the Bluetooth version number of the Bluetooth protocol actually adopted by the electronic device is 5.4, the Bluetooth protocol version number confirmation request sent by the electronic device to the target Bluetooth device includes the Bluetooth protocol version number 5.4.
[0151] In the above embodiment, the electronic device sends a Bluetooth protocol version number confirmation request to the target Bluetooth device through the data connection channel, which is the target confirmation request in this application. In the case that the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is classic Bluetooth, the electronic device sends a Bluetooth protocol version number confirmation request to the target Bluetooth device through the data connection channel, which is the first confirmation request in this application; in the case that the Bluetooth type of the Bluetooth protocol supported by the target Bluetooth device is low-power Bluetooth, the electronic device sends a Bluetooth protocol version number confirmation request to the target Bluetooth device through the data connection channel, which is the second confirmation request in this application. The first Bluetooth protocol version number in the first confirmation request is a pre-set Bluetooth protocol version number, and the second Bluetooth protocol version number in the second confirmation request is the Bluetooth protocol version number of the Bluetooth protocol supported by the electronic device.
[0152] S504: In response to receiving the Bluetooth protocol version number confirmation feedback sent by the target Bluetooth device, send a Bluetooth protocol negotiation request for transmitting media data to the target Bluetooth device.
[0153] S505 : In response to receiving the Bluetooth protocol negotiation response sent by the target Bluetooth device, transmit the media data to the target Bluetooth device through the data connection channel.
[0154] In some embodiments, after the electronic device receives the Bluetooth protocol version number confirmation feedback sent by the target Bluetooth device, the electronic device and the target Bluetooth device can also negotiate the Bluetooth protocol used to transmit media data through the data connection channel to ensure that media data can be transmitted normally between the electronic device and the target Bluetooth device.
[0155] Among them, media data refers to the files, pictures, videos, audio and control instructions that users want to transmit.
[0156] In some examples, the electronic device determines the lower Bluetooth version number between the Bluetooth version number of the Bluetooth protocol adopted by the electronic device and the Bluetooth version number of the Bluetooth protocol adopted by the target Bluetooth device, and uses the Bluetooth protocol corresponding to the lower Bluetooth version number as the Bluetooth protocol for transmitting media data.
[0157] For example, the Bluetooth version number of the Bluetooth protocol actually adopted by the electronic device is 5.4, and the Bluetooth protocol version number confirmation feedback received by the electronic device from the target Bluetooth device includes the Bluetooth version number 4.2 of the Bluetooth protocol adopted by the target Bluetooth device. Then, the electronic device can send a Bluetooth protocol negotiation request message to the target Bluetooth device, and the Bluetooth protocol negotiation request message includes the Bluetooth version number 4.2 of the Bluetooth protocol. Afterwards, after receiving the Bluetooth protocol negotiation request message, the target Bluetooth device can send a Bluetooth protocol negotiation response to the electronic device, and the Bluetooth protocol negotiation response includes the Bluetooth version number 4.2 of the Bluetooth protocol, indicating that the target Bluetooth device agrees to use the Bluetooth protocol with Bluetooth version number 4.2 to transmit media data between the target Bluetooth device and the electronic device.
[0158] At this point, the electronic device and the target Bluetooth device can transmit media data through the data connection channel. Figure 6 As shown, when media data can be transmitted between the electronic device and the device N through the data connection channel, the identifier of the device N in the interface displayed by the electronic device corresponds to the connected identifier.
[0159] It is understandable that the Bluetooth protocol version number included in the Bluetooth protocol version number confirmation request sent by the electronic device to the target Bluetooth device and the Bluetooth protocol version number included in the Bluetooth protocol negotiation request message sent by the electronic device to the target Bluetooth device are unrelated. Specifically, the Bluetooth protocol version number included in the Bluetooth protocol version number confirmation request is related to the Bluetooth type of the target Bluetooth device, while the Bluetooth protocol version number included in the Bluetooth protocol negotiation request message is the lower Bluetooth version number of the Bluetooth protocol adopted by the electronic device and the Bluetooth protocol adopted by the target Bluetooth device.
[0160] The following, combined Figure 7 This section describes a classic Bluetooth connection method.
[0161] Figure 7 A schematic diagram of a Bluetooth connection interaction provided in an embodiment of the present application Figure 2 , device M can scan the classic Bluetooth device N, and, when selecting device N as the target Bluetooth device, can establish a Bluetooth connection with device N and transmit media data.
[0162] Device M is a dual-mode Bluetooth device, and device N is a classic Bluetooth device. After device M turns on the Bluetooth function, Figure 7 As shown, device M sends an inquiry request message to scan for discoverable Bluetooth devices. After device N receives the inquiry request message sent by device M, device N sends a query response message back to device M. Upon receiving the inquiry response message sent by device N, device M confirms that device N is the scanned Bluetooth device.
[0163] In the above process, since the inquiry response message is a scan confirmation message in the classic Bluetooth scanning process for Bluetooth devices, the device M can determine that the device N is a classic Bluetooth device.
[0164] After device M scans device N, in response to the user selecting device N as the target Bluetooth device, device M can send a data connection channel establishment request message to device N. Upon receiving the data connection channel establishment request message from device M, device N sends a data connection channel establishment response message to device M. At this point, the data connection channel between devices M and N is successfully established.
[0165] Through the data connection channel, device M can send a Bluetooth protocol version number confirmation request to device N. Since device N is a classic Bluetooth device, the Bluetooth protocol version number confirmation request sent by device M to device N includes a pre-set Bluetooth protocol version number. For example, when the Bluetooth protocol version number confirmation request sent by device M to device N includes a pre-set Bluetooth protocol version number of 4.2, device N determines that the Bluetooth version number 4.2 in the Bluetooth protocol version number confirmation request is less than the preset Bluetooth protocol version number 4.3, then device N can respond to any request sent by device M, that is, device N can feedback the Bluetooth protocol version number confirmation feedback to device M. In some examples, the Bluetooth protocol version number confirmation feedback fed back by device N to device M includes the Bluetooth version number of the Bluetooth protocol actually adopted by device N.
[0166] After device M receives the Bluetooth protocol version number confirmation feedback from device N, device M may send a Bluetooth protocol negotiation request to device N to determine the Bluetooth protocol used to transmit media data with device N. In some examples, device M may determine the Bluetooth protocol version number in the Bluetooth protocol negotiation request based on the Bluetooth protocol version number actually adopted by device M and the Bluetooth protocol version number actually adopted by device N.
[0167] After receiving the Bluetooth protocol negotiation request, device N may send a Bluetooth protocol negotiation response to device M, so that device M and device N can transmit media data through the data connection channel.
[0168] In the above embodiment, device N may be the first Bluetooth device in this application.
[0169] The following, combined Figure 8 This article introduces a low-power Bluetooth connection method.
[0170] Figure 8 A schematic diagram of a Bluetooth connection interaction provided in an embodiment of the present application Figure 3, device M can scan the low-power Bluetooth device P, and, when device P is selected as the target Bluetooth device, can establish a Bluetooth connection with device P and transmit media data.
[0171] Device M is a dual-mode Bluetooth device, and device P is a low-power Bluetooth device. After device M turns on the Bluetooth function, Figure 8 As shown, device M is in a low-power scanning state to receive low-power Bluetooth broadcast messages sent by Bluetooth devices in a discoverable state. After device M receives the low-power Bluetooth broadcast message sent by device P, device M can confirm that device P is the scanned Bluetooth device.
[0172] In the above process, since the low-power Bluetooth broadcast message is a scan confirmation message in the process of the low-power Bluetooth device scanning Bluetooth devices, the device M can determine that the device P is a low-power Bluetooth device.
[0173] After device M scans device P, in response to the user selecting device P as the target Bluetooth device, device M can send a data connection channel establishment request message to device P. Upon receiving the data connection channel establishment request message from device M, device P sends a data connection channel establishment response message to device M. At this point, the data connection channel between device M and device P is successfully established.
[0174] Through the data connection channel, device M can send a Bluetooth protocol version number confirmation request to device P. Since device P is a low-power Bluetooth device, the Bluetooth protocol version number confirmation request sent by device M to device P includes the Bluetooth protocol version number of the Bluetooth protocol actually adopted by device M. For example, when the Bluetooth protocol version number confirmation request sent by device M to device P includes the Bluetooth protocol version number 5.4 of the Bluetooth protocol actually adopted by device M, device P can provide Bluetooth protocol version number confirmation feedback to device M. In some examples, the Bluetooth protocol version number confirmation feedback provided by device P to device M includes the Bluetooth version number of the Bluetooth protocol actually adopted by device P.
[0175] After device M receives the Bluetooth protocol version number confirmation feedback from device P, device M may send a Bluetooth protocol negotiation request to device P to determine the Bluetooth protocol used to transmit media data with device P. In some examples, device M may determine the Bluetooth protocol version number in the Bluetooth protocol negotiation request based on the Bluetooth protocol version number actually adopted by device M and the Bluetooth protocol version number actually adopted by device P.
[0176] After receiving the Bluetooth protocol negotiation request, device P may send a Bluetooth protocol negotiation response to device M, so that device M and device P can transmit media data through the data connection channel.
[0177] In the above embodiment, the device P may be the second Bluetooth device in this application.
[0178] In the above embodiment, Figure 7 Only one classic Bluetooth connection process is introduced. Figure 8 This section describes only one type of Bluetooth low energy connection process. Since device M uses dual-mode Bluetooth, in response to the Bluetooth activation operation, device M is still in a low-power scanning state while broadcasting an inquiry request message. Subsequently, if device M receives an inquiry response message from device M, it identifies device N as a scanned Bluetooth device. If device M receives a Bluetooth low energy broadcast message from device P, it identifies device P as a scanned Bluetooth device.
[0179] In response to selecting the target Bluetooth device, device M may send a data connection channel establishment request message to the target Bluetooth device. The specific content of the data connection channel establishment request message sent by device M depends on the Bluetooth type of the target Bluetooth device, as described in the above embodiments and will not be further described here. In other words, regardless of the Bluetooth type of device N and device P, device M will send a data connection channel establishment request message to the target Bluetooth device.
[0180] After device M establishes a data connection with the target Bluetooth device, it sends a Bluetooth protocol version confirmation request to the target Bluetooth device. The specific content and format of the Bluetooth protocol version confirmation request depend on the Bluetooth type of the target Bluetooth device, as described in the previous embodiments and will not be further described here. In other words, regardless of the Bluetooth type of device N and device P, device M sends a Bluetooth protocol version confirmation request to the target Bluetooth device.
[0181] After device M receives the Bluetooth protocol version confirmation feedback from the target Bluetooth device, it can send a Bluetooth protocol negotiation request to the target Bluetooth device. After receiving the Bluetooth protocol negotiation response from the target Bluetooth device, it can use the Bluetooth protocol in the Bluetooth protocol negotiation request and response to transmit media data. In other words, regardless of the Bluetooth type of device N and device P, device M sends a Bluetooth protocol negotiation request to the target Bluetooth device.
[0182] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.
[0183] An embodiment of the present application further provides a computer program product, including a computer program. When the computer program runs on an electronic device, the electronic device executes each function or step in the above method embodiment.
[0184] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0185] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0186] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0187] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0188] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0189] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A Bluetooth connection method, characterized in that: Applied to electronic equipment, the method includes: In response to the operation of turning on the Bluetooth function, broadcasting an inquiry request message and entering a scanning state; receiving an inquiry response message from the first Bluetooth device; In response to an operation of selecting the first Bluetooth device, establishing a first data connection channel with the first Bluetooth device; sending a first confirmation request to the first Bluetooth device through the first data connection channel, wherein the first confirmation request includes a first Bluetooth protocol version number, the first Bluetooth protocol version number being a preset Bluetooth protocol version number, the preset Bluetooth protocol version number being less than a Bluetooth protocol version number supported by the electronic device; the first confirmation request being used to request the first Bluetooth device to confirm the Bluetooth protocol version number of the electronic device; A Bluetooth protocol for transmitting media data is negotiated with the first Bluetooth device to transmit the media data through the first data connection channel.
2. The method according to claim 1, characterized in that The method further comprises: receiving a Bluetooth low energy broadcast message from a second Bluetooth device; In response to the operation of selecting the second Bluetooth device, establishing a second data connection channel with the second Bluetooth device; Sending a second confirmation request to the second Bluetooth device through the second data connection channel, wherein the second confirmation request includes a second Bluetooth protocol version number, the second Bluetooth protocol version number is a Bluetooth protocol version number of the Bluetooth protocol supported by the electronic device, and the second confirmation request is used to request the second Bluetooth device to confirm the Bluetooth protocol version number of the electronic device; A Bluetooth protocol for transmitting media data is negotiated with the second Bluetooth device to transmit the media data through the second data connection channel.
3. The method according to claim 1 or 2, characterized in that The electronic device includes a host, a classic Bluetooth controller and a low-power Bluetooth controller; In response to the operation of turning on the Bluetooth function, a query request message is broadcasted and the scanning state is entered, including: In response to an operation of turning on the Bluetooth function, the host sends a first command to the classic Bluetooth controller and sends a second command to the low-power Bluetooth controller; In response to the first command, the classic Bluetooth controller broadcasts the inquiry request message; In response to the second command, the Bluetooth low energy controller enters the scanning state.
4. A Bluetooth connection method, characterized in that: Applied to electronic equipment, the method includes: In response to an operation of turning on the Bluetooth function, scanning for Bluetooth devices in a discoverable state; In response to an operation on a target Bluetooth device among the scanned Bluetooth devices, establishing a data connection channel with the target Bluetooth device; sending a confirmation request to the target Bluetooth device through the data connection channel, wherein the confirmation request includes a target Bluetooth protocol version number, and the target Bluetooth protocol version number is related to the protocol type of the Bluetooth protocol of the target Bluetooth device; the confirmation request is used to request the target Bluetooth device to confirm the Bluetooth protocol version number of the electronic device; A Bluetooth protocol for transmitting media data is negotiated with the target Bluetooth device to transmit the media data through the data connection channel.
5. The method according to claim 4, characterized in that In a case where the protocol type of the Bluetooth protocol of the target Bluetooth device is classic Bluetooth, the target Bluetooth protocol version number is a preset Bluetooth protocol version number; In a case where the protocol type of the Bluetooth protocol of the target Bluetooth device is Bluetooth Low Energy, the target Bluetooth protocol version number is the Bluetooth protocol version number of the Bluetooth protocol of the electronic device.
6. The method according to claim 4 or 5, characterized in that Before sending the confirmation request to the target Bluetooth device through the data connection channel, the method further includes: The protocol type of the Bluetooth protocol of the target Bluetooth device is determined based on the manner in which the target Bluetooth device is scanned.
7. The method according to claim 6, characterized in that The scanning of Bluetooth devices in a discoverable state includes: Broadcast inquiry request message and enter scanning state; The determining the protocol type of the Bluetooth protocol of the target Bluetooth device based on the manner in which the target Bluetooth device is scanned includes: If the inquiry response message sent by the target Bluetooth device is received, determining that the protocol type of the Bluetooth protocol of the target Bluetooth device is classic Bluetooth; If a low-power Bluetooth broadcast message sent by the target Bluetooth device is received, it is determined that the protocol type of the Bluetooth protocol of the target Bluetooth device is low-power Bluetooth.
8. An electronic device, characterized in that: The electronic device includes a Bluetooth module, a memory and one or more processors; the Bluetooth module, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the method as described in any one of claims 1-3, or 4-7.
9. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 3 or 4 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the electronic device is caused to perform the method according to any one of claims 1-3 or 4-7.
Citation Information
Patent Citations
Bluetooth connection control method, electronic device and computer readable storage medium
CN109495871A
Communication method and related device
CN117641256A
Bluetooth system integration module
US20160150352A1
Bluetooth connection establishment method, device and system
WO2023109610A1