CN116521264A - Serial port configuration method, serial port configuration device, communication module and storage medium - Google Patents

Serial port configuration method, serial port configuration device, communication module and storage medium Download PDF

Info

Publication number
CN116521264A
CN116521264A CN202310488622.2A CN202310488622A CN116521264A CN 116521264 A CN116521264 A CN 116521264A CN 202310488622 A CN202310488622 A CN 202310488622A CN 116521264 A CN116521264 A CN 116521264A
Authority
CN
China
Prior art keywords
serial port
port
application
data
instruction
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.)
Pending
Application number
CN202310488622.2A
Other languages
Chinese (zh)
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.)
Fibocom Wireless Inc
Original Assignee
Fibocom Wireless Inc
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 Fibocom Wireless Inc filed Critical Fibocom Wireless Inc
Priority to CN202310488622.2A priority Critical patent/CN116521264A/en
Publication of CN116521264A publication Critical patent/CN116521264A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4027Coupling between buses using bus bridges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)

Abstract

The embodiment of the application provides a serial port configuration method, a serial port configuration device, a communication module and a storage medium, wherein the serial port configuration method comprises the following steps: under the condition of opening the port bridging application, obtaining a first configuration parameter of the port bridging application, configuring a first serial port as an AT serial port, and running the port bridging application on an application processor of the communication module, wherein the first serial port is a serial port corresponding to the first configuration parameter; under the condition that the port bridging application monitors that the terminal equipment sends an AT instruction to the application processor through the first serial port, instruction data of the AT instruction are transmitted to a communication processor of the communication module through a communication channel, wherein the communication channel is a data transmission channel established between the application processor and the communication processor; and transmitting the reply data to the terminal equipment through the first serial port under the condition that the port bridging application monitors the reply data of the communication channel. The serial port configuration method and device can flexibly conduct serial port configuration.

Description

Serial port configuration method, serial port configuration device, communication module and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a serial port configuration method, a serial port configuration device, a communication module, and a storage medium.
Background
The serial port of the communication module is usually used as an important function, through which the terminal device can be connected to the communication module. When the serial port is configured as an AT serial port, the terminal equipment can send an AT instruction to the communication module through the serial port to dial up, surfing and other services; when the serial port is configured as a data serial port, the terminal equipment can also transmit data to the communication module through the serial port.
The dial-up networking requires the communication module to perform related interaction with the base station, and generally the corresponding processing of the AT instruction is performed by the communication processor of the communication module, so that the AT serial port is generally configured in the communication processor, and therefore, the AT instruction sent by the terminal equipment through the serial port can reach the communication processor AT the first time, the communication processor directly performs related processing, and then response information is returned to the terminal equipment through the serial port. According to the use requirement of the terminal equipment, a certain serial port of the communication module can be used as an AT serial port and configured to the communication processor. Which serial port is used as an AT serial port by the terminal device needs to be configured to the communication processor. However, if the AT serial port changes (if the AT serial port changes from the serial port 1 to the serial port 2), software reconfiguration is required, the configuration of the serial port 1 is unbundled, the serial port 2 is reconfigured to the communication processor, and the software version needs to be recompiled to enable the configuration to be effective, so that the current serial port configuration mode is not flexible enough.
Disclosure of Invention
The embodiment of the application provides a serial port configuration method, a serial port configuration device, a communication module and a storage medium, which can flexibly perform serial port configuration.
A first aspect of an embodiment of the present application provides a serial port configuration method, including:
under the condition of opening a port bridging application, obtaining a first configuration parameter of the port bridging application, configuring a first serial port as an AT serial port, wherein the port bridging application runs on an application processor of a communication module, and the first serial port is a serial port corresponding to the first configuration parameter;
transmitting instruction data of the AT instruction to a communication processor of the communication module through a communication channel under the condition that the port bridging application monitors that the terminal equipment sends the AT instruction to the application processor through the first serial port, wherein the communication channel is a data transmission channel established between the application processor and the communication processor;
transmitting the reply data to the terminal equipment through the first serial port under the condition that the port bridging application monitors the reply data of the communication channel;
or when the port bridging application is closed, configuring the serial port configured as the AT serial port before the port bridging application is closed as the data serial port.
Alternatively to this, the method may comprise,
the configuring the first serial port as an AT serial port includes:
and determining a first file handle corresponding to the first configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opening the first file handle, and monitoring whether the receiving end of the first serial port has data readable or not by the port bridging application through the first file handle.
Optionally, after the configuring the first serial port as the AT serial port, the method further includes:
restarting the port bridging application to obtain a second configuration parameter of the port bridging application, configuring the second serial port as an AT serial port, wherein the second serial port is a serial port corresponding to the second configuration parameter.
Optionally, after the configuring the first serial port as the AT serial port, the method further includes:
and determining a second file handle corresponding to the second configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opening the second file handle, and monitoring whether the receiving end of the second serial port has data readable or not by the port bridging application through the second file handle.
Optionally, the obtaining the first configuration parameter of the port bridging application includes:
Obtaining a first configuration parameter of the port bridging application input by a user;
or, obtaining a first configuration parameter of a default configuration of the port bridge application.
Optionally, when the port bridge application monitors that the terminal device sends an AT instruction to the application processor through the first serial port, transmitting instruction data of the AT instruction to a communication processor of the communication module through a communication channel, where the method includes:
when the port bridging application monitors that the receiving end of the first serial port has the readable instruction data of the AT instruction through the first file handle, writing the instruction data of the AT instruction into the file handle of the communication channel;
and when the AT instruction processing program running on the communication processor monitors that the sending end of the communication channel is readable through the file handle of the communication channel, the AT instruction processing program is used for reading the instruction data of the AT instruction through the file handle of the communication channel.
Optionally, in the case that the port bridging application monitors reply data of the communication channel for the AT instruction, transmitting the reply data to the terminal device through the first serial port includes:
When the port bridging application monitors that the receiving end of the communication channel has readable data through the file handle of the communication channel, reading reply data aiming AT the AT instruction from the file handle of the communication channel, and writing the reply data into the first file handle;
and when the terminal equipment monitors that the data is readable through the first file handle, the reply data is read from the first file handle.
A second aspect of an embodiment of the present application provides a serial port configuration device, including:
the device comprises an obtaining unit, a port bridging unit and a port bridging unit, wherein the obtaining unit is used for obtaining a first configuration parameter of the port bridging application and configuring a first serial port as an AT serial port under the condition of opening the port bridging application;
the configuration unit is used for configuring a first serial port as an AT serial port, the port bridging application runs on an application processor of the communication module, and the first serial port is a serial port corresponding to the first configuration parameter;
the port bridging application is used for transmitting the instruction data of the AT instruction to the communication processor of the communication module through a communication channel when the port bridging application monitors that the terminal equipment sends the AT instruction to the application processor through the first serial port, wherein the communication channel is a data transmission channel established between the application processor and the communication processor;
The transmission unit is further configured to, when the port bridging application monitors reply data of the communication channel, transmit the reply data to the terminal device through the first serial port;
or the serial port configuration device comprises a configuration unit, and the configuration unit is used for configuring the serial port configured as the AT serial port as the data serial port before the port bridging application is closed when the port bridging application is closed.
A third aspect of the embodiments of the present application provides a communication module comprising an application processor, a communication processor and a memory, the memory for storing a computer program comprising program instructions, the application processor being configured to invoke the program instructions to execute the step instructions as in the first aspect of the embodiments of the present application.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes a computer to perform part or all of the steps as described in the first aspect of the embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product, wherein the computer program product comprises a computer program operable to cause an application processor to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package.
In the embodiment of the application, under the condition of opening a port bridging application, a first configuration parameter of the port bridging application is obtained, a first serial port is configured as an AT serial port, the port bridging application is operated on an application processor of a communication module, and the first serial port is a serial port corresponding to the first configuration parameter; transmitting instruction data of the AT instruction to a communication processor of the communication module through a communication channel under the condition that the port bridging application monitors that the terminal equipment sends the AT instruction to the application processor through the first serial port, wherein the communication channel is a data transmission channel established between the application processor and the communication processor; transmitting the reply data to the terminal equipment through the first serial port under the condition that the port bridging application monitors the reply data of the communication channel; or when the port bridging application is closed, configuring the serial port configured as the AT serial port before the port bridging application is closed as the data serial port. According to the serial port configuration method, under the condition that the port bridging application is opened, a first configuration parameter of the port bridging application is obtained, the first serial port is configured as an AT serial port, the port bridging application is operated on an application processor of the communication module, and the first serial port is a serial port corresponding to the first configuration parameter; the port bridging application running on the application processor of the communication module is used for configuring the first serial port as the AT serial port, and the transmission of the AT instruction is realized through the communication channel established between the application processor and the communication processor.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a serial port configuration method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of a connection relationship between a terminal device and a communication module according to an embodiment of the present application;
fig. 3 is a schematic flow chart of another serial port configuration method provided in the embodiment of the present application;
fig. 4 is a schematic flow chart of another serial port configuration method provided in the embodiment of the present application;
fig. 5 is a schematic diagram of configuring a second serial port to be an AT serial port according to an embodiment of the present application;
FIG. 6 is a schematic workflow diagram of a port bridging application provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a serial port configuration device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a communication module according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.
The terminal device involved in the embodiment of the present application may include a device that does not have a network surfing capability. Such as meters for water, electricity, etc. The terminal device may include a micro control unit (microcontroller unit, MCU) or a System On Chip (SOC).
The communication module related to the embodiment of the application comprises an application processor (application processor, AP) and a communication processor. The application processor has data processing capabilities and the communication processor has the capability to interact with the base station. The communication processor may include a baseband chip plus a coprocessor. The communication processor, which may also be referred to as a modem.
The terminal equipment generally has the requirements of data transmission and internet surfing, and the terminal equipment can realize the functions of internet surfing and data uploading by means of the communication module because the terminal equipment does not have the internet surfing capability.
An AT (Attention) serial port of a communication module is generally used as an important function, a terminal device (for example, an SOC or an MCU) can be connected to the communication module through a physical serial port, an AT instruction is sent to the communication module through the physical serial port to perform services such as dial-up networking, and meanwhile, some serial ports are often used as common serial ports (i.e., data serial ports) to perform data transmission between the communication module and the terminal device. Dialing is a process of calling another computer or network by using a modem and logging in, and the premise of surfing the internet is that dialing is performed first.
AT present, the communication module dials and surfing the internet to perform related interaction with the base station, and generally corresponding AT instruction processing is performed on a communication processor of the communication module, so that an AT serial port is generally configured on the communication processor, and therefore, an AT instruction sent by the terminal equipment through the serial port can reach the communication processor AT the first time, and the communication processor can directly perform related processing on the AT instruction and then return response information to the terminal equipment through the serial port.
AT present, a client needs to configure the serial port to a communication processor by using which serial port is taken as an AT serial port, so that the communication processor is not flexible enough, if the AT serial port used by the client changes (if the AT serial port changes from the serial port 1 to the serial port 2), software is needed to reconfigure, the configuration of the serial port 1 is unbundled, the serial port 2 is reconfigured to the communication processor, and a software version is needed to be recompiled to enable the configuration to be effective; meanwhile, the problem brought by the fixed configuration is that the serial port can only be used as an AT serial port and cannot be used as a data serial port, and for the situation that the serial port is sometimes required to be used as the AT serial port and sometimes the situation that the serial port is required to be used as the data serial port to transmit data cannot be adapted.
In the embodiment of the application, the first serial port is configured as the AT serial port by the port bridging application running on the application processor of the communication module, and the transmission of the AT instruction is realized by the communication channel established between the application processor and the communication processor.
Referring to fig. 1, fig. 1 is a flow chart of a serial port configuration method according to an embodiment of the present application. As shown in fig. 1, the serial port configuration method may include the following steps.
101, under the condition that an application processor opens a port bridging application, acquiring a first configuration parameter of the port bridging application, configuring a first serial port as an AT serial port, and running the port bridging application on the application processor of the communication module, wherein the first serial port is a serial port corresponding to the first configuration parameter.
In the embodiment of the application, the port bridging application can be installed on the application processor, and the port bridging application is run on the application processor. Under the condition that the port bridging application is operated on the application processor, the application processor configures the first serial port to be the AT serial port through the port bridging application on the application processor of the communication module. The AT serial port is a serial port used for the communication module to receive and transmit AT commands.
The serial port of the embodiment of the application may be a physical serial port. The serial port is a short term serial interface, also called serial communication interface or serial communication interface (usually referred to as COM interface), and is an expansion interface adopting a serial communication method. A serial interface (serial interface) is a bit-by-bit sequential transfer of data. The two-way communication device is characterized in that the communication line is simple, and two-way communication can be realized only by a pair of transmission lines, so that the cost is greatly reduced, and the two-way communication device is suitable for long-distance communication.
Optionally, in step 101, the application processor obtaining the first configuration parameter of the port bridge application may include the following steps:
the application processor obtains a first configuration parameter of the port bridging application input by a user; or the application processor obtains a first configuration parameter of a default configuration of the port bridge application.
In this embodiment of the present application, the first configuration parameter may be a parameter input by a user, or may be a parameter configured by a default of the port bridge application. When the first configuration parameter is input by the user, the user can input the first configuration parameter on the communication module through a man-machine interaction program on the communication module. For example, the first configuration parameter is the number 1. According to the corresponding relation between the configuration parameters stored on the corresponding processor and the serial port, the serial port corresponding to the number 1 can be found to be the serial port 1.
Referring to table 1, table 1 is a table of correspondence between configuration parameters and serial ports provided in the embodiments of the present application.
TABLE 1
Configuration parameters Serial port
1 Serial port 1
2 Serial port 2
3 Serial port 3
4 Serial port 4
5 Serial port 5
As shown in table 1, the communication module is connected with 5 serial ports in total, and the configuration parameters can be numbers 1 to 5. Wherein, number 1 corresponds to serial port 1, number 2 corresponds to serial port 2, serial port 3 corresponds to serial port 3, number 4 corresponds to serial port 4, and number 5 corresponds to serial port 5. The correspondence table of the configuration parameters and the serial port may be stored in the application processor.
The first configuration parameter may be an entry for the port bridging application. The configuration of the first serial port to the AT serial port can be achieved by configuring the port to bridge the incoming parameters of the application. Specifically, the access parameter of the port bridging application may be configured to be a first configuration parameter, and because the first configuration parameter corresponds to the first serial port, the port bridging application may monitor an AT instruction sent to the application processor through the first serial port.
102, under the condition that the port bridging application monitors that the terminal equipment sends an AT instruction to the application processor through the first serial port, the application processor transmits instruction data of the AT instruction to a communication processor of the communication module through a communication channel, wherein the communication channel is a data transmission channel established between the application processor and the communication processor.
In the embodiment of the present application, the AT instruction is an instruction applied to connection and communication between the terminal device and the port bridging application. The communication channels may be shared data memory (Shared Data Memory, SDM) channels, which are one way in which inter-core communication may be performed in a multi-core system.
The port bridging application may monitor AT instructions sent to the application processor through the first serial port, i.e. AT instructions sent by the terminal device to the application processor through the first serial port, where the AT instructions include instruction data. Since the application processor does not have the capability to handle the AT execution, the application processor needs to transmit instruction data of the AT instruction to the communication processor via the communication channel. The communication channel is an inter-core communication channel between the application processor and the communication processor.
103, in case the port bridging application monitors reply data of the communication channel, the application processor transmits the reply data to the terminal device through the first serial port.
In this embodiment of the present application, after the application processor transmits the instruction data of the AT instruction to the communication processor of the communication module through the communication channel, the application processor may monitor the reply data of the communication channel through the port bridge application. And under the condition that the reply data of the communication channel is monitored, the application processor transmits the reply data to the terminal equipment through the first serial port.
Wherein the application processor may monitor the communication channel for data (i.e., reply data) communicated from the communication processor via the port bridging application.
Optionally, fig. 1 may further include the following steps.
104, when the port bridging application is closed, the application processor configures a serial port configured as an AT serial port before the port bridging application is closed as a data serial port.
Wherein step 104 is performed separately, for example, may be performed separately from steps 101 to 103. Step 103 may be associated with steps 101 to 103. For example, step 104 may be performed before step 101, after step 101, or after step 102 or step 103. Fig. 1 is performed as an example after step 103 with step 104.
When step 104 is performed after step 101, the application processor configures a serial port configured as an AT serial port before the port bridging application is closed as a data serial port, including: the application processor configures the first serial port as a data serial port.
In the embodiment of the application, the serial port used by the client can be configured as an AT serial port in the application processor, and a port bridging application can be written by using software, and can always monitor the communication channel. The AT instruction data of the communication channel can be acquired and processed by the AT instruction processing program on the communication processor side, and the communication processor sends the processing result (i.e., reply data) to the application processor through the communication channel.
Referring to fig. 2, fig. 2 is a schematic diagram of a connection relationship between a terminal device and a communication module according to an embodiment of the present application. As shown in fig. 2, the terminal device communicates with the communication module through a serial port. The overall transmission and processing flow of AT instructions is described below in conjunction with fig. 2. The communication channels in fig. 2 are illustrated by way of example as SDM channels.
In fig. 2, after the application processor configures the first serial port to be an AT serial port through the port bridging application, the receiving end (RX 1) of the first serial port of the application processor may receive an AT instruction sent by the terminal device through the first serial port, and after the port bridging application monitors the AT instruction received by the RX1, the AT instruction is sent through the sending end (TX 3) of the SDM channel of the application processor. After receiving the AT instruction through the SDM channel, the communication processor processes the AT instruction through the AT instruction processing program, sends the processing result to the application processor through the SDM channel, monitors the receiving end (RX 3) of the SDM channel to receive the reply result of the AT instruction by the port bridging application, and transmits the reply result to the terminal equipment through the transmitting end (TX 1) of the first serial port.
In the embodiment of the application, the first serial port is configured as the AT serial port by the port bridging application running on the application processor of the communication module, and the transmission of the AT instruction is realized by the communication channel established between the application processor and the communication processor.
Optionally, in step 101, the application processor configures the first serial port as an AT serial port, which may specifically include the following steps.
And the application processor determines a first file handle corresponding to the first configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opens the first file handle, and the port bridging application is used for monitoring whether the receiving end of the first serial port has data readable or not through the first file handle.
In this embodiment of the present application, in a case where a port bridging application is running on the application processor, the application processor determines a first file handle corresponding to the first configuration parameter according to a correspondence between the configuration parameter and the file handle, and opens the first file handle. The port bridging application is configured to monitor whether the receiving end of the first serial port has readable data through the first file handle.
Referring to table 2, table 2 is a correspondence table between configuration parameters and file handles provided in the embodiments of the present application.
TABLE 2
Configuration parameters File handle
1 FD1 file
2 FD2 file
3 FD3 file
4 FD4 file
5 FD5 file
As shown in table 2, the communication module is connected with 5 serial ports in total, and the configuration parameters can be numbers 1 to 5. Wherein, number 1 corresponds to FD1 file, number 2 corresponds to FD2 file, serial port 3 corresponds to FD3 file, number 4 corresponds to FD4 file, and number 5 corresponds to FD5 file. The correspondence table of configuration parameters and file handles may be stored in the application processor. In the embodiment of the present application, the file handle is a name of a file, a device, a socket, or a pipe, so as to help remember the name being processed and hide the complexity of some caches, etc. Opening a file handle may be understood as opening a corresponding file, device, socket, etc. for subsequent application operations. For example, the first file handle is an FD1 file, and if the FD1 file is opened, it can be monitored whether the receiving end of the first serial port (such as the RX1 port in fig. 2) has data readable.
Optionally, in step 102, when the port bridge application monitors that the terminal device sends the AT instruction to the application processor through the first serial port, the application processor transmits instruction data of the AT instruction to the communication processor of the communication module through the communication channel, and specifically may include the following steps.
When the port bridging application monitors that the receiving end of the first serial port has the readable instruction data of the AT instruction through the first file handle, writing the instruction data of the AT instruction into the file handle of the communication channel;
and when the AT instruction processing program running on the communication processor monitors that the sending end of the communication channel is readable through the file handle of the communication channel, the AT instruction processing program is used for reading the instruction data of the AT instruction through the file handle of the communication channel.
In the embodiment of the present application, the communication channel is exemplified by an SDM channel. And when the AT instruction processing program monitors that the TX3 has the data readable, the file handle of the SDM channel reads the instruction data of the AT instruction and processes the AT instruction to obtain reply data aiming AT the AT instruction.
Optionally, in step 103, in a case that the port bridge application monitors reply data of the communication channel, the application processor transmits the reply data to the terminal device through the first serial port, which may specifically include the following steps.
When the port bridging application monitors that the receiving end of the communication channel has readable data through the file handle of the communication channel, reading reply data aiming AT the AT instruction from the file handle of the communication channel, and writing the reply data into the first file handle;
and under the condition that the terminal equipment is used for monitoring that the data is readable at the transmitting end of the first serial port through the first file handle, the reply data is read from the first file handle.
In the embodiment of the present application, the communication channel is exemplified by an SDM channel. In the case where the port bridging application monitors that the receiving end of the SDM channel (RX 3 as shown in fig. 2) is readable by the file handle of the SDM channel, the port bridging application reads reply data for the AT instruction from the file handle of the SDM channel, and writes the reply data to the first file handle. And the terminal equipment monitors that the sending end (TX 1 shown in figure 2) of the first serial port has data readable through the first file handle, and reads the reply data from the first file handle.
Referring to fig. 3, fig. 3 is a flow chart of another serial port configuration method according to an embodiment of the present application. As shown in fig. 3, the serial port configuration method may include the following steps.
301, under the condition that an application processor opens a port bridging application, obtaining a first configuration parameter of the port bridging application, configuring a first serial port as an AT serial port, and running the port bridging application on the application processor of the communication module, wherein the first serial port is a serial port corresponding to the first configuration parameter.
302, under the condition that the port bridging application monitors that the terminal equipment sends an AT instruction to the application processor through the first serial port, the application processor transmits instruction data of the AT instruction to a communication processor of the communication module through a communication channel, wherein the communication channel is a data transmission channel established between the application processor and the communication processor.
303, in case the port bridging application monitors reply data of the communication channel, the application processor transmits the reply data to the terminal device through the first serial port.
The specific implementation of steps 301 to 303 may be referred to the specific descriptions of steps 101 to 103, and will not be repeated here.
304, the application processor terminates the port bridging application, so that the first serial port is switched from the AT serial port to the data serial port.
Step 304 may be performed after step 301, or step 304 may be performed after step 302 or step 303.
In step 301 of the present embodiment, the serial port type of the first serial port configured by the application processor through the port bridge is an AT serial port. When the client needs to modify the serial port type of the first serial port, step 304 is only executed, and the first serial port can be switched from the AT serial port to the data serial port by terminating the port bridging application running on the application processor. And terminating the port bridging application, wherein the port bridging application cannot transmit the data of the first serial port to the communication processor through the communication channel, and the communication module cannot receive and process the AT command.
The data serial port is a serial port for transmitting common data. For example, if the terminal device is a water meter, the water meter statistical water volume data can be transmitted to the communication module through the data serial port. If the terminal equipment is an ammeter, the electric quantity data counted by the ammeter can be transmitted to the communication module through the data serial port. If the first serial port is configured as an AT serial port on the communication processor, the first serial port cannot be modified from an AT serial port to a data serial port on the communication processor.
After executing step 304, if the first serial port needs to be modified from the data serial port to the AT serial port, a port bridging application is started, and step 301 is executed.
In the embodiment of the application, compared with the configuration of the first serial port as the AT serial port on the communication processor, the configuration of the first serial port as the AT serial port on the application processor is realized through the port bridging application, on the one hand, the software configuration and the compiling software version do not need to be readjusted, and the serial port configuration can be flexibly carried out. On the other hand, the type of the first serial port can be modified, and one serial port can be configured to transmit an AT command and used as an AT serial port or can be configured to transmit common data and used as a data serial port, so that the multiplexing capability of the serial port is improved. It should be noted that one serial port cannot be configured as an AT serial port and a data serial port AT the same time.
For example, switching the first serial port (serial port 1) from the AT serial port to the normal data serial port only needs to kill the port bridging application, AT this time, the SDM channel still exists, but the data from the serial port is not forwarded to the SDM channel, and the communication processor also does not receive the AT instruction data, where the first serial port is only used as the normal serial port to perform data communication between the terminal device and the application processor.
Referring to fig. 4, fig. 4 is a flow chart of another serial port configuration method according to an embodiment of the present application. As shown in fig. 4, the serial port configuration method may include the following steps.
401, under the condition that the application processor opens the port bridging application, obtaining a first configuration parameter of the port bridging application, configuring the first serial port as an AT serial port, running the port bridging application on the application processor of the communication module, where the first serial port is a serial port corresponding to the first configuration parameter.
And 402, under the condition that the port bridging application monitors that the terminal equipment sends an AT instruction to the application processor through the first serial port, the application processor transmits instruction data of the AT instruction to a communication processor of the communication module through a communication channel, wherein the communication channel is a data transmission channel established between the application processor and the communication processor.
403, in case the port bridging application monitors reply data of the communication channel, the application processor transmits the reply data to the terminal device through the first serial port.
The specific implementation of steps 401 to 403 may be referred to the specific descriptions of steps 101 to 103, and will not be repeated here.
404, restarting the port bridging application by the application processor, obtaining a second configuration parameter of the port bridging application, configuring the second serial port as an AT serial port, and configuring the second serial port as a serial port corresponding to the second configuration parameter.
Step 404 may be performed after step 401, and step 404 may be performed after step 402 or step 403.
In the embodiment of the present application, in step 401, the first serial port is configured as an AT serial port by a port bridging application running on an application processor. When the client needs to switch from the first serial port to the second serial port as the AT serial port, the modification of the AT serial port can be performed by the port bridging application only by executing step 404, and the first serial port is switched to the second serial port as the AT serial port.
The second configuration parameter may be user entered. The user can input the second configuration parameters on the communication module through a man-machine interaction program on the communication module. For example, the second configuration parameter is the number 2. According to the corresponding relation table (see table 1 above) between the configuration parameters and the serial ports stored on the corresponding processor, the serial port corresponding to the number 2 can be found to be serial port 2.
In step 401, after the first serial port is configured as the AT serial port, if the second serial port needs to be configured as the AT serial port on the port bridging application, step 404 is executed, the port bridging application is restarted, the first serial port is configured as the data serial port, the port bridging should obtain the second configuration parameter, and the second serial port is configured as the AT serial port.
After step 404 is performed, if it is required to switch from the second serial port to the first serial port as the AT serial port, step 401 is performed.
Optionally, in step 404, the application processor configures the second serial port as an AT serial port, which may specifically include the following steps.
And the application processor determines a second file handle corresponding to the second configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opens the second file handle, and the port bridging application is used for monitoring whether the receiving end of the second serial port has readable data or not through the second file handle.
In this embodiment of the present application, in a case where a port bridging application is running on the application processor, the application processor determines a second file handle corresponding to the second configuration parameter according to a correspondence between the configuration parameter and the file handle, and opens the second file handle. The port bridging application is configured to monitor whether the receiving end of the second serial port has readable data through the second file handle.
For example, the second configuration parameter is the number 2. According to the correspondence table (see table 2 above) between the configuration parameters and the file handles stored on the corresponding processor, the file handle corresponding to the number 2 may be found to be the FD2 file. Opening the FD2 file can monitor whether the receiving end (RX 2 as shown in fig. 5) of the second serial port (for example, serial port 2 in table 2) has data readable.
In this embodiment of the present application, from a first serial port (for example, serial port 1) serving as an AT serial port to a second serial port (for example, serial port 2) serving as an AT serial port, only the parameter entry of the port bridging application (from the first configuration parameter to the second configuration parameter) needs to be modified, and the port bridging application adjusts and opens the file handle of the corresponding serial port. For example, modifying the entry of the port bridging application as a second configuration parameter, determining a second file handle corresponding to the second configuration parameter by the application processor according to the corresponding relation between the configuration parameter and the file handle, and opening the second file handle to configure the second serial port as an AT serial port. If the entry of the modified port bridging application is a first configuration parameter, the application processor determines a first file handle corresponding to the first configuration parameter according to the corresponding relation between the configuration parameter and the file handle, and opens the first file handle, so that the serial port type of the first serial port can be configured as an AT serial port. The embodiment of the application can quickly change the AT serial port by modifying the access parameters of the port bridging application.
Optionally, after performing step 401, the following steps may also be performed.
(11) The application processor starts a splitting application of the port bridging application, obtains a second configuration parameter of the splitting application of the port bridging application, configures the second serial port as an AT serial port, and the second serial port is a serial port corresponding to the second configuration parameter.
In this embodiment of the present application, in step 401, after configuring the first serial port as an AT serial port, if a second serial port needs to be configured on the communication module as an AT serial port, step (11) is executed, and the application processor opens a splitting application of the port bridging application to obtain a second configuration parameter of the splitting application of the port bridging application, and configures the second serial port as an AT serial port, where the second serial port is a serial port corresponding to the second configuration parameter.
Because only one serial port can be configured as an AT serial port on one port bridging application, if the first serial port is configured as an AT serial port and the second serial port is configured as an AT serial port on the same port bridging application, the port bridging application needs to be restarted (i.e., the port bridging application is closed first and then opened), a second configuration parameter of the port bridging application is obtained, and the second serial port is configured as an AT serial port.
If a plurality of serial ports are configured as AT serial ports on the communication module, after the step 401 is executed to configure the first serial port as AT serial port, the step (11) may be executed, a split application of the port bridging application is started, a second configuration parameter of the split application of the port bridging application is obtained, the second serial port is configured as AT serial port, and the second serial port is a serial port corresponding to the second configuration parameter.
It should be noted that the port bridge application and the split application of the port bridge application are two different applications. The port bridging application may open one or more of the individual applications. When a plurality of split applications are started, each split application is a different application, and a serial port can be independently configured as an AT serial port.
Optionally, in step (11), the application processor configures the second serial port as an AT serial port, and may specifically include the following steps.
And the application processor determines a second file handle corresponding to the second configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opens the second file handle, and the split application of the port bridging application is used for monitoring whether the receiving end of the second serial port has data readable or not through the second file handle.
Referring to fig. 5, fig. 5 is a schematic diagram of configuring the second serial port as an AT serial port according to an embodiment of the present application. In fig. 5, after the port bridging application running on the application processor configures the serial port type of the second serial port as the AT serial port, the receiving end (RX 2) of the second serial port of the application processor may receive the AT instruction sent by the terminal device through the second serial port, and after the port bridging application monitors the AT instruction received by the RX2, the AT instruction is sent through the sending end (TX 3) of the SDM channel of the application processor. After the communication processor receives the AT instruction through the SDM channel, the AT instruction is processed through the AT instruction processing program, the processing result is sent to the application processor through the SDM channel, the port bridging application monitors that the receiving end (RX 3) of the SDM channel receives the reply result of the AT instruction, and the reply result transmits the reply data to the terminal equipment through the sending end (TX 2) of the second serial port.
In this embodiment of the present application, the serial port 1 is used as an AT serial port to the serial port 2 as an AT serial port, and only the parameter entry of the port bridging application (for example, the port bridging application is modified from the first configuration parameter to the second configuration parameter) needs to be modified, and the port bridging application adjusts and opens the file handle (for example, the FD2 file) of the serial port (for example, the serial port 2) corresponding to the second configuration parameter, so that the AT serial port is quickly modified.
The application processor configures the access parameters of the port bridging application as the file handle of the second serial port, and opens the file handle of the second serial port, which can be executed under the triggering of a client/user. For example, the user manually inputs the character "1", and the application processor considers that serial port 1 (the first serial port) is configured as an AT serial port. For another example, the user manually enters the character "2", and the application processor considers that serial port 2 (the second serial port) is configured as an AT serial port. For example, the user manually enters the character "1", the application processor passes the character "1" into the port bridging application, and opens the file handle (first file handle) of serial port 1.
Referring to fig. 6, fig. 6 is a schematic workflow diagram of a port bridging application according to an embodiment of the present application. As shown in fig. 6, after the port bridge application is started, a file handle of a certain path of serial port x may be opened according to the entry of the port bridge application, and whether the file handle of the serial port x has readable data or not may be monitored, if yes, the data may be forwarded to the SDM channel. The port bridging application may also open the file handle of the SDM channel and monitor whether the file handle of the SDM channel has data readable, and if so, forward the data to the serial port.
Monitoring whether the file handle (first file handle) of the serial port 1 has data readable refers to monitoring whether the serial port 1 has data readable through the file handle of the serial port 1. In terms of hardware, after the serial port has data, the data can exist in a buffer area of the serial port, a driver of the serial port can find that the data comes in, and the driver can tell the port to bridge an application: the serial port 1 has data, and the file handle (such as FD1 file) of the serial port 1 is monitored. Because the drive will tell serial port 1 the file handle, there is now data readable. At this time, the port bridge application will call a general read function (read function) to read the data of the serial port 1, and after the data of the serial port 1 is read, the data is written into the SDM channel. The specific flow of writing data to SDM channels includes: the SDM channel is told three parameters: file handle of SDM channel, data storage location (e.g., some block memory of serial port), size of data volume.
If the client uses the serial port 1 as an AT serial port, the application processor can trigger the client to transmit a file handle of the serial port 1 to the port bridge application, the port bridge application always monitors the file handle of the serial port 1 after being started, when the terminal device (for example, the SOC or the MCU) sends an AT instruction through the serial port 1, the port bridge application monitors that the file handle of the serial port 1 has data readable, the port bridge application writes the data into the SDM channel file handle after acquiring the data, monitors the SDM channel, an AT instruction processing program AT the communication processor side acquires the AT instruction data of the SDM channel, and replies after processing the AT instruction data, AT this moment, the port bridge application monitors that the SDM channel has data replying, reads the replying data and writes the data to the file handle of the serial port 1, AT this moment, the serial port 1 carries out serial port communication and transmits the replying information of the AT instruction to the terminal device, and the flow of single AT instruction interaction is ended. If the port bridging program is not exited, the configured serial port 1 always has the capability of normally replying to the AT instruction, and if the serial port 1 is used for data transmission AT the moment, the port bridging program is only required to be terminated, and the serial port 1 can be used as a data serial port.
In the embodiment of the application, different serial ports can be configured in real time to serve as AT serial ports, the serial ports can be switched to serve as AT serial ports or data serial ports according to the user application field Jing Dongtai in the running process of the port bridging application, when the position of the AT serial ports of a client changes (for example, the serial ports are adjusted from the serial ports 1 to the serial ports 2), software configuration and software version compiling are not required to be readjusted, the client can flexibly adjust the serial ports, meanwhile, the serial ports are used as AT serial ports to respond to AT instructions sometimes, the scene of data serial ports to transmit data sometimes can also be adapted, and the client can self-determine what type of serial ports exist in what time.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that the communication module, in order to implement the above-mentioned functions, includes corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application may divide the functional units of the communication module according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a serial port configuration device 700 provided in an embodiment of the present application, where the serial port configuration device 700 is applied to a terminal device, and the serial port configuration device 700 may include a configuration unit 701, a transmission unit 702, and an obtaining unit 703, where:
an obtaining unit 703, configured to obtain a first configuration parameter of a port bridging application when the port bridging application is opened, and configure a first serial port as an AT serial port;
a configuration unit 701, configured to configure a first serial port as an AT serial port, where the port bridge application runs on an application processor of the communication module, and the first serial port is a serial port corresponding to the first configuration parameter;
A transmission unit 702, configured to, when the port bridging application monitors that the terminal device sends an AT instruction to the application processor through the first serial port, transmit instruction data of the AT instruction to a communication processor of the communication module through a communication channel, where the communication channel is a data transmission channel established between the application processor and the communication processor;
the transmitting unit 702 is further configured to transmit, in a case where the port bridging application monitors reply data of the communication channel, the reply data to the terminal device through the first serial port.
Optionally, the serial port configuration device 700 may include a configuration unit, where the configuration unit is configured to configure, when the port bridge application is closed, a serial port configured as an AT serial port before the port bridge application is closed, as a data serial port.
Optionally, the configuring unit 701 configures the first serial port as an AT serial port, including: and determining a first file handle corresponding to the first configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opening the first file handle, and monitoring whether the receiving end of the first serial port has data readable or not by the port bridging application through the first file handle.
Optionally, the configuration unit 701 is further configured to restart the port bridge application to obtain a second configuration parameter of the port bridge application, configure the second serial port as an AT serial port, where the second serial port is a serial port corresponding to the second configuration parameter.
Optionally, the configuration unit 701 is further configured to start a splitting application of the port bridge application, obtain a second configuration parameter of the splitting application of the port bridge application, configure the second serial port as an AT serial port, and the second serial port is a serial port corresponding to the second configuration parameter.
Optionally, the configuring unit 701 configures the second serial port as an AT serial port, including:
and determining a second file handle corresponding to the second configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opening the second file handle, and monitoring whether the receiving end of the second serial port has data readable or not by the port bridging application through the second file handle.
Optionally, the obtaining unit 703 obtains a first configuration parameter of the port bridge application, including:
obtaining a first configuration parameter of the port bridging application input by a user;
Or, obtaining a first configuration parameter of a default configuration of the port bridge application.
Optionally, when the port bridge application monitors that the terminal device sends an AT instruction to the application processor through the first serial port, the transmission unit 702 transmits instruction data of the AT instruction to a communication processor of the communication module through a communication channel, where the transmission unit includes: when the port bridging application monitors that the receiving end of the first serial port has the readable instruction data of the AT instruction through the first file handle, writing the instruction data of the AT instruction into the file handle of the communication channel; and when the AT instruction processing program running on the communication processor monitors that the sending end of the communication channel is readable through the file handle of the communication channel, the AT instruction processing program is used for reading the instruction data of the AT instruction through the file handle of the communication channel.
Optionally, the transmitting unit 702 transmits, in a case where the port bridging application monitors reply data of the communication channel for the AT instruction, the reply data to the terminal device through the first serial port, where the reply data includes: when the port bridging application monitors that the receiving end of the communication channel has readable data through the file handle of the communication channel, reading reply data aiming AT the AT instruction from the file handle of the communication channel, and writing the reply data into the first file handle; and when the terminal equipment monitors that the data is readable through the first file handle, the reply data is read from the first file handle.
The transmission unit 702 and the obtaining unit 703 in the embodiment of the present application may be a communication module in a terminal device, and the configuration unit 701 may be a processor in the terminal device.
In the embodiment of the application, the first serial port is configured as the AT serial port by the port bridging application running on the application processor of the communication module, and the transmission of the AT instruction is realized by the communication channel established between the application processor and the communication processor.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a communication module provided in the embodiment of the present application, and as shown in fig. 8, the communication module 800 includes an application processor 801, a communication processor 802, and a memory 803, where the application processor 801, the communication processor 802, and the memory 803 may be connected to each other through a communication bus 804. The communication bus 804 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. Communication bus 804 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 8, but not only one bus or one type of bus. The memory 803 is used for storing a computer program comprising program instructions, the application processor 801 being configured to invoke the program instructions, the program comprising steps for performing part or all of the methods shown in fig. 1-4.
The application processor 801 may be a general purpose Central Processing Unit (CPU), microprocessor, application Specific Integrated Circuit (ASIC), or one or more integrated circuits for controlling the execution of the above-described program schemes.
The communication processor 802 may be a processor with communication capabilities. The communication processor may include a baseband chip plus a coprocessor. The communication processor 802 may also be referred to as a modem (modem).
The application processor 801 and the communication processor 802 may communicate via a communication channel. The communication channel may be an SDM channel.
The Memory 803 may be, but is not limited to, a read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a random access Memory (random access Memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a compact disc (Compact Disc Read-Only Memory) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be stand alone and coupled to the processor via a bus. The memory may also be integrated with the processor.
In addition, the communication module 800 may further include common components such as serial ports, communication interfaces, antennas, and the like, which are not described in detail herein.
In the embodiment of the application, the first serial port is configured as the AT serial port by the port bridging application running on the application processor of the communication module, and the transmission of the AT instruction is realized by the communication channel established between the application processor and the communication processor.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program makes a computer execute part or all of the steps of any one of the serial port configuration methods described in the embodiment of the method.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, such as the division of the units, merely a logical function division, and there may be additional manners of dividing the actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units described above may be implemented either in hardware or in software program modules.
The integrated units, if implemented in the form of software program modules, may be stored in a computer-readable memory for sale or use as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory includes: a U-disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-only memory, random access memory, magnetic or optical disk, etc.
The foregoing has outlined rather broadly the more detailed description of embodiments of the present application, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, the above examples being provided solely to assist in the understanding of the methods of the present application and the core ideas thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. The serial port configuration method is characterized by comprising the following steps:
under the condition of opening a port bridging application, obtaining a first configuration parameter of the port bridging application, configuring a first serial port as an AT serial port, wherein the port bridging application runs on an application processor of a communication module, and the first serial port is a serial port corresponding to the first configuration parameter;
Transmitting instruction data of the AT instruction to a communication processor of the communication module through a communication channel under the condition that the port bridging application monitors that the terminal equipment sends the AT instruction to the application processor through the first serial port, wherein the communication channel is a data transmission channel established between the application processor and the communication processor;
transmitting the reply data to the terminal equipment through the first serial port under the condition that the port bridging application monitors the reply data of the communication channel;
or when the port bridging application is closed, configuring the serial port configured as the AT serial port before the port bridging application is closed as the data serial port.
2. The method of claim 1, wherein configuring the first serial port as an AT serial port comprises:
and determining a first file handle corresponding to the first configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opening the first file handle, and monitoring whether the receiving end of the first serial port has data readable or not by the port bridging application through the first file handle.
3. The method of claim 2, wherein after the configuring the first serial port as an AT serial port, the method further comprises:
Restarting the port bridging application to obtain a second configuration parameter of the port bridging application, configuring the second serial port as an AT serial port, wherein the second serial port is a serial port corresponding to the second configuration parameter.
4. The method of claim 3, wherein configuring the second serial port as an AT serial port comprises:
and determining a second file handle corresponding to the second configuration parameter according to the corresponding relation between the configuration parameter and the file handle, opening the second file handle, and monitoring whether the receiving end of the second serial port has data readable or not by the port bridging application through the second file handle.
5. The method according to any of claims 1-4, wherein the obtaining the first configuration parameter of the port bridging application comprises:
obtaining a first configuration parameter of the port bridging application input by a user;
or, obtaining a first configuration parameter of a default configuration of the port bridge application.
6. The method according to claim 2, wherein, in the case where the port bridging application monitors that the terminal device sends an AT instruction to the application processor through the first serial port, transmitting instruction data of the AT instruction to the communication processor of the communication module through a communication channel, the method includes:
When the port bridging application monitors that the receiving end of the first serial port has the readable instruction data of the AT instruction through the first file handle, writing the instruction data of the AT instruction into the file handle of the communication channel;
and when the AT instruction processing program running on the communication processor monitors that the sending end of the communication channel is readable through the file handle of the communication channel, the AT instruction processing program is used for reading the instruction data of the AT instruction through the file handle of the communication channel.
7. The method of claim 2, wherein, in the case where the port bridging application monitors reply data for the AT instruction for the communication channel, transmitting the reply data to the terminal device through the first serial port comprises:
when the port bridging application monitors that the receiving end of the communication channel has readable data through the file handle of the communication channel, reading reply data aiming AT the AT instruction from the file handle of the communication channel, and writing the reply data into the first file handle;
and when the terminal equipment monitors that the data is readable through the first file handle, the reply data is read from the first file handle.
8. A serial port configuration device, comprising:
the device comprises an obtaining unit, a port bridging unit and a port bridging unit, wherein the obtaining unit is used for obtaining a first configuration parameter of the port bridging application and configuring a first serial port as an AT serial port under the condition of opening the port bridging application;
the configuration unit is used for configuring a first serial port as an AT serial port, the port bridging application runs on an application processor of the communication module, and the first serial port is a serial port corresponding to the first configuration parameter;
the port bridging application is used for transmitting the instruction data of the AT instruction to the communication processor of the communication module through a communication channel when the port bridging application monitors that the terminal equipment sends the AT instruction to the application processor through the first serial port, wherein the communication channel is a data transmission channel established between the application processor and the communication processor;
the transmission unit is further configured to, when the port bridging application monitors reply data of the communication channel, transmit the reply data to the terminal device through the first serial port;
or the serial port configuration device comprises a configuration unit, and the configuration unit is used for configuring the serial port configured as the AT serial port as the data serial port before the port bridging application is closed when the port bridging application is closed.
9. A communication module comprising an application processor, a communication processor and a memory, the memory for storing a computer program, the computer program comprising program instructions, the application processor being configured to invoke the program instructions to perform the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by an application processor, cause the application processor to perform the method according to any of claims 1-7.
CN202310488622.2A 2023-04-28 2023-04-28 Serial port configuration method, serial port configuration device, communication module and storage medium Pending CN116521264A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310488622.2A CN116521264A (en) 2023-04-28 2023-04-28 Serial port configuration method, serial port configuration device, communication module and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310488622.2A CN116521264A (en) 2023-04-28 2023-04-28 Serial port configuration method, serial port configuration device, communication module and storage medium

Publications (1)

Publication Number Publication Date
CN116521264A true CN116521264A (en) 2023-08-01

Family

ID=87404299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310488622.2A Pending CN116521264A (en) 2023-04-28 2023-04-28 Serial port configuration method, serial port configuration device, communication module and storage medium

Country Status (1)

Country Link
CN (1) CN116521264A (en)

Similar Documents

Publication Publication Date Title
EP2434687A1 (en) Data communication method, communication equipment and communication system
EP2518967B1 (en) Method, system and device for initializing internet device
CN215897719U (en) SIM card switching device and electronic equipment
CN116521264A (en) Serial port configuration method, serial port configuration device, communication module and storage medium
US6760586B1 (en) System and method for processing a handover of digital enhanced cordless telecommunication (DECT) line cards in a switching system
CN114401218B (en) Bypass forwarding method and device for data message
CN112134774B (en) Client front-end device, communication control method for client front-end device, and storage medium
EP3048858A1 (en) Wireless customer premise equipment and accessing method therefor
JP4005675B2 (en) Telecommunications equipment
JPWO2005066745A1 (en) Bus share adapter
CN107783722B (en) Data transmission method and data forwarding device
CN214098421U (en) Board card and communication system
CN108012284B (en) Method for dial-up networking, terminal equipment and computer readable storage medium
CA2325539A1 (en) Resource interface unit for telecommunications switching node
CN113014679B (en) Communication method, device and system
KR100236943B1 (en) A proxy atm signaling system and method using the permanent virtual circuits
CN114265732A (en) High-speed serial interface test method and device
US7325044B2 (en) Method for setting up a program-controlled circuit arrangement and circuit arrangement for execution of the method
KR100208384B1 (en) Smart-phone for aiding a plurality of communication protocol and transmission and reception method using the same
CN116244254A (en) RSMC chip, chip channel self-adaptive loading method and Beidou communication navigation device
KR200331393Y1 (en) Access Gateway Matching Device
KR20000009541A (en) Serial communication device and method thereof
KR200324720Y1 (en) An apparatus for transmitting the simple wireless data
CN117472662A (en) Method for adjusting and measuring serial port, main control board and network equipment
KR100597752B1 (en) Device with function of Bootstrap And Electronic Apparatus Comprising the device And Control Method Thereof

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