Summary of the invention
The object of the present invention is to provide a kind of method transmitting data between terminal equipment and mobile terminal, to realize multiple categorical data time sharing transmissions on a port.
Another object of the present invention is to provide the system transmitting data between a kind of terminal equipment and mobile terminal, there is the features such as cost is low, realization is simple, the development time is short.
The object of the invention is to be achieved through the following technical solutions.
Transmit a method for data between terminal equipment and mobile terminal, comprise step:
A: be connected by PORT COM and control port between terminal equipment with mobile terminal;
B: when changing wire data type, terminal equipment sends instruction by control port to mobile terminal;
C: after mobile terminal receives instruction, changes the Data Analysis program of PORT COM, and completes the instruction of changing rear response terminal equipment and sending;
D: transmit new data type by PORT COM after terminal equipment receives the response of mobile terminal.
Preferably, steps d also comprises the data transmission program that terminal equipment changes PORT COM.
Preferably, in step b, if mobile terminal request changes wire data type, then also comprise:
Mobile terminal reports its current state by control port, and informs its data type changed.
Preferably, described data type comprises pcm audio data, AT director data or grouped data.
Transmit a system for data between terminal equipment and mobile terminal, comprising: terminal equipment and mobile terminal, be connected by PORT COM and control port between terminal equipment with mobile terminal;
Described PORT COM is used between terminal equipment and mobile terminal, transmit all types of data,
Described control port for arranging the current data type transmitted in PORT COM,
Described terminal equipment, for when changing wire data type, sends instruction by control port to described mobile terminal as master control side;
Described mobile terminal, after receiving instruction, changes the Data Analysis program of PORT COM, and completes the instruction of changing the described terminal equipment of rear response and sending;
Described terminal equipment, also for receive described mobile terminal response after, transmit new data type by PORT COM.
The present invention compared with prior art, use two ports (PORT COM and control port) are only needed between terminal equipment of the present invention and mobile terminal, just can realize the time sharing transmissions of multiple categorical data in PORT COM, and Various types of data can not be disturbed mutually.Use this technology can save hardware cost, reduction realizes difficulty, and then save development time and development cost, improve the competitiveness of mobile terminal product.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to shown in Fig. 1, transmit the system block diagram of data between terminal equipment of the present invention and mobile terminal, comprising: terminal equipment and mobile terminal, be connected by PORT COM and control port between terminal equipment with mobile terminal.Wherein PORT COM is for transmitting all types of data, and control port is for arranging the current type at PORT COM transmitting data.
Terminal equipment is the master control side in data transmission procedure, PORT COM is transmitted which kind of data and is determined by terminal equipment.If terminal equipment initiatively changes the data type in PORT COM, terminal equipment just sends instruction to mobile terminal, informs the data type that mobile terminal is new on control port.After mobile terminal receives the control command that terminal equipment sends, change the Data Analysis program of PORT COM, and complete change after the instruction of sending of response terminal equipment.Terminal equipment receives the response of mobile terminal, can confirm that mobile terminal has been ready to receive data, PORT COM is transmitted new data.
If mobile terminal request changes the data type in PORT COM.Mobile terminal just reports the current state of mobile terminal by control port, indicate the data type expecting transmission.Terminal equipment receive mobile terminal report request after, just send instruction to mobile terminal, inform the data type that mobile terminal is new on control port, the consistent during data type that follow-up flow process initiatively changes in PORT COM with terminal equipment.
Embodiment one:
As shown in Figure 2, the data in PORT COM switch to pcm audio data flowchart by AT instruction, comprise step:
201, before switching, what PORT COM was transmitted is AT instruction, and what control port transmitted is also AT instruction.
202, when mobile terminal is called or has an electroshock bell, the state that mobile terminal reports oneself current by control port.
203, terminal equipment receives the reporting information of mobile terminal, sends instruction AT+SETPORTMODE=1 by control port to mobile terminal, represents that PORT COM will transmit pcm audio data.
204, mobile terminal changes the Data Analysis program of PORT COM, namely uses pcm audio Data Analysis program, prepares the pcm audio data that receiving terminal apparatus sends.
205, mobile terminal receives instruction AT+SETPORTMODE=1 on control port, responds " OK " as answer signal.
206, after terminal equipment receives " OK " response of mobile terminal instruction on control port, namely determine that mobile terminal is ready.Terminal equipment changes the data transmission program of PORT COM, namely uses pcm audio data transmission program.
207, switched, what PORT COM was transmitted is pcm audio data; What control port transmitted is AT instruction.
Embodiment two:
As shown in Figure 3, the data in PORT COM are AT instruction flow chart by pcm audio data exchange, comprise step:
301, before switching, what PORT COM was transmitted is pcm audio data, and what control port transmitted is AT instruction.
302, voice call terminates, and terminal equipment sends instruction AT+SETPORTMODE=0 by control port, represents and PORT COM will transmit AT instruction.
303, terminal equipment stops the data receiving PORT COM, stops in PORT COM and sends pcm audio data.
304, terminal equipment changes the data transmission program of PORT COM, namely uses AT instruction transmission program.
305, after mobile terminal receives instruction AT+SETPORTMODE=0 on control port, " OK " is responded as answer signal.
306, mobile terminal stops in PORT COM and receives pcm audio data.
307, mobile terminal changes the Data Analysis program of PORT COM, namely uses AT instructions parse program, prepares the AT instruction that receiving terminal apparatus sends.
308, after terminal equipment receives " OK " response of mobile terminal instruction on control port, namely determine that mobile terminal is ready.Terminal equipment sends AT instruction repertorie to mobile terminal in PORT COM.
309, switched, what PORT COM was transmitted is AT instruction, and what control port transmitted is also AT instruction.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.