CN100579261C - Method for simulating AT command report - Google Patents

Method for simulating AT command report Download PDF

Info

Publication number
CN100579261C
CN100579261C CN200710120628A CN200710120628A CN100579261C CN 100579261 C CN100579261 C CN 100579261C CN 200710120628 A CN200710120628 A CN 200710120628A CN 200710120628 A CN200710120628 A CN 200710120628A CN 100579261 C CN100579261 C CN 100579261C
Authority
CN
China
Prior art keywords
command response
result
response result
application program
order
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.)
Expired - Fee Related
Application number
CN200710120628A
Other languages
Chinese (zh)
Other versions
CN101119522A (en
Inventor
叶建盟
周晓明
张旭辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN200710120628A priority Critical patent/CN100579261C/en
Publication of CN101119522A publication Critical patent/CN101119522A/en
Application granted granted Critical
Publication of CN100579261C publication Critical patent/CN100579261C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a method to send the simulating AT order. The present invention opens the serial port and builds the AT order communication passage with the mobile terminal(UE) through starting the PC side application procedure; the present invention chooses the response result of the AT order which needs to be enforced in the simulating software, writes the chosen response result in the deploy document through the simulating software, then makes the PC side application procedure send AT order to the UE and wait for the UE sending order result, after the PC side application procedure reads the AT order result and the AT order response result in the deploy document, the present invention replaces the order result sent by the UE according to the necessity; if the result is sent by the simulating software initiatively, the present invention puts the AT order response result in the document in the back of the communication terminal sending order result and sends the last result to the upper to handle; the upper takes the result as the communication terminal sending result when the upper handles the result input by the simulating software to realize the needing result.

Description

A kind of method of simulating the AT command report
Technical field
The present invention relates to the command report technology in the communication software exploitation, relate in particular to the method that a kind of simulation reports the AT order.
Background technology
AT (Attention) order is the function command that terminal equipment (TE, Terminal Equipment) sends to terminal adapter (TA, Terminal Adapter), because of the AT order is normally gained the name with the character string of letter " AT " beginning.
Current, fast development along with 3G (Third Generation) Moblie (3G) technology, allow user's amusement whenever and wherever possible and office become a reality gradually, increasing user (the PC that uses a computer, Personal Computer) by the Internet on the wireless access way of portable terminal (UE, User Equipment) with communicate by letter.Therefore, during end product, exploitation one cover PC side application program is managed and is used the resource of UE to be very important in exploitation in UE supplier, and communicating by letter with all ordering by AT and realize between PC and UE at present.Here, UE can be regarded as the intelligent terminal of TA function integrated, can receive AT by TA and order the function setting that realizes UE and carry out service interaction with mobile communications network.For example, the user can send the AT order by the PC side application program that links to each other with UE and UE be realized functions such as calling, short message, telephone directory, data service, fax.
In the development process of PC side application program, need the cooperation of UE just can finish functions such as debugging and test, if the UE function is also incomplete or unstable, the exploitation of PC side application program will be subjected to very big influence, has delayed development progress.Particularly at initial stage of development, can there be a lot of problems in portable terminal, as: can't registered network; Can't carry out problems such as audio call, PC side application program almost can't be debugged and test.In addition, even portable terminal is complete and stable,, can not finish the debugging and the test of function if there is not the support of network.Such as: TD SDMA (TD-SCDMA) network is just in process of construction now, signal does not also cover fully, if the exploitation place in PC side application program does not have the TD-SCDMA network signal, so, also can't carry out the debugging and the test of voice, SMS.Want under the condition that does not have enough equipment and network, to carry out the exploitation of PC side application program, just need a kind of method to realize the response of AT order,, accelerate the progress of research and development so that PC side application program is debugged and tested.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method of the AT of simulation command report, can simulate the processing procedure of various related services between UE and mobile communications network, simulative debugging and test, thus accelerate research and development speed.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of method of simulating the AT command report, the computer-side application program with open serial ports after portable terminal is connected, set up the communication port between the AT order of computer and portable terminal, this method comprises the steps:
A, computer-side application program issue the AT order by serial ports to portable terminal, and wait for mobile terminal reporting command response result;
B, the AT that selects the computer-side application program to issue order pairing command response result, selected command response result is write configuration file, and configuration file is kept in the computer-side respective storage areas;
C, computer-side application program are obtained AT command response result, each AT command response result is cut apart, extract the response word string among the command response result, after handling result put into the command response formation, and the selected command response result of step b is inserted in the command response formation;
D, computer-side application program are handled the command response result in the command response formation.
This method further comprises: the simulation softward that has copying in the computer-side setting;
Described step b is realized by the simulation softward that computer-side is provided with.
Wherein, the pairing command response result of the described selection computer-side of step b application program transmitting order to lower levels, be specially: read the AT command response result who edits in advance, and described command result is presented in the tabulation, change the current AT command result that needs simulation by in tabulation, directly choosing.
The pairing command response result of order that the described selection computer-side of step b application program issues further comprises: revise selected order.
The described AT of the obtaining command response of step c result is: regularly read the AT command response result who reports by serial ports, or regularly read the command response result that the AT command response result that reports and portable terminal initiatively report by serial ports.
Described each the AT command response result of cutting apart of step c is: the data of taking out the response word string that comprises among the AT command response result.
After handling described in the step c result being put into the command response formation is specially: read the AT command response result of configuration file, select to replace the command result that portable terminal reported; If the result that simulation initiatively reports then is put into the AT command response result in the configuration file after the command result that portable terminal reports, as the part of command response formation.
Step c is described to be put into the command response formation with result and is specially: if do not set up the command response formation, then with the head of the queue of described result as the command response formation; If have the command response formation, then described result is joined the tail of the queue of formation or any position in the insertion formation.
Step c is described to be inserted into the selected command response result of step b in the command response formation, is specially: any position that the selected command response result of step b is inserted into the command response formation.
This method further comprises: the computer-side application program is added the debugging code that simulation receives order in reading the code of serial ports, the code that is added is controlled by macro switch; And when the computer-side application program was formally issued, described simulation received selected the closing of code function of order.
The method of simulation AT command report provided by the present invention, have the simulation softward of AT order copying in the setting of PC side, simulate the response results after UE carries out the AT order, and report PC side application program and further handle, therefore, the present invention has the following advantages and characteristics:
1) PC side application program can be developed and debug to the inventive method under the incomplete situation of network function, can also simulate various possible results, make the test and the debugging more comprehensively, complete, can as often as possible find the problem that PC side application program may exist, and application programs improves and perfect, thereby makes PC side function of application more perfect and stable.For example, can select response results arbitrarily when debugging, repeat the result that some are difficult to reproduction, in the time of as incoming call, come a note again, make test process more convenient, test result is more reliable.
2) method of the present invention is when test and debugging software, and UE can not rely on the support of mobile network signals, has therefore reduced the communication cost cost in the test processs such as conversation, note.
Description of drawings
Fig. 1 is PC side application program and UE connected mode schematic diagram;
Fig. 2 is the method flow diagram that PC side application program cooperates with AT order simulation softward in the embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing and embodiments of the invention method of the present invention is described in further detail.
Fig. 1 is PC side application program and UE connected mode schematic diagram, and as shown in Figure 1, PC can pass through serial communication interface (COM) or usb mode and connect by serial communication mode and UE devices communicating, and wherein, described serial communication interface is called for short serial ports.Store the response data packet of AT order among the UE, each command execution success or not all has corresponding return results.
The AT command processing module of PC side application program utilization inside communicates by serial ports and UE, after PC side application program is opened serial ports, sends the AT order to UE; UE resolves after receiving the AT order, then the execution result of ordering to PC side application response AT; PC side application program is handled after receiving this response results, and can the identification mode display result with the user.In this way, the user can realize functions such as setting, conversation, transmission/reception short message to UE.
Fig. 2 is the method flow diagram that PC side application program cooperates with AT order simulation softward in the embodiment of the invention, and used TE in the present embodiment is typically wireless network card and mobile phone, below is referred to as UE; Used main frame is typically PC; Be provided with in the PC and operation has two kinds of softwares: a kind of is the PC side application program that is used for management terminal device, another kind be have copying, can simulate the AT command execution results and report the software of PC side application program, be called simulation softward.As shown in Figure 2, the method for simulation AT command report of the present invention mainly comprises the steps:
Step 201: start PC side application program and be connected, open the AT command communication passage that serial ports is set up PC and UE with UE.
Through this step, make PC side application program and terminal equipment can carry out proper communication.
Step 202:PC side application program issues the AT order by serial ports to UE, and waits for that UE reports the command response result.
Described response results is that the form with character string reports to the PC side, and for example, the response format that the AT order is returned is:<CR〉<LF〉<instruction is correlated with AT character string〉<CR〉<LF 〉.
For instance, simulation once sends a telegram here/go into to call out the indication incident: when UE receives an incoming call, UE will initiatively report an AT command response result, be r nRING r n r nOK r n, wherein: r represent<CR, being the character of carriage return, also is the termination character of every order; N represent<LF, i.e. Huan Hang character also is to respond the format character;
The basic format that the result is responded in above-mentioned AT order is:<CR〉<LF〉<the response word string〉<CR〉<LF〉<OK/ERROR〉[ERROR information].In the present embodiment, the response word string is RING;<OK/ERROR〉status report be OK.
Wherein, the status report (OK, ERROR) of AT order has following several situation usually:
If AT command format mistake then can be returned " ERROR " character string;
If enabled the extended error report (+CMEE), then can return string "+CME ERROR:<Err〉" or "+CMS ERROR:<SmsErr〉" and different error codes;
If the success of AT command execution then can return string " OK ".
Step 203: the AT that selects PC side application program to issue by simulation softward orders pairing command response result, by simulation softward selected command response result is write configuration file, and configuration file is kept in the corresponding memory block of PC side.
Such as, in order to simulate an incoming call incident, prepared the AT command option of what a incoming call in simulation softward in advance, ordering is: r nNG r n r nOK r n, and write configuration file by simulation softward with this command response result this moment.
Described configuration file is meant a kind of text of single file, operate on the windows platform, carry out the interface of data communication as simulation softward and PC side application program, can read each item number certificate in the configuration file by Windows standard application program interface (API) function.The present invention uses the ini formatted file as configuration file, can certainly use forms such as txt, xml.Usually, configuration file comprises following content:
[AT_SIM_CONFIG]
AT_SIM_ON=0
AT_SIM_INSERT_HEAD=0
AT_SIM_OUTPUT=\r\n+CMTI:“SM”,1\r\n。
Here, [AT_SIM_CONFIG] expression configuration section (SECTION); AT_SIM_ON, AT_SIM_INSERT_HEAD, AT_SIM_OUTPUT are configuration item.Wherein, the AT_SIM_ON item represents whether analog functuion is opened, if AT_SIM_ON=0 represents that then this analog functuion is for closing; If AT_SIM_ON=1 represents that then this analog functuion is an open state.The AT_SIM_INSERT_HEAD item represents whether the AT result of simulation to be inserted into the foremost of AT command result formation.The command response result that the AT_SIM_OUTPUT item indicates to simulate is that this result produces for simulation softward, be that the user needs Simulation result.The user selects a command response result in simulation softward after, simulation softward can be write the command response result that the user selects in this configuration item, PC side application program can read this configuration item, and the command response result who selects is inserted in the AT command response result queue.
The described pairing command response result of order who selects PC side application program to issue by simulation softward, be meant that simulation softward can read the AT command response result who edits in advance, the command response result who reads is presented in the tabulation, and the user directly chooses in tabulation just can change the current AT command result that needs simulation.Here, the user also can revise immediately to the order of selecting.
Step 204:PC side application program is obtained AT command response result, the AT command response result that each is complete is cut apart, extract the response word string among the command response result, after handling result put into the command response formation, and the selected command response result of step 203 is inserted in the command response formation, wait for that PC side application program handles.
Here, the described AT of obtaining command response result can be that PC side application program regularly reads the AT command response result that simulation softward reports by serial ports, wherein also can comprise the AT command response result that UE initiatively reports.
Can judge by the value of AT_SIM_ON item in the configuration file whether simulation softward opens the simulation reporting functions, for simulation softward, whether this reporting functions is opened does not have difference, and for PC side application program, if the unlatching reporting functions is attended school and is got Simulation result; If close reporting functions, then do not read Simulation result.
Generally, PC side application program is added one section debugging code and is finished the function that simulation receives order in reading the code of serial ports, and this partial code can when formal PC side application issued, can be closed this analog functuion by a macro switch control.Described macro switch is meant that in code one of definition is grand, and the code in this macrodefinition can be compiled, if not definition then can not compile.Purpose is when formal releasing software, can remove the code of analog functuion by the cancellation macrodefinition, and not influence formal edition code.
Described reporting functions is meant the configuration item in configuration file, as AT_SIM_ON=1, if reading this configuration item is, represents that then reporting functions opens at 1 o'clock; If be 0, represent that then reporting functions closes.In addition, by add new item at configuration file, can also control other function, thereby realize function expansion.
Be exactly to extract to respond word string from AT command response result described AT command response result is cut apart, specifically, AT command response result's form is:<CR〉<LF<respond word string<CR<LF, be exactly taking-up<CR described cutting apart〉<LF between the data of response word string.
After described the processing result is put into the command response formation specifically: read the AT command response result of configuration file, select to replace the command response result that UE reported; If the command response result that simulation initiatively reports then is put into the AT command response result in the configuration file after the command response result that UE reports, as of command response formation.Described command response formation is meant the set with one or more command response results of the form tissue of data structures such as array or chained list in internal memory of PC side application program.
Wherein, describedly result is put into the command response formation be specially:, then this is handled the head of the queue of result as the command response formation if this fashion is not set up the command response formation; If there has been the command response formation, then this handled the result and join the tail of the queue of formation or any position in the insertion formation.
Wherein, the described selection replacement command response result that UE reported replaces as required.Because the situation of the response results that has is difficult to take place in practice, for example, in the time of incoming call, come note again, this moment is when needing to verify whether the response results that UE reports has done correct processing in PC side application program, perhaps when need test receive a mistake as a result the time, whether PC side application program can carry out correct processing is fault-tolerance, if the command response result who replaces UE and reported this moment, can verify the robustness of PC side application program.
Described the selected command response result of step 203 being inserted in the command response formation, can be that the command response result that needs insert is placed on any position in the command response formation, receives the command response result that different sequential are sent with simulation.Such as: when the semaphore of inquiry terminal, can simulate and before obtaining the semaphore Query Result, come the note or the situation of note afterwards.
Step 205:PC side application program is handled the command response result in the command response formation.
Here, because PC side application program is handled the processing procedure that belongs to upper layer software (applications) to the command response result, and different PC side application program processing modes is also different, as long as the AT designator standardization in the formation of AT command response, upper layer software (applications) can both be made correct processing.
For example, PC side application program is carried out the timing inquiry to terminal equipment, on needing, the command response result gives the correct time, PC side application program can read the data of serial ports and the data in the configuration file, merges then, reports the upper strata again and handles, when the upper strata handle r nRING r n r nOK r n when order, will think has incoming call, and pop-up window prompting or play sound and carry out voice suggestion under software interface, thereby finishes the overall process of simulate incoming call.
According to above step, can also simulate incidents such as note, come being reported as of AT order of short message event correspondence: r n+CMTI: " SM ", 2 r n; The AT of short message state report correspondence is: r n+CDSI: " SM ", 1 r n; Simulation the other side is hung up being reported as of corresponding AT order: r nHANGUP:0 r n etc.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.

Claims (10)

1, a kind of method of simulating the AT command report, the computer-side application program with open serial ports after portable terminal is connected, set up the communication port between the AT order of computer and portable terminal, it is characterized in that this method comprises the steps:
A, computer-side application program issue the AT order by serial ports to portable terminal, and wait for mobile terminal reporting command response result;
B, the AT that selects the computer-side application program to issue order pairing command response result, selected command response result is write configuration file, and configuration file is kept in the computer-side respective storage areas;
C, computer-side application program are obtained AT command response result, each AT command response result is cut apart, extract the response word string among the command response result, carry out after the dividing processing result being put into the command response formation, and the selected command response result of step b is inserted in the command response formation;
D, computer-side application program are handled the command response result in the command response formation.
2, method according to claim 1 is characterized in that, this method further comprises: the simulation softward that has copying in the computer-side setting;
Described step b is realized by the simulation softward that computer-side is provided with.
3, method according to claim 1 and 2, it is characterized in that, the AT that the described selection computer-side of step b application program issues orders pairing command response result, be specially: read the AT command response result who edits in advance, and described command result is presented in the tabulation, change the current AT command result that needs simulation by in tabulation, directly choosing.
4, method according to claim 1 and 2 is characterized in that, the AT that the described selection computer-side of step b application program issues orders pairing command response result further to comprise: revise selected order.
5, method according to claim 1 and 2, it is characterized in that, the described AT of the obtaining command response of step c result is: regularly read the AT command response result who reports by serial ports, describedly regularly read the AT command response result who reports by serial ports and comprise by serial ports and regularly read the AT command response result that the AT command response result that reports and portable terminal initiatively report.
6, method according to claim 1 and 2 is characterized in that, step c is described to be divided into each AT command response result: the data of taking out the response word string that comprises among the AT command response result.
7, method according to claim 1 and 2, it is characterized in that, carrying out result being put into the command response formation after the dividing processing described in the step c is specially: read the AT command response result of configuration file, select to replace the AT command response result that portable terminal reported; If the result that simulation initiatively reports then is put into the AT command response result in the configuration file after the AT command response result that portable terminal reports, as the part of command response formation.
8, method according to claim 1 and 2 is characterized in that, step c is described to be put into the command response formation with result and be specially: if do not set up the command response formation, then with the head of the queue of described result as the command response formation; If have the command response formation, then described result is joined the tail of the queue of formation or any position in the insertion formation.
9, method according to claim 1 and 2, it is characterized in that, step c is described to be inserted into the selected command response result of step b in the command response formation, is specially: any position that the selected command response result of step b is inserted into the command response formation.
10, method according to claim 1 and 2 is characterized in that, this method further comprises: the computer-side application program is added the debugging code that simulation receives order in reading the code of serial ports, the code that is added is controlled by macro switch; And when the computer-side application program was formally issued, described simulation received selected the closing of code function of order.
CN200710120628A 2007-08-22 2007-08-22 Method for simulating AT command report Expired - Fee Related CN100579261C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710120628A CN100579261C (en) 2007-08-22 2007-08-22 Method for simulating AT command report

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710120628A CN100579261C (en) 2007-08-22 2007-08-22 Method for simulating AT command report

Publications (2)

Publication Number Publication Date
CN101119522A CN101119522A (en) 2008-02-06
CN100579261C true CN100579261C (en) 2010-01-06

Family

ID=39055410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710120628A Expired - Fee Related CN100579261C (en) 2007-08-22 2007-08-22 Method for simulating AT command report

Country Status (1)

Country Link
CN (1) CN100579261C (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9319492B2 (en) 2008-07-18 2016-04-19 Lg Electronics Inc. Method and an apparatus for controlling messages between host and controller
CN101860892A (en) * 2009-04-11 2010-10-13 深圳富泰宏精密工业有限公司 Test system and method for simulating phone AT command
CN102196483A (en) * 2010-03-03 2011-09-21 英华达(南京)科技有限公司 Simulation testing system and simulation testing method for mobile communication device
CN101984717B (en) * 2010-11-19 2016-07-27 中兴通讯股份有限公司 A kind of method of data synchronization, mobile terminal and data synchronous system
CN102739340B (en) * 2011-04-08 2016-03-16 深圳富泰宏精密工业有限公司 AT order active reporting response processing system and method
CN102833125A (en) * 2011-06-17 2012-12-19 腾讯科技(深圳)有限公司 Test server, test system adopting test server, and test method
CN103580942B (en) * 2012-08-02 2016-12-21 重庆重邮信科通信技术有限公司 A kind of simulative serial port method of testing and device
CN103019686B (en) * 2012-11-20 2016-11-23 北京思特奇信息技术股份有限公司 A kind of system across two middlewares and Compilation Method thereof
CN104461574B (en) * 2014-12-23 2018-06-19 上海斐讯数据通信技术有限公司 A kind of order line processing unit and method based on XML
CN107172640B (en) * 2017-07-13 2021-06-22 惠州Tcl移动通信有限公司 Method for simulating Modem to report message, storage medium and terminal
CN108076153A (en) * 2017-12-21 2018-05-25 深圳市四面信息科技有限公司 A kind of the big data transmission method and system of anti-AT obstructions
CN110049003A (en) * 2019-03-01 2019-07-23 上海数创医疗科技有限公司 The method and device that AT instruction is divided by frame
CN110113403B (en) * 2019-04-28 2021-12-28 深圳创维数字技术有限公司 AT instruction processing method and device and computer equipment
CN111866766A (en) * 2020-07-20 2020-10-30 石家庄市善理通益科技有限公司 Method and device for realizing function module interaction through AT instruction

Also Published As

Publication number Publication date
CN101119522A (en) 2008-02-06

Similar Documents

Publication Publication Date Title
CN100579261C (en) Method for simulating AT command report
US7277700B2 (en) System and method for emulating a telephony driver
AU2007312879A1 (en) An interactive system and process
US20070117560A1 (en) Remote testing of mobile terminals
US20170251326A1 (en) Interactive system and process
CN201392526Y (en) Onboard test system for mobile applications
CN101946462A (en) Targeted queries using an oma dm protocol
CN103118048A (en) Data synchronization method, server and terminal
WO2014106385A1 (en) Method and system for integrating information about each contact person and mobile terminal
CN102420891A (en) Mobile terminal and test method, equipment and system thereof
US20050172264A1 (en) Architecture for converting control types in a data bound user interface
CN105915703A (en) Linking method and system of service function interface and mobile phone end desktop
CN102752744A (en) Problem solving method and device for mobile terminal
CN110278272B (en) Universal method for simulating Socket request
CN103237050B (en) Intelligent sound exchange method and system
CN100334917C (en) A method and system for compatibility test of subscriber identification module tool kit card
CN103514003B (en) Program installation method and device
CN101136780A (en) Method, system to obtain user command information, and user command registered device
KR100585577B1 (en) Test method for mobile communication terminals based on auto-making of test scenario file
CN101650686A (en) Developing and using method of intelligent mobile phone based on Ethernet Over USB
CN110264035A (en) Configuration method, device, terminal and the storage medium of workflow
van den Bos et al. TULP2G–an open source forensic software framework for acquiring and decoding data stored in electronic devices
CN102215501A (en) Method for realizing automated testing of AT (Automated Testing) command of wireless module
CN101662770B (en) Method for accessing wireless application protocol network, mobile terminal, server and system
WO2012053194A1 (en) Subscriber identity module and terminal device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20080206

Assignee: SHENZHEN ZTE MICROELECTRONICS TECHNOLOGY CO., LTD.

Assignor: ZTE Corporation

Contract record no.: 2015440020319

Denomination of invention: Method for simulating AT command report

Granted publication date: 20100106

License type: Common License

Record date: 20151123

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100106

Termination date: 20160822