CN112968752A - Baud rate switching method and device for UART communication and initiator terminal - Google Patents

Baud rate switching method and device for UART communication and initiator terminal Download PDF

Info

Publication number
CN112968752A
CN112968752A CN202110118503.9A CN202110118503A CN112968752A CN 112968752 A CN112968752 A CN 112968752A CN 202110118503 A CN202110118503 A CN 202110118503A CN 112968752 A CN112968752 A CN 112968752A
Authority
CN
China
Prior art keywords
baud rate
terminal
switching
uart interface
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110118503.9A
Other languages
Chinese (zh)
Other versions
CN112968752B (en
Inventor
于会泳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202110118503.9A priority Critical patent/CN112968752B/en
Publication of CN112968752A publication Critical patent/CN112968752A/en
Priority to PCT/CN2021/138768 priority patent/WO2022161004A1/en
Application granted granted Critical
Publication of CN112968752B publication Critical patent/CN112968752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0023Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the signalling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a Baud rate switching method and device for UART communication, an initiator terminal, a controlled terminal and a computer readable storage medium, wherein the method comprises the following steps: the method comprises the steps that an initiator terminal obtains data to be sent corresponding to a target baud rate; sending baud rate switching information to a controlled party terminal; the baud rate switching information comprises a target baud rate; switching the baud rate of the first UART interface to a target baud rate; after baud rate switching completion information sent by a controlled party terminal is acquired, sending data to be sent to the controlled party terminal through a first UART interface; when the initiator terminal needs to send data to the controlled terminal by using the baud rate of the switched UART communication, the method and the system enable the initiator terminal to control the baud rate switching of the UART interface in the controlled terminal by sending baud rate switching information to the controlled terminal, realize the flexible switching of the baud rate of the UART communication between the initiator terminal and the controlled terminal, and improve the switching efficiency.

Description

Baud rate switching method and device for UART communication and initiator terminal
Technical Field
The invention relates to the technical field of portable listening equipment, in particular to a Baud rate switching method and device for UART communication, an initiator terminal, a controlled terminal and a computer readable storage medium.
Background
In recent years, various Serial bus communication technologies have appeared, such as USB (Universal Serial bus), CAN (Controller Area Network), SPI (Serial Peripheral Interface), CPLD (complex programmable logic device), etc., and UART (Universal Asynchronous Receiver/Transmitter) communication, which is still important in wired communication of electronic products because of advantages of simple protocol, few required Interface lines (single line communication CAN be performed using one line), stability and reliability.
The method is characterized in that baud rates of two parties in UART communication are kept consistent, which is the basis for normal communication, but different serial port baud rates are required to be used in different scenes on a TWS, for example, a low baud rate (such as 115200) is used in production, 230400 baud rate is used in a common scene of a user, a high baud rate (such as 921600) is used in cable upgrading, and the like. This means that the product needs to support the switching of baud rate to adapt to different usage scenarios, otherwise, the situation that the two parties cannot communicate due to different baud rates occurs.
Taking a wireless headset product in an electronic product as an example, as TWS headphones (true wireless interconnection stereo bluetooth headphones) increasingly become the mainstream of wireless headset products, all TWS products on the market are in the form of one charging box + two wireless headsets, and the main functions of the charging box include: charging the wireless headset, providing UI operations and displays, providing production support for the wireless headset, etc. This means that communication must be supported between the wireless headset and the charging box, and in the TWS headset currently on the market, the UART method is also generally used for communication between the wireless headset and the charging box.
In the prior art, the wireless earphone and the charging box are respectively and independently switched to a target baud rate, and then the wireless earphone and the charging box are combined together to switch the baud rate. Therefore, how to flexibly switch and match the proper baud rate between two devices, reduce the human participation process, and improve the efficiency and the user experience is a problem which needs to be solved urgently nowadays.
Disclosure of Invention
The invention aims to provide a Baud rate switching method and device for UART communication, an initiator terminal, a controlled terminal and a computer readable storage medium, so that the initiator terminal and the controlled terminal can be flexibly switched and matched with a proper Baud rate, the artificial participation process is reduced, and the efficiency and the user experience are improved.
In order to solve the above technical problem, the present invention provides a baud rate switching method for UART communication, including:
the method comprises the steps that an initiator terminal obtains data to be sent corresponding to a target baud rate;
sending baud rate switching information to a controlled party terminal; wherein the baud rate switching information comprises the target baud rate;
switching the baud rate of the first UART interface to the target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal;
and after baud rate switching completion information sent by the controlled party terminal is acquired, sending the data to be sent to the controlled party terminal through the first UART interface.
Optionally, the sending baud rate switching information to the controlled party terminal includes:
and sending baud rate switching information to the controlled party terminal according to a preset baud rate through the first UART interface.
Optionally, the baud rate switching information further includes: a protocol version number.
Optionally, the switching the baud rate of the first UART interface to the target baud rate includes:
and after receiving confirmation information corresponding to the baud rate switching information sent by the controlled party terminal according to the preset baud rate through the first UART interface, switching the baud rate of the first UART interface from the preset baud rate to the target baud rate after first preset time.
Optionally, after the switching the baud rate of the first UART interface to the target baud rate, the method further includes:
sending handshake information to the controlled party terminal according to the target baud rate through the first UART interface;
judging whether confirmation information corresponding to the handshake information is received through the first UART interface within a second preset time period;
and if so, taking confirmation information corresponding to the handshake information as baud rate switching completion information, and executing the step of sending the data to be sent to the controlled party terminal through the first UART interface.
Optionally, after determining whether the acknowledgement information corresponding to the handshake information is received through the first UART interface within a second preset time period, the method further includes:
when the confirmation information corresponding to the handshake information is not received within the second preset time period, judging whether a sending time threshold is reached;
if the threshold value of the sending times is reached, switching the baud rate of the first UART interface from the target baud rate to the preset baud rate;
and if the sending times threshold value is not reached, executing the step of sending handshake information to the controlled party terminal according to the target baud rate through the first UART interface.
The invention also provides a baud rate switching device for UART communication, which comprises:
the data acquisition module is used for acquiring data to be transmitted corresponding to the target baud rate;
the control module is used for sending baud rate switching information to the controlled party terminal; wherein the baud rate switching information comprises the target baud rate;
the switching module is used for switching the baud rate of the first UART interface to the target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal;
and the transmitting module is used for transmitting the data to be transmitted to the controlled party terminal through the first UART interface after obtaining the baud rate switching completion information transmitted by the controlled party terminal.
The present invention also provides an initiator terminal, comprising:
a memory for storing a computer program;
the processor is used for executing the computer program and realizing the acquisition of data to be sent corresponding to the target baud rate; sending baud rate switching information to a controlled party terminal; switching the baud rate of the first UART interface to the target baud rate; after baud rate switching completion information sent by the controlled party terminal is acquired, sending the data to be sent to the controlled party terminal through the first UART interface; the baud rate switching information includes the target baud rate, and the first UART interface of the initiator terminal is connected to the second UART interface of the controlled terminal.
The present invention also provides a controlled party terminal, including:
a memory for storing a computer program;
the processor is used for executing the computer program and realizing the acquisition of baud rate switching information sent by the initiator terminal; switching the baud rate of a second UART interface to a target baud rate in the baud rate switching information; after the switching is finished, sending baud rate switching finishing information to the initiator terminal; receiving data to be sent by the controlled party terminal through the second UART interface; and the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal.
Furthermore, the present invention also provides a computer readable storage medium, having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the baud rate switching method for UART communication as described above.
The invention provides a Baud rate switching method of UART communication, which comprises the following steps: the method comprises the steps that an initiator terminal obtains data to be sent corresponding to a target baud rate; sending baud rate switching information to a controlled party terminal; the baud rate switching information comprises a target baud rate; switching the baud rate of the first UART interface to a target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal; after baud rate switching completion information sent by a controlled party terminal is acquired, sending data to be sent to the controlled party terminal through a first UART interface;
therefore, when the initiator terminal needs to send data to the controlled terminal by using the baud rate of the switched UART communication, the initiator terminal controls the baud rate switching of the UART interface in the controlled terminal by sending baud rate switching information to the controlled terminal, so that the flexible switching of the baud rate of the UART communication between the initiator terminal and the controlled terminal is realized, the artificial participation process is reduced, and the efficiency and the user experience are improved; and after the baud rate switching completion information sent by the controlled party terminal is acquired, the data to be sent is sent to the controlled party terminal through the first UART interface after the baud rate switching completion information sent by the controlled party terminal is acquired, so that the accuracy of baud rate switching is ensured. In addition, the invention also provides a baud rate switching device for UART communication, an initiator terminal, a controlled party terminal and a computer readable storage medium, and the baud rate switching device, the initiator terminal, the controlled party terminal and the computer readable storage medium also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a baud rate switching method for UART communication according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another baud rate switching method for UART communication according to an embodiment of the present invention;
fig. 3 is a flowchart of another baud rate switching method for UART communication according to an embodiment of the present invention;
fig. 4 is a block diagram of a baud rate switching apparatus for UART communication according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a baud rate switching method for UART communication according to an embodiment of the present invention. The method can comprise the following steps:
step 101: and the initiator terminal acquires data to be sent corresponding to the target baud rate.
The initiator terminal in this embodiment may initiate a terminal device that switches a baud rate of UART communication for one of two terminal devices that need UART communication; correspondingly, the controlled terminal in this embodiment may be another terminal device of two terminal devices that need UART communication, that is, a terminal device in which the initiated terminal controls and switches the baud rate of UART communication. For the specific device types of the initiator terminal and the controlled terminal in this embodiment, the specific device types may be set by a designer according to a practical scenario and a user requirement, for example, the initiator terminal and the controlled terminal may be wireless earphones or the like, for example, when the initiator terminal is a charging box, the controlled terminal may be a wireless earphone, that is, when the initiator terminal is a charging box, a UART interface (i.e., a first UART interface) of the charging box may be in wired connection (e.g., contact connection) with a UART interface (i.e., a second UART interface) of a wireless earphone in the charging box; when the initiator terminal is a wireless headset, the controlled terminal can be a charging box, that is, a UART interface (i.e., a first UART interface) of the wireless headset in the charging box can be connected with a UART interface (i.e., a second UART interface) of the charging box; the initiator terminal may also be a wireless earphone or an intelligent bracelet capable of placing the wireless earphone, for example, when the initiator terminal is the intelligent bracelet capable of placing the wireless earphone, the controlled terminal may be the wireless earphone; the initiator terminal and the controlled terminal can also be other types of electronic products, such as internet of things devices, intelligent wearable devices and the like, for example, the initiator terminal can be an intelligent wristwatch, and the controlled terminal can be a charging device (such as a magnetic type charger) of the intelligent wristwatch. As long as the first UART interface of the initiator terminal can be in wired connection with the second UART interface of the controlled terminal and perform UART communication, this embodiment does not limit this.
Specifically, the data to be sent corresponding to the target baud rate acquired by the processor of the initiator terminal in this step may be data, such as upgrade file data, that the initiator terminal needs to send to the controlled terminal by using the target baud rate through its own UART interface (i.e., the first UART interface). The target baud rate in this step may be a baud rate of UART communication that is required to be used when the initiator terminal transmits data to be transmitted to the controlled terminal through the first UART interface. The embodiment does not limit the specific value of the target baud rate, and the target baud rate may be 921600 bits/second in the case of wired upgrade, for example, when the data to be transmitted is upgrade file data.
Correspondingly, the embodiment does not limit the specific way in which the processor of the initiator terminal obtains the data to be sent corresponding to the target baud rate, and if the data to be sent is upgrade file data, the processor may be implemented in a way the same as or similar to the data obtaining method for wired upgrade in the prior art, which is not limited in this embodiment.
It should be noted that, this embodiment is shown by taking baud rate switching as an example when the initiator terminal needs to use the target baud rate through UART communication to send data to be sent to the controlled terminal; when the corresponding initiator terminal needs to receive the data to be received sent by the controlled terminal through UART communication using the target baud rate, the method may be implemented in the same or similar manner as the method provided in this embodiment, and this embodiment does not limit this.
Step 102: sending baud rate switching information to a controlled party terminal; wherein the baud rate switching information includes a target baud rate.
It can be understood that the purpose of this step may be to enable the controlled party terminal to switch its UART interface (i.e., the second UART interface) to the target baud rate according to the received baud rate switching information by sending baud rate switching information to the controlled party terminal when the processor of the initiator terminal acquires data to be sent corresponding to the target baud rate, that is, when it is determined that the baud rate of the UART communication with the controlled party terminal needs to be switched, thereby implementing the baud rate switching control of the UART communication of the controlled party terminal.
Correspondingly, for the specific mode that the processor of the initiator terminal sends the baud rate switching information to the controlled terminal in the step, the specific mode can be set by a designer according to a practical scene and user requirements, for example, the processor can send the baud rate switching information to the controlled terminal according to the preset baud rate through the first UART interface, namely, the initiator terminal can send the baud rate switching information to the controlled terminal by using UART communication of the preset baud rate; the preset baud rate and the target baud rate are different data, and the preset baud rate may be the same baud rate as that of the first UART interface and the second UART interface at present, for example, a preset default baud rate used conventionally, such as 230400 bits/second used in a user common scene or 115200 bits/second used in production. The processor of the initiator terminal can also send baud rate switching information to the controlled terminal in other communication modes, for example, the processor can send the baud rate switching information to the controlled terminal by using a wireless communication component (such as a Bluetooth component) in the initiator terminal; for example, a first bluetooth component in the initiator terminal may be bluetooth communicatively connected to a second bluetooth component in the controlled terminal. The embodiment does not limit this as long as the processor can transmit the baud rate switching information to the controlled terminal.
Specifically, the specific content of the baud rate switching information in this step may be set by a designer according to a practical scenario and a user requirement, for example, the baud rate switching information may include a target baud rate to inform a baud rate switching target value of UART communication of the controlled party terminal. The baud rate switching information can also comprise a protocol version number, so that the controlled party terminal can analyze according to the protocol version number to obtain a target baud rate in the baud rate switching information; as shown in fig. 2, in this step, the device a (i.e., the initiator terminal) may send the protocol a (i.e., the baud rate switching information) including the protocol version number and the target baud rate (i.e., the high baud rate in fig. 2) through UART communication using the current baud rate (i.e., the low baud rate in fig. 2), so that the device B (i.e., the controlled device) may parse the message of the protocol a according to the protocol version number at the header of the message in the protocol a, and obtain the target baud rate in the message. As long as the controlled party terminal can obtain the target baud rate in the baud rate switching information, so as to switch the baud rate of the second UART interface of the controlled party terminal to the target baud rate, the embodiment does not limit this.
Step 103: switching the baud rate of the first UART interface to a target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal.
It can be understood that the purpose of this step may be that the processor of the initiator terminal switches its own UART interface (i.e., the first UART interface) to the target baud rate, so that the first UART interface may perform UART communication with the UART interface (i.e., the second UART interface) of the controlled terminal using the target baud rate.
Correspondingly, the specific sequence of the step and the step 102 is not limited in this embodiment, and the step 102 may be performed first and then the step may be performed as shown in this embodiment; if step 102 sends baud rate switching information to the controlled party terminal by using other communication modes except UART communication, the baud rate of the first UART interface may be switched to the target baud rate while sending the baud rate switching information to the controlled party terminal.
Specifically, in this step, after obtaining the confirmation information (such as Ack of the protocol a in fig. 2) corresponding to the baud rate switching information sent by the controlled party terminal, the processor may switch the baud rate of the first UART interface to the target baud rate, that is, after determining that the controlled party terminal switches the baud rate of the second UART interface to the target baud rate according to the received baud rate switching information, the processor may switch the baud rate of the first UART interface to the target baud rate, so as to avoid useless baud rate switching of the first UART interface; that is to say, before this step, the controlled party terminal may determine whether the baud rate of the second UART interface can be switched to the target baud rate according to the received baud rate switching information after receiving the baud rate switching information; if so, sending confirmation information corresponding to the baud rate switching information to the initiator terminal, and switching the baud rate of the second UART interface to the target baud rate; if not, sending no confirmation information corresponding to the baud rate switching information to the initiator terminal, or sending no switching information corresponding to the baud rate switching information to the initiator terminal, so as to inform the initiator terminal that the target baud rate UART communication cannot be performed currently, and avoid the initiator terminal switching the baud rate of the first UART interface to the target baud rate.
For example, in this step, after receiving the confirmation information corresponding to the baud rate switching information sent by the controlled party terminal through the first UART interface according to the preset baud rate, the processor switches the baud rate of the first UART interface from the preset baud rate to the target baud rate after a first preset time (e.g., 2s in fig. 2); correspondingly, the controlled terminal can send confirmation information corresponding to the baud rate switching information to the initiating terminal by using the preset baud rate through the second UART interface after receiving the baud rate switching information received through the second UART interface according to the preset baud rate and determining that the preset baud rate capable of switching the second UART interface is switched to the target baud rate, and switch the baud rate of the second UART interface from the preset baud rate to the target baud rate after the first preset time.
Step 104: and after the baud rate switching completion information sent by the controlled party terminal is acquired, sending data to be sent to the controlled party terminal through the first UART interface.
Specifically, the purpose of this step may be that after acquiring the baud rate switching completion information sent by the controlled terminal, that is, after determining that the controlled terminal switches the baud rate of the second UART interface to the target baud rate, the processor of the initiating terminal sends the data to be sent to the controlled terminal through the first UART interface using the switched target baud rate, so as to implement baud rate switching and data transmission of UART communication between the initiating terminal and the controlled terminal.
In this step, the processor sends the data to be sent to the controlled terminal through the first UART interface, that is, the processor sends the data to be sent to the controlled terminal through the first UART interface using the target baud rate, which can be implemented in the same or similar manner as the data sending method of UART communication in the prior art, which is not limited in this embodiment.
It can be understood that, before this step, a step of the processor obtaining baud rate switching completion information sent by the controlled party terminal may also be included to determine that the controlled party terminal completes baud rate switching of its second UART interface. The specific mode of the processor for acquiring the baud rate switching completion information sent by the controlled terminal, that is, the specific content of the baud rate switching completion information, may be set by a designer according to a use scenario and a user requirement, for example, the processor may directly use the confirmation information corresponding to the baud rate switching information sent by the initiator terminal as the baud rate switching completion information, that is, the processor may default that the initiator terminal can complete the baud rate switching of the second UART interface after receiving the confirmation information corresponding to the baud rate switching information. The processor can also receive baud rate switching completion information sent by the controlled party terminal by using the target baud rate through the first UART interface; if the processor can directly receive the baud rate switching completion information sent by the controlled terminal by using the target baud rate through the first UART interface, namely the controlled terminal can automatically send the baud rate switching completion information to the initiating terminal through the second UART interface after switching the second UART interface to the target baud rate so as to inform the initiating terminal that the baud rate switching of UART communication is completed; the processor may also send handshake information (for example, handshake protocol B in fig. 2) to the controlled party terminal through the first UART interface using the target baud rate, and then use confirmation information corresponding to the handshake information sent by the controlled party terminal, which is received through the first UART interface using the target baud rate, as baud rate switching completion information, so that both the initiator terminal and the controlled party terminal can determine that the baud rate switching of the UART communication is completed. For example, after the processor of the initiator terminal switches the baud rate of the first UART interface to the target baud rate, handshake information may be sent to the controlled terminal through the first UART interface according to the target baud rate; judging whether confirmation information corresponding to the handshake information is received through the first UART interface within a second preset time period (e.g., 2s in fig. 2); if so, the confirmation information corresponding to the handshake information is used as baud rate switching completion information, and step 104 is executed.
In the embodiment, when the initiator terminal needs to send data to the controlled terminal by using the baud rate of the switched UART communication, the initiator terminal controls the baud rate switching of the UART interface in the controlled terminal by sending baud rate switching information to the controlled terminal, so that the flexible switching of the baud rate of the UART communication between the initiator terminal and the controlled terminal is realized, the artificial participation process is reduced, and the efficiency and the user experience are improved; and after the baud rate switching completion information sent by the controlled party terminal is acquired, the data to be sent is sent to the controlled party terminal through the first UART interface after the baud rate switching completion information sent by the controlled party terminal is acquired, so that the accuracy of baud rate switching is ensured.
Referring to fig. 3, fig. 3 is a flowchart illustrating another baud rate switching method for UART communication according to an embodiment of the present invention. The method can comprise the following steps:
step 201: and the initiator terminal acquires data to be sent corresponding to the target baud rate.
Specifically, as shown in fig. 2, the target baud rate in this step may be a high baud rate during wired upgrade, such as 921600 bits/sec, and when the device a (i.e., the initiator terminal) in this step can obtain upgrade file data that needs to be sent to the device B (i.e., the controlled terminal) through UART communication at the high baud rate, it is determined that upgrade needs to be performed by switching to the high baud rate.
Step 202: sending baud rate switching information to a controlled party terminal according to a preset baud rate through a first UART interface; the baud rate switching information comprises a target baud rate and a protocol version number, and a first UART interface of the initiator terminal is connected with a second UART interface of the controlled terminal.
It can be understood that, in this step, the processor of the initiator terminal may send baud rate switching information to the controlled terminal through the first UART interface using the preset baud rate, so as to control the controlled terminal to perform baud rate switching through UART communication of the preset baud rate; correspondingly, after the controlled party terminal receives the baud rate switching information according to the preset baud rate through the second UART interface, whether the baud rate of the second UART interface can be switched to the target baud rate or not is determined according to the baud rate switching information; if so, sending confirmation information corresponding to the baud rate switching information to the initiator terminal through the second UART interface according to the preset baud rate, and switching the baud rate of the second UART interface to the target baud rate; if not, sending non-switchable information corresponding to the baud rate switching information to the initiator terminal through the second UART interface according to the preset baud rate, so that the initiator terminal can end the switching process.
Specifically, as shown in fig. 2, in this step, the device a may send a protocol a (i.e., baud rate switching information) to the device B using the current baud rate (i.e., the preset baud rate), where the protocol a may include: a protocol version number and a target baud rate. Correspondingly, when the device B receives the protocol a of the device a, the current environment may be checked, if the switching is possible, an Ack (i.e., acknowledgement information) that can be switched is replied to the initiator a, and at the same time, the baud rate is switched to the target baud rate after 2 seconds (i.e., a first preset time) interval, if the environment does not allow the switching, an Ack that cannot be switched is replied to the initiator, so that when the device a receives an Ack (i.e., non-switchable information) that does not allow the switching, the switching process is stopped, otherwise, the execution is continued; the initiator a proceeds to step 203 to switch the baud rate to the target baud rate after receiving the Ack that can be switched. When the device B operates the switching baud rate and switches to the target baud rate, a timer may be started to wait for the next handshake protocol B of the initiator a, and if the protocol B of the initiator a is not received within a second preset time (e.g., 2 seconds), it may be considered that the device of the initiator a is not successfully switched, and the device B backs to the default low baud rate of 115200.
Step 203: after the confirmation information corresponding to the baud rate switching information sent by the controlled terminal is received through the first UART interface according to the preset baud rate, the baud rate of the first UART interface is switched to the target baud rate from the preset baud rate after the first preset time.
In this step, the processor of the initiator terminal may receive confirmation information corresponding to the baud rate switching information sent by the controlled terminal through the first UART interface according to the preset baud rate, that is, after determining that the controlled terminal can switch the baud rate of the UART communication, switch the baud rate of the first UART interface from the preset baud rate to the target baud rate after a first preset time, and complete the switching of the baud rate of the UART communication by itself.
Specifically, the embodiment does not limit the specific time value of the first preset time, and as shown in fig. 2, the first preset time may be 2 seconds.
Step 204: and transmitting handshake information to the controlled party terminal according to the target baud rate through the first UART interface.
In the step, the processor of the initiator terminal sends handshake information to the controlled terminal by using the switched target baud rate, so that the controlled terminal can determine that the baud rate switching of the initiator terminal is completed after receiving the handshake information; correspondingly, the controlled terminal can send confirmation information corresponding to the handshake information to the initiating terminal according to the target baud rate through the second UART interface so as to inform the initiating terminal that the UART communication switching is completed. As shown in fig. 2, the device a may start sending a handshake protocol B (i.e., handshake information) to the device B after switching the baud rate to the target baud rate.
Step 205: judging whether confirmation information corresponding to the handshake information is received through the first UART interface within a second preset time period; if yes, go to step 206.
It can be understood that the purpose of this step may be that the processor of the initiator terminal determines whether the baud rate switching of the controlled terminal is completed by determining whether the confirmation information corresponding to the handshake information is received through the first UART interface within the second preset time period; if yes, it may be determined that the baud rate switching of the controlled terminal is completed, that is, the baud rate switching of the UART communication is completed, and step 206 may be entered.
Correspondingly, for the condition that the confirmation information corresponding to the handshake information is not received through the first UART interface within the second preset time period in the step, the baud rate of the first UART interface can be directly switched back to the preset baud rate to end the process; whether the threshold value of the sending times is reached can also be judged; if the sending time threshold is reached, switching the baud rate of the first UART interface from the target baud rate to a preset baud rate; if the number of sending times does not reach the threshold value, the step 204 is returned, and the target baud rate is used again to send the handshake information. This embodiment does not set any limit to this.
Specifically, as shown in fig. 2, the device a may start to send a handshake protocol B (i.e., handshake information) to the device B after switching the baud rate to the target baud rate, start a timer, and wait for the device B to return an Ack (i.e., acknowledgement information) of the handshake protocol B; the timer period (i.e. the second predetermined time) can be defined by itself according to the situation, such as 2 seconds in fig. 2. If the device B receives the handshake protocol B, it replies Ack of the handshake protocol B to the device a, so that the device a can determine that the baud rates of both parties have been successfully switched according to the Ack of the handshake protocol B, and can execute a subsequent flow, if the initiator a does not receive the Ack after timeout, the initiator a retransmits the protocol B, retries for 3 times (that is, the threshold of the transmission times is 4), and if the Ack replied by the device B is not received, it is considered that the switching is failed, and the baud rate is switched back to the default 115200.
Step 206: and sending data to be sent to the controlled party terminal through the first UART interface.
It can be understood that, in this step, after determining that the controlled terminal switches the baud rate of the second UART interface to the target baud rate, the processor of the initiator terminal sends the data to be sent to the controlled terminal through the first UART interface using the target baud rate.
In the embodiment, the initiator terminal uses the UART communication of the first UART interface to complete the control of baud rate switching of the controlled terminal, thereby avoiding the use of other communication modes; and whether the baud rate switching of the controlled terminal is completed or not can be accurately determined by judging whether the confirmation information corresponding to the handshake information is received through the first UART interface in the second preset time period, so that the accuracy of the baud rate switching is ensured.
Referring to fig. 4, fig. 4 is a block diagram illustrating a baud rate switching apparatus for UART communication according to an embodiment of the present invention. The apparatus may be applied to an initiator terminal, and may include:
the data acquisition module 10 is configured to acquire data to be sent corresponding to a target baud rate;
the control module 20 is configured to send baud rate switching information to the controlled party terminal; the baud rate switching information comprises a target baud rate;
the switching module 30 is configured to switch the baud rate of the first UART interface to a target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal;
and the sending module 40 is configured to send data to be sent to the controlled party terminal through the first UART interface after obtaining the baud rate switching completion information sent by the controlled party terminal.
Optionally, the control module 20 may be specifically configured to send baud rate switching information to the controlled terminal according to a preset baud rate through the first UART interface.
Optionally, the baud rate switching information further includes: a protocol version number.
Optionally, the switching module 30 may be specifically configured to switch the baud rate of the first UART interface from the preset baud rate to the target baud rate after a first preset time after receiving the confirmation information corresponding to the baud rate switching information sent by the controlled terminal according to the preset baud rate through the first UART interface.
Optionally, the apparatus may further include:
the handshake sending module is used for sending handshake information to the controlled party terminal according to the target baud rate through the first UART interface;
the judging module is used for judging whether the confirmation information corresponding to the handshake information is received through the first UART interface in a second preset time period; if yes, the acknowledgement information corresponding to the handshake information is used as baud rate switching completion information, and a start signal is sent to the sending module 40.
Optionally, the apparatus may further include:
the number judgment module is used for judging whether the sending number threshold is reached or not when the confirmation information corresponding to the handshake information is not received within a second preset time period; if the sending time threshold is reached, switching the baud rate of the first UART interface from the target baud rate to a preset baud rate; and if the sending times threshold value is not reached, sending a starting signal to the handshake sending module.
In the embodiment, when the initiator terminal needs to send data to the controlled terminal by using the baud rate of the switched UART communication, the initiator terminal controls the baud rate switching of the UART interface in the controlled terminal by sending baud rate switching information to the controlled terminal, so that the flexible switching of the baud rate of the UART communication between the initiator terminal and the controlled terminal is realized, the artificial participation process is reduced, and the efficiency and the user experience are improved; and after the baud rate switching completion information sent by the controlled party terminal is acquired, the data to be sent is sent to the controlled party terminal through the first UART interface after the baud rate switching completion information sent by the controlled party terminal is acquired, so that the accuracy of baud rate switching is ensured.
An embodiment of the present application further provides an initiator terminal, including: a memory for storing a computer program; the processor is used for executing the computer program and realizing the acquisition of data to be sent corresponding to the target baud rate; sending baud rate switching information to a controlled party terminal; switching the baud rate of the first UART interface to a target baud rate; after baud rate switching completion information sent by a controlled party terminal is acquired, sending data to be sent to the controlled party terminal through a first UART interface; the baud rate switching information comprises a target baud rate, and a first UART interface of the initiator terminal is connected with a second UART interface of the controlled terminal.
That is to say, when the processor of the initiator terminal executes the computer program stored in the memory, the steps corresponding to the initiator terminal in the baud rate switching method for UART communication provided in any of the above embodiments may be implemented.
Specifically, the present embodiment does not limit the specific device type of the initiator terminal, for example, the initiator terminal may be a wireless headset or a charging box.
The embodiment of the present application further provides a controlled party terminal, including: a memory for storing a computer program; the processor is used for executing the computer program and realizing the acquisition of baud rate switching information sent by the initiator terminal; switching the baud rate of the second UART interface to a target baud rate in the baud rate switching information; after the switching is finished, sending baud rate switching finishing information to the initiator terminal; receiving data to be sent by a controlled party terminal through a second UART interface; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal.
That is to say, when the processor of the controlled party terminal executes the computer program stored in the memory, the steps corresponding to the controlled party terminal in the baud rate switching method for UART communication provided in any of the above embodiments can be implemented.
Specifically, the embodiment does not limit the specific device type of the controlled party terminal, for example, the controlled party terminal may be a wireless headset or a charging box, for example, when the initiator terminal is a wireless headset, the controlled party terminal may be a charging box.
In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the computer program may implement the steps of the baud rate switching method for UART communication provided in the foregoing embodiment. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the initiator terminal, the controlled terminal and the computer-readable storage medium disclosed by the embodiments correspond to the method disclosed by the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method part.
The baud rate switching method, apparatus, initiator terminal, controlled terminal and computer readable storage medium for UART communication provided by the present invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A baud rate switching method for UART communication is characterized by comprising the following steps:
the method comprises the steps that an initiator terminal obtains data to be sent corresponding to a target baud rate;
sending baud rate switching information to a controlled party terminal; wherein the baud rate switching information comprises the target baud rate;
switching the baud rate of the first UART interface to the target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal;
and after baud rate switching completion information sent by the controlled party terminal is acquired, sending the data to be sent to the controlled party terminal through the first UART interface.
2. The baud rate switching method of UART communication according to claim 1, wherein the sending of the baud rate switching information to the controlled party terminal includes:
and sending baud rate switching information to the controlled party terminal according to a preset baud rate through the first UART interface.
3. The baud rate switching method of UART communication according to claim 2, wherein the baud rate switching information further includes: a protocol version number.
4. The method of claim 2, wherein the switching the baud rate of the first UART interface to the target baud rate comprises:
and after receiving confirmation information corresponding to the baud rate switching information sent by the controlled party terminal according to the preset baud rate through the first UART interface, switching the baud rate of the first UART interface from the preset baud rate to the target baud rate after first preset time.
5. The method for switching the baud rate of the UART communication according to any one of claims 1 to 4, wherein after switching the baud rate of the first UART interface to the target baud rate, the method further comprises:
sending handshake information to the controlled party terminal according to the target baud rate through the first UART interface;
judging whether confirmation information corresponding to the handshake information is received through the first UART interface within a second preset time period;
and if so, taking confirmation information corresponding to the handshake information as baud rate switching completion information, and executing the step of sending the data to be sent to the controlled party terminal through the first UART interface.
6. The baud rate switching method of claim 5, wherein after determining whether the acknowledgement information corresponding to the handshake information is received through the first UART interface within a second preset time period, the method further comprises:
when the confirmation information corresponding to the handshake information is not received within the second preset time period, judging whether a sending time threshold is reached;
if the threshold value of the sending times is reached, switching the baud rate of the first UART interface from the target baud rate to the preset baud rate;
and if the sending times threshold value is not reached, executing the step of sending handshake information to the controlled party terminal according to the target baud rate through the first UART interface.
7. A baud rate switching apparatus for UART communication, comprising:
the data acquisition module is used for acquiring data to be transmitted corresponding to the target baud rate;
the control module is used for sending baud rate switching information to the controlled party terminal; wherein the baud rate switching information comprises the target baud rate;
the switching module is used for switching the baud rate of the first UART interface to the target baud rate; the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal;
and the transmitting module is used for transmitting the data to be transmitted to the controlled party terminal through the first UART interface after obtaining the baud rate switching completion information transmitted by the controlled party terminal.
8. An initiator terminal, comprising:
a memory for storing a computer program;
the processor is used for executing the computer program and realizing the acquisition of data to be sent corresponding to the target baud rate; sending baud rate switching information to a controlled party terminal; switching the baud rate of the first UART interface to the target baud rate; after baud rate switching completion information sent by the controlled party terminal is acquired, sending the data to be sent to the controlled party terminal through the first UART interface; the baud rate switching information includes the target baud rate, and the first UART interface of the initiator terminal is connected to the second UART interface of the controlled terminal.
9. A controlled party terminal, comprising:
a memory for storing a computer program;
the processor is used for executing the computer program and realizing the acquisition of baud rate switching information sent by the initiator terminal; switching the baud rate of a second UART interface to a target baud rate in the baud rate switching information; after the switching is finished, sending baud rate switching finishing information to the initiator terminal; receiving data to be sent by the controlled party terminal through the second UART interface; and the first UART interface of the initiator terminal is connected with the second UART interface of the controlled terminal.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the steps of the baud rate switching method of UART communication according to any one of claims 1 to 6.
CN202110118503.9A 2021-01-28 2021-01-28 Baud rate switching method and device for UART communication and initiator terminal Active CN112968752B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110118503.9A CN112968752B (en) 2021-01-28 2021-01-28 Baud rate switching method and device for UART communication and initiator terminal
PCT/CN2021/138768 WO2022161004A1 (en) 2021-01-28 2021-12-16 Baud rate switching method and apparatus for uart communication, and initiator terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110118503.9A CN112968752B (en) 2021-01-28 2021-01-28 Baud rate switching method and device for UART communication and initiator terminal

Publications (2)

Publication Number Publication Date
CN112968752A true CN112968752A (en) 2021-06-15
CN112968752B CN112968752B (en) 2023-01-24

Family

ID=76271921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110118503.9A Active CN112968752B (en) 2021-01-28 2021-01-28 Baud rate switching method and device for UART communication and initiator terminal

Country Status (2)

Country Link
CN (1) CN112968752B (en)
WO (1) WO2022161004A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556210A (en) * 2021-07-16 2021-10-26 青岛信芯微电子科技股份有限公司 Upper computer and method for establishing communication connection
CN114189316A (en) * 2021-12-06 2022-03-15 经纬恒润(天津)研究开发有限公司 Baud rate and message protocol self-adaption method and device
WO2022161004A1 (en) * 2021-01-28 2022-08-04 歌尔股份有限公司 Baud rate switching method and apparatus for uart communication, and initiator terminal
CN117254884A (en) * 2023-11-14 2023-12-19 深圳市顾美科技有限公司 Communication baud rate debugging method, device, equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117640016B (en) * 2024-01-26 2024-05-17 北京智芯微电子科技有限公司 Baud rate negotiation method, device, computer equipment, chip and storage medium

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5901191A (en) * 1995-01-18 1999-05-04 Nec Corporation Baud rate mixing transmission system
US5923705A (en) * 1996-07-18 1999-07-13 Qualcomm Incorporated UART based autobauding without data loss
US6529548B1 (en) * 1999-03-25 2003-03-04 Nec Corporation Device and method for detecting data communication property
US20030078006A1 (en) * 1988-08-04 2003-04-24 Mahany Ronald L. Remote radio data communication system with data rate switching
US6847615B1 (en) * 1997-11-13 2005-01-25 Optimay Corporation Baud rate detection in serial data transmission
US20090034593A1 (en) * 2007-05-08 2009-02-05 Chung-Hsien Chuang Data transmission rate adjustment system and method thereof
CN101409716A (en) * 2008-11-25 2009-04-15 中国网络通信集团公司 Method for matching communication velocity of wireless communication module and external application module
CN103995480A (en) * 2014-06-10 2014-08-20 北京芯创睿胜科技有限公司 System and method for exchanging data through earphone socket
CN105653461A (en) * 2016-03-17 2016-06-08 烽火通信科技股份有限公司 System for converting single USB interface into plurality of UART debugging interfaces
CN107241162A (en) * 2016-11-24 2017-10-10 天地融科技股份有限公司 A kind of data transmission method and device
CN107547315A (en) * 2016-06-24 2018-01-05 九阳股份有限公司 A kind of method and apparatus for optimizing data communication
WO2018095181A1 (en) * 2016-11-24 2018-05-31 天地融科技股份有限公司 Data transmission method and device
CN111163387A (en) * 2019-12-29 2020-05-15 歌尔科技有限公司 TWS earphone upgrading method and device, charging box and storage medium
CN111431668A (en) * 2020-04-22 2020-07-17 珠海格力电器股份有限公司 Baud rate switching method based on multi-node UART communication, air conditioning system and processor
CN111694785A (en) * 2020-05-20 2020-09-22 哈尔滨工业大学 Feedback UART self-adaptive baud rate system and method
CN111786944A (en) * 2020-05-15 2020-10-16 广州亚美智造科技有限公司 Vehicle emission monitoring method, device, equipment and storage medium
JP2020198514A (en) * 2019-05-31 2020-12-10 株式会社富士通ゼネラル Communication device, baud rate automatic setting method and communication system
CN112230948A (en) * 2019-06-30 2021-01-15 比亚迪股份有限公司 Software upgrading method, device, system, vehicle and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7116739B1 (en) * 2002-10-31 2006-10-03 Zilog, Inc. Auto baud system and method and single pin communication interface
CN112217603A (en) * 2020-05-06 2021-01-12 青岛鼎信通讯股份有限公司 Baud rate self-adaptive design based on serial port of ammeter
CN112968752B (en) * 2021-01-28 2023-01-24 歌尔科技有限公司 Baud rate switching method and device for UART communication and initiator terminal

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030078006A1 (en) * 1988-08-04 2003-04-24 Mahany Ronald L. Remote radio data communication system with data rate switching
US5901191A (en) * 1995-01-18 1999-05-04 Nec Corporation Baud rate mixing transmission system
US5923705A (en) * 1996-07-18 1999-07-13 Qualcomm Incorporated UART based autobauding without data loss
US6847615B1 (en) * 1997-11-13 2005-01-25 Optimay Corporation Baud rate detection in serial data transmission
US6529548B1 (en) * 1999-03-25 2003-03-04 Nec Corporation Device and method for detecting data communication property
US20090034593A1 (en) * 2007-05-08 2009-02-05 Chung-Hsien Chuang Data transmission rate adjustment system and method thereof
CN101409716A (en) * 2008-11-25 2009-04-15 中国网络通信集团公司 Method for matching communication velocity of wireless communication module and external application module
CN103995480A (en) * 2014-06-10 2014-08-20 北京芯创睿胜科技有限公司 System and method for exchanging data through earphone socket
CN105653461A (en) * 2016-03-17 2016-06-08 烽火通信科技股份有限公司 System for converting single USB interface into plurality of UART debugging interfaces
CN107547315A (en) * 2016-06-24 2018-01-05 九阳股份有限公司 A kind of method and apparatus for optimizing data communication
CN107241162A (en) * 2016-11-24 2017-10-10 天地融科技股份有限公司 A kind of data transmission method and device
WO2018095181A1 (en) * 2016-11-24 2018-05-31 天地融科技股份有限公司 Data transmission method and device
JP2020198514A (en) * 2019-05-31 2020-12-10 株式会社富士通ゼネラル Communication device, baud rate automatic setting method and communication system
CN112230948A (en) * 2019-06-30 2021-01-15 比亚迪股份有限公司 Software upgrading method, device, system, vehicle and storage medium
CN111163387A (en) * 2019-12-29 2020-05-15 歌尔科技有限公司 TWS earphone upgrading method and device, charging box and storage medium
CN111431668A (en) * 2020-04-22 2020-07-17 珠海格力电器股份有限公司 Baud rate switching method based on multi-node UART communication, air conditioning system and processor
CN111786944A (en) * 2020-05-15 2020-10-16 广州亚美智造科技有限公司 Vehicle emission monitoring method, device, equipment and storage medium
CN111694785A (en) * 2020-05-20 2020-09-22 哈尔滨工业大学 Feedback UART self-adaptive baud rate system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王磊等: "一种多功能通用异步串行UART接口的设计与实现", 《四川兵工学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022161004A1 (en) * 2021-01-28 2022-08-04 歌尔股份有限公司 Baud rate switching method and apparatus for uart communication, and initiator terminal
CN113556210A (en) * 2021-07-16 2021-10-26 青岛信芯微电子科技股份有限公司 Upper computer and method for establishing communication connection
CN113556210B (en) * 2021-07-16 2024-02-27 青岛信芯微电子科技股份有限公司 Upper computer and method for establishing communication connection
CN114189316A (en) * 2021-12-06 2022-03-15 经纬恒润(天津)研究开发有限公司 Baud rate and message protocol self-adaption method and device
CN117254884A (en) * 2023-11-14 2023-12-19 深圳市顾美科技有限公司 Communication baud rate debugging method, device, equipment and storage medium
CN117254884B (en) * 2023-11-14 2024-01-30 深圳市顾美科技有限公司 Communication baud rate debugging method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112968752B (en) 2023-01-24
WO2022161004A1 (en) 2022-08-04

Similar Documents

Publication Publication Date Title
CN112968752B (en) Baud rate switching method and device for UART communication and initiator terminal
CN109600694B (en) Wireless earphone pairing method and device, terminal and charging box
CN111629369B (en) Bluetooth headset, pairing connection method and device thereof, and TWS headset
US20210219041A1 (en) Voice data transmission method, wireless earphone and tws earphone
US10389153B2 (en) Charging control method and mobile terminal
CN108769856A (en) A kind of method, apparatus, wireless headset and charging box for establishing single line connection
US11368777B2 (en) Method and system for upgrading program of TWS headset, and TWS headset
CN108429979B (en) Charging box upgrading method, charging box, wireless headset and TWS headset
CN111209026B (en) Mobile terminal, power adapter and upgrading method thereof
CN108449746B (en) BT connection establishing method, wireless earphone and TWS earphone
CN109768596B (en) Electric quantity display method, earphone charging device and earphone
CN112055349B (en) Wireless communication method and Bluetooth device
CN108810697B (en) Wireless earphone pairing method and device and wireless earphone
KR20200110086A (en) Method for establishing wireless communication link and electronic device supporting the same
CN112437371B (en) BLE link switching method, equipment, earphone pair, chip and medium
CN109547897A (en) A kind of method, apparatus, system and the wireless headset box of wireless headset connection
WO2017185680A1 (en) Terminal interaction control method and apparatus
WO2019019050A1 (en) Wireless communication pairing method, wireless receiving device, and wireless transmitting device and system
CN106416196B (en) Mobile terminal, power adapter and upgrading method thereof
CN115912567A (en) Data transmission method based on charging cable and electronic equipment
CN102970062B (en) A kind of wireless communication system and its control method
EP3914032B1 (en) Data communication methods.
WO2017049557A1 (en) Adapter upgrade method, mobile terminal, and adapter
CN110764806B (en) TWS earphone and upgrading method and device thereof
WO2021232389A1 (en) Data communication method and system, electronic device, chip, and storage medium

Legal Events

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