A kind of method that realizes mobile phone wireless communication module plug and play
Technical field
The present invention relates to a kind of method that realizes mobile phone wireless communication module plug and play.
Background technology
At present, the develop rapidly of mobile communication technology is that mobile communication terminal has brought huge development space, particularly mobile phone to become new consumption hotspot especially.The implementation of mobile phone mainly contains dual mode at present:
A kind of mode is a chipset scheme whole and base band and radio circuit, and it adopts the veneer of standard or double circuit plate structure integration peripheral circuit to comprise keyboard, LCD, SIM card etc.The shortcoming of this design is that radio frequency and baseband circuit design are complicated, needs to test mobile communication function meticulously comprehensively, has increased research and development and production cost greatly, makes the R﹠D cycle prolong, and is unfavorable for releasing as early as possible new product.
The second way is with the radio communication circuit modularization, designs wireless communication module, and this module is welded on the main frame (HOST), adopts stable ripe wireless communication module to finish the encoding and decoding and the protocol stack operation of the transmitting-receiving of radio frequency, base band; And peripheral circuit comprises keyboard, LCD and SIM card etc., and they finish controlled function by main frame.This mode is used less at present in mobile phone, is applied to the personal information product usually and realizes radio communication function, and for example: in personal digital assistant system (PDA), wireless communication module generally is to be welded on main frame; Also have wireless communication module is designed to the monolithic printed board, connect together, but also do not support the pluggable mode of plug and play by board to board connector and main frame.Its hardware architecture is referring to Fig. 1, and Fig. 1 realizes the hardware architecture schematic diagram of radio communication function for prior art PDA.Wherein, wireless communication module 100 is finished the transmitting-receiving of radio frequency, the encoding and decoding and the protocol stack operation of base band, and its interface circuit 101 by itself links to each other with the interface circuit 111 of main frame 110; Main frame mainly is included as wireless communication module 100 provides power-supply battery 112, control interface to communicate by letter with main frame 110 other parts, finishing LCD shows, Keyboard Control, basic cell-phone function microcontroller (MCU) 113 such as management of charging and discharging, show man-machine interface, finish the loud speaker and the microphone (SPK﹠amp of LCDs (LCD) 114, output and the input audio signal of information interchange between user and the mobile phone and control activity; MIC) parts such as 115.
Realize the radio communication function software architecture among the PDA referring to Fig. 2, Fig. 2 realizes the software architecture schematic diagram of radio communication function for prior art PDA.Wireless communication module 200 is made up of software modules such as interface drive program 201, CSD agreement 202, AT command interpreter 203, ppp protocol 204, IP relaying 205, GSM/GPRS protocol stack 206, physical layers 207.
Corresponding with wireless communication module, main frame 210 is made up of software modules such as AT command handling procedure 211, IP application program 212, ICP/IP protocol 213, ppp protocol 214, interface drive programs 215.
Wherein interface drive program 201 in the wireless communication module 200 and the interface drive program 215 in the main frame 210 are corresponding in the PDA of same model.The PDA of different model can adopt different interfaces, so the PDA interface drive program of different model also can be different.
In the groundwork flow process under the above-mentioned software architecture be: during at transmission command, in host side, application program and if network interaction, at first corresponding message is encapsulated as AT order by the AT command processor, send by interface drive program again.At the wireless communication module end, module transfers actual protocol message to through AT command interpretation layer and sends to protocol stack after receiving the AT order by the interface driving.
During data, data flow drives directly in host side and wireless communication module end transparent transmission by interface in transmission, and without the processing of AT interpretation layer.The user can select CSD or GPRS to carry out the transmission of data.
(1) as selecting CSD outwards to transmit data, host side AT command handling procedure sends the AT order that requires to set up communication link by serial ports.Wireless module end AT command interpreter is handled after receiving the AT order by serial ports accordingly, and control CSD agreement is carried out being connected of data link with the GSM/GPRS agreement.After connecting, wireless module end AT command interpreter returns to the network information host side AT command handling procedure again, and AT command handling procedure just can carry out the transmission of data.
(2) as selecting GPRS outwards to transmit data, be responsible for the connection of link equally by host side AT command handling procedure, wireless module end AT command interpreter, GSM/GPRS agreement.After having connected, the transmission of data just can have been carried out.But, the transmission of data is by IP application program, ICP/IP protocol, the ppp protocol of host side, and the ppp protocol of wireless module, IP relaying are finished.
The great advantage of this design is exactly the design that only needs to revise the hand-set host part, has avoided the design iterations of radio frequency in the mobile phone (RF) and main baseband circuit, has shortened the R﹠D cycle, is convenient to manufacturer and releases new product quickly.But the wireless communicaltion module access of at present different producers lacks standardization, therefore need be subjected to many-sided restriction when design of hardware and software.
At present, it is more and more that cell-phone function develops, and performance is more and more higher, as music more true to nature, and color screen, the design of fashion more, multimedia application or the like.These are maximum powers that the cellphone subscriber changes planes.And these also make the handset displays of above-mentioned dual mode go out a common weak point: because radio communication circuit or wireless communication module all are fixedly welded on the mobile phone, must be when the user changes mobile phone for profile or additional function with mobile phone integral body jettisoning together, that is to say in the mobile phone and can also be abandoned by reusable wireless communication module, so caused very big waste.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of method that realizes mobile phone wireless communication module plug and play, can realize the plug and play of mobile phone wireless communication module, shorten the mobile phone development cycle, reduce the waste that causes when the user changes planes.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
A kind of method that realizes mobile phone wireless communication module plug and play, this method may further comprise the steps:
1) connects by serial communication interface circuit between mobile phone wireless communication module and the hand-set host, and the serial communication interface connector of mutual correspondence is set respectively on mobile phone wireless communication module and hand-set host;
2) hand-set host has judged whether that according to whether having the serial communication interface state to change the interruption that triggers the mobile phone wireless communication module is by serial communication interface connector insertion hand-set host; If there is the mobile phone wireless communication module to insert, then hand-set host sends this mobile phone wireless communication module of order startup by serial communication interface, and foundation is connected with cordless communication network.
This method may further include: when the mobile phone wireless communication module was extracted, the communication interface state changed to produce and interrupts, and hand-set host enters idle condition.
The signal of described communication interface circuit transmission can comprise: standard RS232 serial communication interface signal, power supply signal, system control signal and audio signal.
Step 2) interruption of described Interface status change triggering changes the interruption that triggers for the DSR signal level.
When the DSR signal level is uprised or during by high step-down, produced hard an interruption respectively by low, the notice hand-set host has the mobile phone wireless communication module to insert or the mobile phone wireless communication module is extracted.
This method may further include: during the hand-set host start, read DSR signal level state; If the DSR signal level is high, then the mobile phone wireless communication module is inserted, and hand-set host sends order by serial communication interface and starts this mobile phone wireless communication module, and foundation is connected with cordless communication network; If the DSR signal level is low, then hand-set host directly enters idle condition.
Described step 2) may further include: when the mobile phone wireless communication module is inserted, the identification of shaking hands of hand-set host and mobile phone wireless communication module; If shake hands successfully, then hand-set host sends this mobile phone wireless communication module of order startup by serial communication interface, and foundation is connected with cordless communication network; Otherwise hand-set host directly enters idle condition.
Described shake hands identifying can for: the mobile phone wireless communication module sends synchronous request signal to hand-set host; Hand-set host returns the confirmation of synchronization signal and confirms after receiving this signal, asks mobile phone wireless communication module transmitting apparatus number simultaneously; The mobile phone wireless communication module is received request back Returning equipment number; Hand-set host receives and carries out device number identification behind this device number, after identification is correct again the Returning equipment confirmation signal confirm.
By technical scheme of the present invention as seen, the method of this realization mobile phone wireless communication module plug and play of the present invention, the serial ports of employing standard carry out between hand-set host and the mobile phone wireless communication module connection with communicate by letter, realized the plug and play of mobile phone wireless communication module, improved mobile phone wireless communication module standardization level, the mobile phone development cycle can be shortened, the waste that causes when the user changes planes can be reduced.
Description of drawings
Fig. 1 realizes the hardware architecture schematic diagram of radio communication function for prior art PDA;
Fig. 2 realizes the software architecture schematic diagram of radio communication function for prior art PDA;
Fig. 3 is the flow chart of hand-set host in the preferred embodiment of the present invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with embodiment and accompanying drawing, the present invention is described in more detail.
Present embodiment adopts Fig. 1, hardware architecture and software architecture shown in Figure 2 in mobile phone.Wherein, what adopt in the interface circuit present embodiment in the hardware architecture is the RS232 serial communication interface of standard, and is provided with the interface connector of mutual correspondence on mobile phone wireless communication module and hand-set host respectively; Accordingly, interface drive program has adopted the serial port drive program in software architecture.
Whether the hand-set host basis has the interruption that the DSR signal change of serial ports triggers in the present embodiment, judged whether the insertion of mobile phone wireless communication module, realized the plug and play of wireless communication module, even if hand-set host is in open state, also can identify wireless communication module at once and insert or extract, and when wireless communication module inserts, change the network service state automatically over to.
Referring to Fig. 3, Fig. 3 is the flow chart of hand-set host in the preferred embodiment of the present invention.This flow process may further comprise the steps:
Step 301, mobile phone power-on initialization serial ports.
Step 302 reads serial ports DSR level, and judges whether to be height; If the DSR level is high, then wireless communication module inserts hand-set host by interface connector, enters step 305; If the DSR level is low, enter step 303, mobile phone enters the free time (IDLE) state.
Step 304, when wireless communication module inserted, the DSR level was uprised by low, and DSR takies the interrupt bit of CPU, and the variation of DSR level will produce a hardware interrupts like this, notify corresponding operating system module to insert mobile phone, enter step 305; DSR kept high level after wireless communication module inserted hand-set host and begins operate as normal.
The identification of shaking hands of step 305,306,307, hand-set host and wireless communication module: the mobile phone wireless communication module sends synchronization request (SYNC_REQ) signal to hand-set host; Hand-set host returns confirmation of synchronization (SYNC_ACK) signal and confirms after receiving this signal, asks mobile phone wireless communication module transmitting apparatus number (ID) simultaneously; The mobile phone wireless communication module is received request back Returning equipment number; Hand-set host carries out recognition of devices after receiving this device number, after identification is correct again Returning equipment number confirm that (ID_ACK) signal confirms.If shake hands successfully, then hand-set host starts wireless communication module by the AT order, and the beginning search network, enters normal communication state; Otherwise change step 303 over to, mobile phone enters the IDLE state, and provides the failure information of shaking hands on the hand-set host screen.
Step 308, when wireless communication module was extracted, the DSR level was by high step-down, produce to interrupt, thereby operating system known wireless communication module and left hand-set host.Because the hand-set host program is after wireless communication module inserts hand-set host and begins operate as normal, CPU is revised as low level with the DSR interrupt mode and interrupts, so in case DSR becomes low level, just produce and interrupt.At this moment, wireless communication module automatic disconnection network connects, and enters step 309, and hand-set host is closed wireless communication module; Change step 303 over to, mobile phone enters the IDLE state, provides corresponding information simultaneously on mobile phone screen.
By the above embodiments as seen, the method of this realization mobile phone wireless communication module plug and play of the present invention, the serial ports of employing standard separates wireless communication module with mobile phone, realized the wireless communication module plug and play, has improved mobile phone wireless communication module standardization level.Make mobile communication function separate like this,, can at any time the mobile phone wireless communication module be inserted mobile phone, finish communication function as long as on mobile phone, reserve the interface of standard with mobile phone.When not needing to use communication function, the user can take out wireless communication module from mobile phone, do not influence other function of user's operating handset, thereby the power consumption of having saved mobile phone has improved battery life.Simultaneously, owing to saved and develop wireless communication module again, make the greatly reduction of mobile phone research and development and product cost, and shortened product development cycle, improved listing speed, satisfied the demand that the user often changes planes.