CN101052031B - Data interaction method for Apple computer and radio communication terminal - Google Patents

Data interaction method for Apple computer and radio communication terminal Download PDF

Info

Publication number
CN101052031B
CN101052031B CN2007101076597A CN200710107659A CN101052031B CN 101052031 B CN101052031 B CN 101052031B CN 2007101076597 A CN2007101076597 A CN 2007101076597A CN 200710107659 A CN200710107659 A CN 200710107659A CN 101052031 B CN101052031 B CN 101052031B
Authority
CN
China
Prior art keywords
data
communication terminal
wireless communication
carry out
apple computer
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.)
Active
Application number
CN2007101076597A
Other languages
Chinese (zh)
Other versions
CN101052031A (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 CN2007101076597A priority Critical patent/CN101052031B/en
Publication of CN101052031A publication Critical patent/CN101052031A/en
Application granted granted Critical
Publication of CN101052031B publication Critical patent/CN101052031B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The method comprises: the computer opens the hardware port, and sends data to driver; after receiving the data, the driver writes the received data into the hardware port; after receiving the data, the hardware port initiates a call to the radio communication terminal to establish communication connection; after said radio communication terminal answers the call, said communication connection is established; the computer is driven to run, registers multi call-back functions, and hangs up read thread to wait the semaphore having incoming data; when the driver of the computer receives the data from the radio communication terminal, it triggers the semaphore having incoming data, and starts to execute the call-back functions; the call-back function dequeues data from buffer, and sends it to the computer to complete the receiving of data.

Description

Apple computer and wireless communication terminal carry out the method for data interaction
Technical field
The present invention relates to a kind of mobile communication and computer technology, specifically, relate to the method that a kind of Apple computer and wireless communication terminal carry out data interaction.
Background technology
Wireless communication terminal comprises that mobile phone, wireless data card, wireless communication module etc. have the equipment or the parts of wireless communication function.
Along with popularizing of wireless telecommunication system and terminal and computer, realize that the fusion application of mobile communication and computer has possessed wide space.Microsoft has developed WDM (Windows DriverModel) driver model under the Window.WDM simplifies the exploitation of driver by a kind of flexible way is provided, on realizing, reduce and reduce the quantity and the complexity of the driver that institute must develop to the basis of new hardware supports, use WDM to make hardware drive program more stable, allow operating system hardware control hardware more effectively.WDM supports USB, brand-new hardware standards such as IEEE 1394, ACPI.Among the global computer user, Apple Computers occupy no small share, and more and more equipments is supported Apple Computers, but the Apple Computers use is Mac OS operating system, this model is encapsulated.
Along with wireless communication technique and development of computer, carry out data interaction between wireless communication terminal and the computer and become possibility, realize data interaction between wireless communication terminal and the Apple computer but lack this effective method in the prior art.
Summary of the invention
Technical problem solved by the invention provides the method that a kind of Apple computer and wireless communication terminal carry out data interaction, can realize the data interaction between Apple computer and the wireless communication terminal.
Technical scheme is as follows:
A kind of Apple computer and wireless communication terminal carry out the method for data interaction, and step comprises:
(1) opens the hardware device port, send data to driving;
(2) after driving received data, the interface that uses bus driver to provide write the data that receive to the hardware device port;
(3) after the hardware device port receives data, make a call, set up communication and connect to wireless communication terminal, treat that described wireless communication terminal is replied after, described communication connects to set up to be finished;
(4) drive operation, register at least one call back function, read thread suspension and wait for the semaphore that has data;
(5) after the data of wireless communication terminal transmission are received in described driving, trigger the semaphore that has data, begin to carry out call back function, call back function sends to described computer with the dequeuing data in the buffer memory, finishes the reception of data.
Further, in the step (1), open the hardware device port by application software; In the step (5), described data send to upper application software.
Further, in step (2) or the step (5), the preemptive type that uses interrupt priority level to carry out among single CPU is carried out, and has perhaps used spin lock to carry out seizing of many CPU; Use the mode of semaphore, thread block and event notice to carry out asynchronous execution; Use the mode of multithreading, many caching process to read and write concurrent execution.
Further, in the step (2), show the success of transmission data by EOT; In the step (5), show that by EOT receiving data finishes.
Further, in the step (3), by the mode of AT order, the control wireless communication terminal makes a call; Perhaps directly make a call, after treating end communication replied, then set up described communication and connect by wireless communication terminal.
Another technical problem solved by the invention provides the method for a kind of Apple computer to wireless communication terminal transmission data, can make that Apple computer sends data by interface to wireless communication terminal.
Technical scheme is as follows:
A kind of Apple computer is to the method for wireless communication terminal transmission data, and step comprises:
A, open the hardware device port, send data to driving;
After B, driving received data, the interface that uses bus driver to provide write the data that receive to the hardware device port;
C, described device port make a call to wireless communication terminal after receiving data, set up communication and connect, treat that described wireless communication terminal is replied after, described communication connects to set up to be finished;
D, connect to described wireless communication terminal by described communication and to send data.
Further, among the step B, the preemptive type that uses interrupt priority level to carry out among single CPU is carried out, and has perhaps used spin lock to carry out seizing of many CPU; Use the mode of semaphore, thread block and event notice to carry out asynchronous execution; Use the mode of multithreading, many caching process to read and write concurrent execution.
Further, among the step D, show the success of transmission data by EOT.
Another technical problem solved by the invention provides the method that a kind of Apple computer receives the wireless communication terminal data, makes Apple computer can receive the data of wireless communication terminal.
Technical scheme is as follows:
A kind of Apple computer receives the method for wireless communication terminal data, and step comprises:
A, make a call, set up communication and connect to wireless communication terminal, treat that described wireless communication terminal is replied after, described communication connects to set up to be finished;
At least one call back function is registered in b, driving operation, reads thread suspension and waits for the semaphore that has data;
C, after the data that wireless communication terminal sends are received in described driving, trigger the semaphore that has data, begin to carry out described call back function, described call back function is with the dequeuing data in the buffer memory and send, and finishes the reception of data.
Further, among the step c, the preemptive type that uses interrupt priority level to carry out among single CPU is carried out, and perhaps uses spin lock to carry out seizing of many CPU; Use the mode of semaphore, thread block and event notice to carry out asynchronous execution; Use the mode of multithreading, many caching process to read and write concurrent execution.
This communication modes is owing to the seamless link that has realized between wireless communication terminal and the Macintosh, offer the Apple computer communication interface, this communication interface can be RS232 interface or Modem interface, makes and can realize data interaction between Apple computer and the wireless communication terminal.So that on Apple computer exploitation based on the UI software of other agreements of RS232 interface or Modem interface bearing, to realize more more rich functions.
Description of drawings
Fig. 1 is the flow chart that the preferred embodiment of the present invention sends data;
Fig. 2 is the flow chart that the preferred embodiment of the present invention receives data.
Embodiment
Apple computer is by USB (Universal Serial Bus, USB), interface modes such as PCMCIA (Personal Computer Memory Card International Association, PCMCIA (personal computer memory card international association) standard), PCI (Peripheral Component Interconnect) Express are realized being connected and data communication with wireless communication terminal.Apple computer provides to drive CDC (Communication Device communication device class Class) equipment class is mapped to the host-host protocol of RS232 and Modem, and realize that the read-write of the asynchronous communication data flow of hardware, emphasis of the present invention are that the read-write interface of asynchronous communication data flow of hardware is in the implementation method of PC driving side.
According to the CDC communications protocol, the read-write model of the asynchronous communication data flow of hardware under the Macintosh has been proposed, with the control of the asynchronous read and write of realizing hardware, and provide interface to upper level applications, be used to develop User Interface program.The method that Macintosh that the present invention proposes and wireless data terminal carry out data interaction, be a kind of model that a kind of Macintosh kernel program is handled peripheral hardware in essence, be used for Macintosh and wireless communication terminal and carry out data interaction, for example AT order etc., thus can realize more application.
The core of this programme is to realize seizing the asynchronous data communication between the wireless communication terminal and Apple computer under the CPU processing mode.Technical solution of the present invention needn't be concerned about hardware is how to be connected on the Apple computer, and different connected modes is as long as Apple computer is supported corresponding bus driver, for example USB, Express slot and PCMCIA slot or the like.As long as hardware has realized that based on CDC agreement ACM (the abstract controlling models of Abstract Control Model) the driving read-write model in this method just can be suitable for.
In the technical solution of the present invention, the processing of communication streams is divided into sends and receive two processes, be as the criterion with computer.These two handling processes on hardware based on CDC agreement ACM controlling models, say it is full duplex, asynchronous transmission from the angle of logic, be that the recipient does not know when data arrive, and need solve with communication protocol, promptly add start bit and stop bit at beginning and end.
At this, the data that send and receive can be the multi-medium datas that comprises speech data and/or view data.
The method that adds the start bit is before sending data, sends 61 and inserts start bit 0, notifies bus data synchronous with this.The method that adds stop bit is after DTD, sends 61 and inserts stop bit 0.
Among the present invention, to the processing of live signal be divided into to the transmission of signal with receive two processes, two processing procedures all are on the basis of having set up with the communication of opposite end wireless telecommunications system.
At first needing to set up communication with the opposite end wireless telecommunications system is connected, communication connects and can be made a call by the control wireless communication terminal by the mode of Macintosh by forms such as AT orders, perhaps directly make a call, after treating end communication replied, just set up the communication connection by wireless communication terminal.Also can make a call by the opposite end wireless communication terminal, receive calling after, answer by Macintosh software and to reply, connect thereby set up communication.
Send reason flow process and the interface channel that receives shared computer of flow process and wireless communication terminal, both are parallel in time carries out.
With reference to the accompanying drawings, the preferred embodiments of the present invention are described in detail.
With reference to shown in Figure 1, the concrete steps that signal sends processing procedure are as follows.
The first step: the application software on the Apple computer is opened the hardware device port, sends data to driving.
Step S101: the application software Mac application program on the Apple computer writes data to serial ports.
Second step: drive and receive data, do corresponding processing, the interface that uses bus driver to provide writes data to the hardware device port.
Particularity at driving has following special processing:
Consider that preemptive type is carried out among single CPU, used interrupt priority level in the model; Consider seizing of many CPU, used spin lock in the model; Consider asynchronous execution, used the mode of semaphore, thread block and event notice in the model; Consider the concurrent execution of read-write, the multithreading that uses in the model, many caching process mode; Consider execution efficient, used formation, multithreading of transceive data etc. in the model.
Principle is as follows:
1. data are pressed into formation one by one by byte, up to queue full, perhaps data all are pressed into.
2. in the team data are arranged this moment, need handle.Application t sends to bus driver with the information among the t, returns.
3. because driving is an asynchronous process, after hardware received, bus driver can know that bus driver will be called the call back function among the t, illustrates to write and finishes.Repeat 1 to 3 process, all finish up to this transmission.
4. whether the byte number that calculates this transmission is the integral multiple of hardware pipe single transmission bag maximum number of byte, if EOT is shaken hands to finish communication so, waits the termination character readjustment, shows to send successfully.
For asynchronous process and concurrent, must safeguard an array T in the model, each member t has buffer memory and configuration information, when when certain transmission data, using one of them to write, application is to the right to use of t, other transmission afterwards can not continue to use this buffer memory, when inferior transmission is finished, discharges the right to use to this t.If all t of T is occupied, this transmission can't be applied for t so, will hang up transmission automatically.
Specifically comprise the steps:
Step S102: drive and receive data, begin to handle.
The parameter of She Zhiing is as follows herein:
The note byte length is: nSize; It is nWrite that note has write the serial ports byte; The note write queue is Q; It is T that note is write the buffer memory array; The maximum packet byte number of note serial ports pipe is N.
Step S103: judge that whether nWrite is less than nSize.
If nWrite is less than nSize, execution in step S111; Otherwise, execution in step S121.
Step S111: when satisfying nWrite, judge further whether Q fills up less than nSize.If do not fill up, execution in step S112; Otherwise, execution in step S113.
Step S112: when Q does not fill up, in Q, write execution in step S111 after the byte.
Step S113: when Q fills up, begin the information of Q is write serial ports.
Step S114: look for operable position t among the T, call back function A is set in t, mark t is unavailable, and the information of t is write pipe, finishes hardware by the usb bus driving and writes.
Step S115: interruption that execution may exist or other read-write.
Step S116:USB bus writes to be finished, and calls call back function A.
Step S117: whether judgement writes successful.
If success, execution in step S118; Otherwise, execution in step S105.
Step S118:, judge whether the byte number that writes hardware is the integral multiple of N when writing success.
If be the integral multiple of N, execution in step S119; Otherwise, illustrate that mark position t can use execution in step S103.
Step S119: the transmission byte number is 0 protocol package, call back function A is set, execution in step S115.
Step S121: as nWrite during greater than nSize, send byte number and be 1 end packet, content is 0 * 13, as end mark.
Step S122:USB bus writes to be finished, and calls call back function A.
Step S123: whether judgement writes successful.
If success, execution in step S104; Otherwise execution in step S105.
Step S104: write the data success to serial ports, finish.
Step S105: write data failure to serial ports, finish.
The 3rd step: the hardware device port is received data, handles, make a call to wireless communication terminal then, in order to connect, treat that wireless communication terminal is replied after, communication connect to be set up and to be finished.After call setup is finished, send data to wireless communication terminal by the hardware device port.
The 4th step: wireless communication terminal is received data, handles.
With reference to shown in Figure 2, signal receives processing procedure and comprises the steps.
The first step: drive operation, register a plurality of call back functions, read thread suspension and wait for the semaphore that has data.
Application software on the Apple computer is opened the hardware device port, and wireless communication terminal sends data to Macintosh.
Second step: wireless communication terminal sends data, and bus driver receives, and triggers the semaphore that has data, and begins to carry out call back function, with the dequeuing data in the buffer memory, sends to the upper application software of Macintosh in the call back function.
Particularity at driving has following special processing:
Consider that preemptive type is carried out among single CPU, used interrupt priority level in the model; Consider seizing of many CPU, used spin lock in the model; Consider asynchronous execution, used the mode of semaphore, thread block and event notice in the model; Consider the concurrent execution of read-write, the multithreading that uses in the model, many caching process mode; Consider execution efficient, used formation, multithreading of transceive data etc. in the model.
Concrete steps are as follows:
Step S201: hardware writes data to serial ports.
Step S202: enter the driving call back function.
The parameter of She Zhiing is as follows herein:
It is P that note is read formation; It is R that note is write the buffer memory array; It is N that note is write the maximum packet byte number of serial ports pipe.
At this moment, drive call back function has been set in R, carry out read operation, and hang up and wait for.Buffer is separately all arranged among the R, have data to come, just data are read among the corresponding buffer, enter call back function then as hardware.
Step S203: the some drivings among the corresponding R write P with the nSize byte data, continue read operation, and hang up and wait for.
At this, the note byte length is nSize; The byte that note has write call back function is nRead.
Step S204: not empty as P, the setting signal amount triggers the read data incident, with atomic way P is handled.
Step S205: judge whether to satisfy nRead less than nSize, and P is not empty.
When condition satisfies execution in step S206; Otherwise, execution in step S207.
Step S206: go out team from P as much as possible, adding up is saved among the buffer, then, continues execution in step S205.
Step S207: send the result of buffer to upper level applications.
Step S208: judge whether to satisfy nRead less than nSize.
If condition satisfies, then execution in step S209.
The 3rd step: if all data of this transmission all receive, so termination character number is write transmit queue, be ready for sending end mark, the transmit queue EOT.
Step S209: is byte that 1 end packet writes P, signalization, and asynchronous transmission is to hardware.
Step S210: write the data success to serial ports, flow process finishes.
The 4th step: upper application software is received data, finishes receiving.

Claims (10)

1. Apple computer and the wireless communication terminal method of carrying out data interaction, step comprises:
(1) opens the hardware device port, send data to driving;
(2) after driving received data, the interface that uses bus driver to provide write the data that receive to the hardware device port;
(3) after the hardware device port receives data, make a call, set up communication and connect to wireless communication terminal, treat that described wireless communication terminal is replied after, described communication connects to set up to be finished;
(4) drive operation, register at least one call back function, read thread suspension and wait for the semaphore that has data;
(5) after the data of wireless communication terminal transmission are received in described driving, trigger the semaphore that has data, begin to carry out described call back function, described call back function is finished the reception of data with dequeuing data in the buffer memory and transmission.
2. the method that Apple computer according to claim 1 and wireless communication terminal carry out data interaction is characterized in that, in the step (1), opens the hardware device port by application software; In the step (5), described data send to upper application software.
3. the method that Apple computer according to claim 1 and wireless communication terminal carry out data interaction, it is characterized in that, in step (2) or the step (5), the preemptive type that uses interrupt priority level to carry out among single CPU is carried out, and has perhaps used spin lock to carry out seizing of many CPU; Use the mode of semaphore, thread block and event notice to carry out asynchronous execution; Use the mode of multithreading, many caching process to read and write concurrent execution.
4. the method that Apple computer according to claim 1 and wireless communication terminal carry out data interaction is characterized in that, in the step (2), shows the success of transmission data by EOT; In the step (5), show that by EOT receiving data finishes.
5. the method that Apple computer according to claim 1 and wireless communication terminal carry out data interaction is characterized in that, in the step (3), by the mode of AT order, makes a call by the control wireless communication terminal; Perhaps directly make a call, after treating end communication replied, then set up described communication and connect by wireless communication terminal.
6. an Apple computer sends the method for data to wireless communication terminal, and step comprises:
A, open the hardware device port, send data to driving;
After B, driving received data, the interface that uses bus driver to provide write the data that receive to the hardware device port;
C, described device port make a call to wireless communication terminal after receiving data, set up communication and connect, treat that described wireless communication terminal is replied after, described communication connects to set up to be finished;
D, connect to described wireless communication terminal by described communication and to send data.
7. Apple computer according to claim 6 is characterized in that to the method for wireless communication terminal transmission data among the step B, the preemptive type that uses interrupt priority level to carry out among single CPU is carried out, and has perhaps used spin lock to carry out seizing of many CPU; Use the mode of semaphore, thread block and event notice to carry out asynchronous execution; Use the mode of multithreading, many caching process to read and write concurrent execution.
8. Apple computer according to claim 6 is characterized in that to the method for wireless communication terminal transmission data, among the step D, shows the success of transmission data by EOT.
9. an Apple computer receives the method for wireless communication terminal data, and step comprises:
A, make a call, set up communication and connect to wireless communication terminal, treat that described wireless communication terminal is replied after, described communication connects to set up to be finished;
At least one call back function is registered in b, driving operation, reads thread suspension and waits for the semaphore that has data;
C, after the data that wireless communication terminal sends are received in described driving, trigger the semaphore that has data, begin to carry out described call back function, described call back function is with the dequeuing data in the buffer memory and send, and finishes the reception of data.
10. Apple computer according to claim 9 receives the method for wireless communication terminal data, it is characterized in that, among the step c, the preemptive type that uses interrupt priority level to carry out among single CPU is carried out, and perhaps uses spin lock to carry out seizing of many CPU; Use the mode of semaphore, thread block and event notice to carry out asynchronous execution; Use the mode of multithreading, many caching process to read and write concurrent execution.
CN2007101076597A 2007-05-23 2007-05-23 Data interaction method for Apple computer and radio communication terminal Active CN101052031B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101076597A CN101052031B (en) 2007-05-23 2007-05-23 Data interaction method for Apple computer and radio communication terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101076597A CN101052031B (en) 2007-05-23 2007-05-23 Data interaction method for Apple computer and radio communication terminal

Publications (2)

Publication Number Publication Date
CN101052031A CN101052031A (en) 2007-10-10
CN101052031B true CN101052031B (en) 2011-08-10

Family

ID=38783223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101076597A Active CN101052031B (en) 2007-05-23 2007-05-23 Data interaction method for Apple computer and radio communication terminal

Country Status (1)

Country Link
CN (1) CN101052031B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546415B (en) * 2012-01-11 2018-02-02 深圳市科陆电子科技股份有限公司 A kind of method based on quick transmitting-receiving ether network packet on vxworks platforms
CN103077145B (en) * 2012-12-28 2016-11-02 Tcl康钛汽车信息服务(深圳)有限公司 A kind of data sending, receiving method and system
US10083068B2 (en) * 2016-03-29 2018-09-25 Microsoft Technology Licensing, Llc Fast transfer of workload between multiple processors
WO2019041242A1 (en) * 2017-08-31 2019-03-07 爱普(福建)科技有限公司 Configurable communication gateway and communication method based thereon
CN110674067B (en) * 2019-09-23 2021-06-29 中国科学院微小卫星创新研究院 Configuration connection system and method for communication simulation between hardware
CN111511045B (en) * 2020-04-10 2023-06-02 玳能科技(杭州)有限公司 Interaction method and device for mobile terminal and computer, electronic equipment and storage medium
CN112100103B (en) * 2020-11-19 2021-03-16 飞天诚信科技股份有限公司 Communication method and system based on apple operating system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1545022A (en) * 2003-11-18 2004-11-10 海信集团有限公司 Method of large capacity movable memory for mobile telephone
CN1684030A (en) * 2005-03-16 2005-10-19 西安电子科技大学 Code flow broadcast card and driving method of code flow collection card

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1545022A (en) * 2003-11-18 2004-11-10 海信集团有限公司 Method of large capacity movable memory for mobile telephone
CN1684030A (en) * 2005-03-16 2005-10-19 西安电子科技大学 Code flow broadcast card and driving method of code flow collection card

Also Published As

Publication number Publication date
CN101052031A (en) 2007-10-10

Similar Documents

Publication Publication Date Title
CN101052031B (en) Data interaction method for Apple computer and radio communication terminal
CN108628684B (en) DPDK-based message processing method and computer equipment
EP1680900B1 (en) Configurable protocol engine
CN110138553B (en) IPSec VPN gateway data packet processing device and method
EP2552081A2 (en) Interrupt management
CN101882116A (en) Method for realizing audio transmission and mobile terminal
CN108494817A (en) Data transmission method, relevant apparatus and system
CN101207924B (en) Method for processing multi-user connections in high speed grouped data terminal
CN112769905B (en) NUMA (non uniform memory access) architecture based high-performance network card performance optimization method under Feiteng platform
CN111064771B (en) Network request processing method and system
CN109388597A (en) A kind of data interactive method and device based on FPGA
Lo et al. The implementation of a high-performance ORB over multiple network transports
CN101567873B (en) Multitask Parallel processing method and multitask parallel processing system
CN101449254B (en) Flow control for universal serial bus (USB)
CN105025063A (en) Online data transmission method for large-scale terminal equipment
CN101931700B (en) Method for realizing communication between smart mobile phone chips and smart mobile phone
JP2001519060A (en) Controllerless modem
AU2003261095A1 (en) Data channel resource optimization for devices in a network
CN111427806A (en) Method for sharing serial port by dual-core AMP system, storage medium and intelligent terminal
CN110909359A (en) Communication method based on dual-system architecture and terminal equipment
CN100493018C (en) Communication method via bus interface of network and and system thereof
CN115495406A (en) Message transmission method, device, equipment and storage medium based on PCIe
CN113271336B (en) DPDK-based robot middleware DDS data transmission method, electronic equipment and computer-readable storage medium
CN105808463A (en) Serial port output method for debugging information in embedded system
CN106506617B (en) Data compression method and equipment

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