Embodiment
The present invention is described in detail below in conjunction with drawings and Examples.
Consult Fig. 1, Fig. 1 is that the present invention utilizes terminal to carry out the process flow diagram of method first embodiment of the wireless switching of lantern slide.The embodiment of the invention comprises the steps:
Step S1, set up with lantern slide playing equipment between bluetooth be connected.
Such as, mobile communication terminal and lantern slide playing equipment all have Bluetooth function, the present invention's mentioned terminal in full is example with the mobile phone, certainly be not limited to mobile phone, can be that any terminal with Bluetooth function comprises panel computer etc., lantern slide playing equipment is example with the computer in addition, also is not limited to computer certainly.
Computer is set up blue teeth wireless with mobile phone and is connected, and mobile phone is as main equipment, and computer is as slave unit.Before needs carried out lantern slide control, the bluetooth module of mobile phone carried out the inquiry of peripheral bluetooth equipment, initiated connection request after finding this computer.The bluetooth module of computer is waited for establishment of connection, and receives connection request, sets up bluetooth with the bluetooth module of mobile phone and is connected.
Before carrying out above-mentioned bluetooth connection, at first, the bluetooth module of computer need be finished the parameter setting in advance, this parameter setting comprises and sweep parameter is set, is provided with whether to need to verify, be provided with paging overtime etc., after setting up above-mentioned each parameter, the bluetooth module of computer such as just enters at state to be connected.Then, the bluetooth module of mobile phone selects to enter slide demonstration pattern (promptly entering in the application of control lantern slide switching).The bluetooth module of mobile phone is inquired about and matching process like this, obtains the address of the bluetooth module of computer, and connection request is initiated in the address of the bluetooth module of the computer that obtains according to inquiry.Bluetooth connects after the foundation, just can carry out the transmitting-receiving of data.
Step S2 is setting up the size and Orientation that obtains the terminal acceleration after bluetooth connects.
Such as, embedded in mobile phone has action sensing module, and action sensing module is an acceleration transducer.This acceleration transducer obtains the acceleration of mobile phone in real time, and acceleration is a vector, promptly needs to obtain the size and Orientation of acceleration.
This step is the seizure to user action, acceleration transducer can the sensing mobile phone in the acceleration change of three-dimensional all directions, three-dimensional comprises: X, Y and Z direction, acceleration has positive and negative branch, same in the coordinate system of acceleration transducer self, the acceleration opposite with these three directions is defined as negative acceleration.
When mobile phone up and down, about or front and back when acceleration is arranged, acceleration transducer will obtain its acceleration, and the three-dimensional of report current phone, be the size of the acceleration of X-axis, Y-axis and these three directions of Z axle, also comprise the negative direction size of the acceleration of the negative direction of X-axis, Y-axis and Z axle just certainly.This acceleration transducer can be when the mobile phone acceleration changes, the size and Orientation of real-time report three-dimensional acceleration, draw the motion state of current phone again according to the size and Orientation data computation of acceleration, thereby catch user's action, i.e. left and right sides whipping mobile phone, whipping mobile phone or stir mobile phone etc. up and down.Certain hour is built in the mobile phone configuration file, also can be defined voluntarily by user's actual demand.
Step S3 judges whether the size of acceleration reaches first threshold.
Such as, this first threshold values can be built in a fixed numeric values of mobile phone configuration file, and at this moment, the user can't change this numerical value; This first threshold also can be to be kept at the value that is provided with voluntarily by the user in the mobile phone file system.If the value that the user is provided with, then according to this numerical value at the pairing position ID of file system, this fixed value is read from file system, assignment is given the variable in the internal memory.
By the variation of calculating the mobile phone acceleration in the certain hour draw mobile phone whether on certain direction by whipping.As, when mobile phone left during whipping, will be in direction left, promptly the positive dirction of X-axis obtains acceleration, reach first threshold values according to the size of the acceleration of the direction left of mobile phone in the certain hour, just can draw mobile phone by left whipping.
Step S4 if the size of acceleration reaches first threshold, converts switching command to according to the direction of acceleration, if the direction of acceleration is a first direction, convert to the page up switching command,, convert downward one page switching command to if the direction of acceleration is a second direction.
Such as, after action sensing module captures user action, and judge that this user action is effective, promptly the size of acceleration reaches first threshold, expresses the switching intention of user to lantern slide.
At this moment, need to convert this action to the lantern slide switching command.Lantern slide mainly contains two kinds of switching modes: switch and one page switching downwards to page up.
General, the machine of will swinging one's arm left, the direction of acceleration is defined as first direction, is converted to the page up switching command, the machine of will swinging one's arm to the right, the direction of acceleration is defined as second direction, is converted to downward one page switching command.Certainly, also the machine of swinging one's arm left can be converted to downward one page switching command, the machine of swinging one's arm is converted to the page up switching command to the right.Definition rule is looked the user and is accustomed to setting, and its principle is not described in detail as mentioned herein.
Owing to have only two kinds of switching modes, therefore, to the page up switching command, represent downward one page switching command with integer data 1 with 0 expression of integer data.Certainly, its expression mode can be various, and this paper is example with 0 and 1.
In this step, action is converted to behind page up or downward one page switching command (0 or 1), this switching command is sent to bluetooth module.
Step S5 will be encoded into blue-teeth data to page up switching command or downward one page switching command.
Receive to the page up switching command or downwards behind one page switching command (0 or 1) such as, bluetooth module, this switching command is encoded to the data layout of Bluetooth transmission, promptly be encoded to blue-teeth data.
Step S6 connects to lantern slide playing equipment transmission blue-teeth data by bluetooth.
Such as, be encoded into blue-teeth data to the page up switching command or downwards one page switching command connect the lantern slide playing equipment that sends to by bluetooth.
Step S7, lantern slide playing equipment receive the blue-teeth data of the switching lantern slide of self terminal.
Such as, lantern slide playing equipment refers generally to computer, after terminal is set up bluetooth and is connected, receive the blue-teeth data of self terminal, this blue-teeth data specially refers to be used to switch the instruction of lantern slide, promptly by the blue-teeth data of encoding and forming to page up switching command or downward one page switching command.Because only the blue-teeth data of this type is effective for purposes of the invention.
Step S8, the decoding blue-teeth data obtains to page up switching command or downward one page switching command.
Such as, will be by to page up switching command or the blue-teeth data decoding that forms of one page switching command coding downwards, be reduced into to page up switching command or one page switching command downwards, promptly be reduced into simple machine code (0 or 1).
Step S9 will become to page up to trigger keyboard key assignments or the keyboard of one page triggering downwards key assignments to page up switching command or downward one page switching command corresponding conversion.
Such as, will correspond to actual trigger slides to the page up switching command and trigger the keyboard key assignments to page up, downward one page switching command is corresponded to the downward one page of actual trigger slides trigger the keyboard key assignments.Switch to page up if expression is got rid of on a left side, converting switching command to is 0, and it is P that lantern slide triggers the keyboard key assignments to page up, in the real work, is about to 0 corresponding P, and the effect of triggering 0 is identical with the effect of triggering P.
Step S10 is according to trigger keyboard key assignments or the keyboard of one page triggering downwards key assignments switching lantern slide to page up.
Such as, trigger the keyboard key assignments that the control lantern slide switches, and after the application of lantern slide receives the keyboard key assignments, with actual keyboard be pressed the same, thereby the application of controlling lantern slide is switched.
At this, continuously to the left or to the right, can realize continuous page turning, switch lantern slide, identical to other direction whipping mobile phone principle, give unnecessary details no longer one by one herein.
The embodiment of the invention, the size and Orientation of the acceleration by inductive terminations, when acceleration magnitude reaches first threshold, according to the direction of acceleration with this action be converted into lantern slide to page up switching command or one page switching command downwards, and by this instruction of Bluetooth transmission, receive this instruction by lantern slide playing equipment at last, and by receiving end reception and this instruction of decoding, at last this instruction is corresponded to actual keyboard key assignments, realize that lantern slide to page up or the switching of one page downwards, can not increase hardware, save cost, and the raising convenience, strengthen user experience simultaneously.
Consult Fig. 2, Fig. 2 is that the present invention utilizes terminal to carry out the process flow diagram of method second embodiment of the wireless switching of lantern slide.Comprise the steps:
Step S11, set up with lantern slide playing equipment between bluetooth be connected.
Computer is set up blue teeth wireless with mobile phone and is connected.Before needs carried out lantern slide control, the bluetooth module of mobile phone was inquired about current blueteeth network, and initiated connection request.The bluetooth module of computer is waited for establishment of connection, and receives connection request, sets up bluetooth with the bluetooth module of mobile phone and is connected.
As required, the bluetooth module of mobile phone is inquired about and matching process, obtains the address of the bluetooth module of computer, and connection request is initiated in the address of the bluetooth module of the computer that obtains according to inquiry.Bluetooth connects after the foundation, just can carry out the transmitting-receiving of data.
Step S12 is setting up the size and Orientation that obtains the terminal acceleration after bluetooth connects.
Such as, embedded in mobile phone has action sensing module, and action sensing module is an acceleration transducer.This acceleration transducer obtains the acceleration of mobile phone in real time, and acceleration is a vector, promptly needs to obtain the size and Orientation of acceleration.
This acceleration transducer can be when the mobile phone acceleration changes, the size and Orientation of real-time report three-dimensional acceleration, draw the motion state of current phone again according to the size and Orientation data computation of acceleration, thereby catch user's action, i.e. left and right sides whipping mobile phone, whipping mobile phone or stir mobile phone etc. up and down.Certain hour is built in the mobile phone configuration file, also can be defined voluntarily by user's actual demand.
Step S13 judges whether the size of acceleration reaches first threshold.
Such as, by the variation of calculating the mobile phone acceleration in the certain hour draw mobile phone whether on certain direction by whipping.As, when mobile phone left during whipping, will be in direction left, the positive dirction that is X-axis obtains acceleration, (this first threshold values can be built in a fixed numeric values of mobile phone configuration file to reach first threshold values according to the size of the acceleration of the direction left of mobile phone in the certain hour, at this moment, the user can't change this numerical value; This first threshold also can be to be kept at the value that is provided with voluntarily by the user in the mobile phone file system), just can draw mobile phone by left whipping.
Step S14 if the size of acceleration reaches first threshold, converts switching command to according to the direction of acceleration, if the direction of acceleration is a first direction, convert to the page up switching command,, convert downward one page switching command to if the direction of acceleration is a second direction.
Such as, after action sensing module captures user action, and judge that this user action is effective, promptly the size of acceleration reaches first threshold, expresses the switching intention of user to lantern slide.
At this moment, need to convert this action to the lantern slide switching command, promptly to page up switching command or downward one page switching command.
General, the machine of swinging one's arm left, the direction of acceleration is defined as first direction, is converted to the page up switching command, the machine of swinging one's arm to the right, the direction of acceleration is defined as first direction, is converted to downward one page switching command.Certainly, can define also left that the machine of swinging one's arm is converted to downward one page switching command, the machine of swinging one's arm is converted to the page up switching command to the right.Definition rule is looked the user and is accustomed to setting, and its principle is not described in detail as mentioned herein.
Owing to have only two kinds of switching modes, therefore, to the page up switching command, represent downward one page switching command with integer data 1 with 0 expression of integer data.
In this step, action is converted to behind page up or downward one page switching command (0 or 1), this switching command is sent to bluetooth module.
Step S15 will be encoded into blue-teeth data to page up switching command or downward one page switching command.
Receive to the page up switching command or downwards behind one page switching command (0 or 1) such as, bluetooth module, this switching command is encoded to the data layout of Bluetooth transmission, promptly be encoded to blue-teeth data.
Step S16 connects to lantern slide playing equipment transmission blue-teeth data by bluetooth.
Such as, be encoded into blue-teeth data to the page up switching command or downwards one page switching command connect the lantern slide playing equipment that sends to by bluetooth.
The embodiment of the invention, the size and Orientation of the acceleration by responding to this terminal, when acceleration magnitude reaches first threshold, according to the direction of acceleration with this action be converted into lantern slide to page up switching command or one page switching command downwards, and, receive this instruction by lantern slide playing equipment at last by this instruction of Bluetooth transmission, can not increase hardware, save cost, and improve convenience.
Another preferred implementation of the embodiment of the invention, in step S11, mobile phone is as main equipment, and computer when Bluetooth of mobile phone and computer bluetooth are set up bluetooth, need carry out the password coupling as slave unit.When having only password the match is successful, just allow Bluetooth of mobile phone to be connected to the computer bluetooth.Can effectively filter non-designated user bluetooth connection request, can effectively stop equipment such as the own mobile phone of artificial utilization to hinder the operation of speaker lantern slide.
Consult Fig. 3, Fig. 3 is that the present invention utilizes terminal to carry out the process flow diagram of method the 3rd embodiment of the wireless switching of lantern slide.Be with the difference of second embodiment of the invention:
Before step S11, comprising: step S17 makes terminal enter the slide demonstration pattern.
In addition, after step S11, before the step S12, comprising: whether current step S18, detect bluetooth between and the lantern slide playing equipment and be connected available and whether enter the slide demonstration pattern.
Such as, available if terminal is connected with bluetooth between the lantern slide playing equipment, and lantern slide playing equipment enters the slide demonstration pattern, and promptly condition is all set up, and then obtains the step of the size and Orientation of terminal acceleration, promptly enters step S12; Otherwise do not obtain the step of the size and Orientation of mobile communication terminal acceleration, promptly do not enter step S12.Can saves energy, prolong the working time of terminal.
Meanwhile, between step S13 and step S14, also comprise:
Whether step S19 detects bluetooth and connects available.
Such as, if the bluetooth connection is available, then carry out converting to the step of switching command according to the direction of acceleration, promptly enter step S14; If it is unavailable that bluetooth connects, then do not carry out converting to the step of switching command according to the direction of acceleration, promptly do not enter step S14.Here, bluetooth connects available finger, Bluetooth of mobile phone and computer bluetooth connect, and signal intensity (this second threshold value is set as required greater than second threshold value, equally, being built in the fixed numbers in the mobile phone configuration file, also can be to be set in numerical value in the mobile phone file system by the user).Equally can saves energy, prolong the working time of terminal
In the present embodiment, after step S15, before the step S16, also comprise:
Step S20 adds the sign of indication to the wireless switching of lantern slide to blue-teeth data.
Because the blue-teeth data that connects transmission by bluetooth comprises various data and instruction, correctly tell the switching of the realization of the object of the invention to lantern slide, need tell to page up switching command and downward one page switching command.By to the page up switching command with downwards the head end of the blue-teeth data that forms of one page switching command coding or tail end or head end tail end add sign simultaneously, succinct, can identify as this with * ##*, certainly,, whether not can to the sign of page up switching command and downward one page switching command as long as can help to tell this blue-teeth data clear, easily only for therewith.
The embodiment of the invention, by increasing step S17 to S20, can saves energy by detecting whether available bluetooth connect and whether enter the slide demonstration pattern, prolong the working time of terminal, can know that by adding sign distinguishing blue-teeth data easily is to page up switching command or downward one page switching command, or other blue-teeth data.
Consult Fig. 4, Fig. 4 is that the present invention utilizes terminal to carry out the process flow diagram of method the 4th embodiment of the wireless switching of lantern slide.
Step S21, lantern slide playing equipment receive the blue-teeth data of the switching lantern slide of self terminal.
Such as, lantern slide playing equipment refers generally to computer, after terminal is set up bluetooth and is connected, receive the blue-teeth data of self terminal, this blue-teeth data specially refers to be used to switch the instruction of lantern slide, promptly by the blue-teeth data of encoding and forming to page up switching command or downward one page switching command.Because only the blue-teeth data of this type is effective for purposes of the invention.
Step S22, the decoding blue-teeth data obtains to page up switching command or downward one page switching command.
Such as, will be by to page up switching command or the blue-teeth data decoding that forms of one page switching command coding downwards, be reduced into to page up switching command or one page switching command downwards, promptly be reduced into simple machine code (0 or 1).
Step S23 will become to page up to trigger keyboard key assignments or the keyboard of one page triggering downwards key assignments to page up switching command or downward one page switching command corresponding conversion.
Such as, will correspond to actual trigger slides to the page up switching command and trigger the keyboard key assignments to page up, downward one page switching command is corresponded to the downward one page of actual trigger slides trigger the keyboard key assignments.Switch to page up if expression is got rid of on a left side, converting switching command to is 0, and lantern slide is P to the keyboard key assignments that page up switches, and in the real work, is about to 0 corresponding P, and the effect of triggering 0 is identical with the effect of triggering P.
Step S24 is according to trigger keyboard key assignments or the keyboard of one page triggering downwards key assignments switching lantern slide to page up.
Such as, trigger the keyboard key assignments that the control lantern slide switches, and after the application of lantern slide receives the keyboard value, with actual keyboard be pressed the same, thereby the application of controlling lantern slide is switched.
The embodiment of the invention, blue-teeth data by the receiving terminal transmission, and resolve this blue-teeth data acquisition to page up switching command or downward one page switching command, and it is corresponded to the keyboard key assignments of lantern slide playing equipment correspondence, can realize page turning at last to lantern slide, need not button, can strengthen user experience.
Consult Fig. 5, Fig. 5 is that the present invention utilizes terminal to carry out the process flow diagram of method the 5th embodiment of the wireless switching of lantern slide.Between step S21 and step S22, also comprise:
Step S25 judges whether blue-teeth data comprises the sign of indication to the wireless switching of lantern slide.
If comprise the sign of indication to the wireless switching of lantern slide, remove this sign after, carry out blue-teeth data is decoded into to the page up switching command or the downward step of one page switching command, promptly carry out step S22; Otherwise do not carry out blue-teeth data is decoded into to the page up switching command or the downward step of one page switching command, promptly do not carry out step S22.By judging whether this blue-teeth data is the realization lantern slide page-turning function of the object of the invention, can further save the terminal electricity consumption, prolong the terminal works time.
Consult Fig. 6, Fig. 6 is the structured flowchart of mobile communication terminal first embodiment of the present invention.Present embodiment comprises: first bluetooth module 1, action sensing module 2, judge module 3, first modular converter 4 and coding module 5.
First bluetooth module 1, be used to set up with lantern slide playing equipment between bluetooth be connected;
Action sensing module 2 connects first bluetooth module 1, is used for the size and Orientation that obtains the terminal acceleration after bluetooth connects setting up;
Judge module 3, connecting moves induction module 2 is used to judge whether the size of acceleration reaches first threshold;
First modular converter 4, connection judgment module 3, be used for if the size of acceleration reaches first threshold, direction according to acceleration converts switching command to, if the direction of acceleration is a first direction, convert to the page up switching command,, convert downward one page switching command to if the direction of acceleration is a second direction;
Coding module 5 connects first modular converter 4, is used for being encoded into blue-teeth data to page up switching command or downward one page switching command;
First bluetooth module 1 also connects coding module 5, is used for connecting to lantern slide playing equipment transmission blue-teeth data by bluetooth.
The embodiment of the invention increases by first bluetooth module 1, action sensing module 2, judge module 3, first modular converter 4 and coding module 5.Respond to the size and Orientation of the acceleration of these terminals by action sensing module 2, judge module 3 judges that working as acceleration magnitude reaches first threshold, first modular converter 4 according to the direction of acceleration with this action be converted into lantern slide to page up switching command or one page switching command downwards, coding module 5 is converted into blue-teeth data, and by 1 this instruction of transmission of first bluetooth module, realize that lantern slide is to page up or the switching of one page downwards, can not increase hardware, save cost, and improve convenience.
Consult Fig. 7, Fig. 7 is the structured flowchart of mobile communication terminal second embodiment of the present invention.This enforcement is with the difference of mobile communication terminal second embodiment, comprises: the first detection module 6 and second detection module 7.
First detection module 6, be connected between first bluetooth module 1 and the action sensing module 2, be used to detect bluetooth between whether current and the lantern slide playing equipment and be connected available and whether enter the slide demonstration pattern, if are steps of then obtaining the size and Orientation of terminal acceleration all; Otherwise do not obtain the step of the size and Orientation of terminal acceleration.
Second detection module 7, be connected between the judge module 3 and first modular converter 4, whether available, if then carry out converting to according to the direction of acceleration the step of switching command, otherwise do not carry out converting to according to the direction of acceleration the step of switching command if being used to detect the bluetooth connection.
The embodiment of the invention increases the first detection module 6 and second detection module 7, by detecting bluetooth connection status and slide demonstration mode state, can save the terminal electricity consumption, lengthens working hours.
Consult Fig. 8, Fig. 8 is the circuit diagram of mobile communication terminal second embodiment of the present invention.Terminal comprises first bluetooth module 1, action sensing module 2 and baseband chip 8.
First bluetooth module 1 comprises Bluetooth chip 11 and Bluetooth antenna 12, and this Bluetooth chip 11 comprises the 4th power interface 111, the first signal transmission interface 112, the first signal receiving interface 113 and antennal interface 114.
Action sensing module 2 comprises the first sequential interface 21, first data-interface 22, first interrupt interface 23 and first power interface 24.
Baseband chip 8 comprises the second sequential interface 81, second data-interface 82, second interrupt interface 83, secondary signal transmission interface 84, secondary signal receiving interface 85.Baseband chip 8 also comprises power management module 86, and power management module 86 comprises second source interface 861 and the 3rd power interface 862.
The first sequential interface 21 connects the second sequential interface, 81, the first data-interfaces 22 and connects second data-interface, 82, the first interrupt interfaces, 23 connections, second interrupt interface, 83, the first power interfaces, 24 connection second source interfaces 861.
The 4th power interface 862 connects the 3rd power interface 111, the first signal transmission interfaces 84 and connects secondary signal transmission interface 112, the first signal receiving interfaces 85 connection secondary signal receiving interfaces 113, and antennal interface 114 connects Bluetooth antennas 12.
The principle of work of the embodiment of the invention is:
Action sensing module 2 is connected with baseband chip 8 by serial data interface (I2C), and baseband chip 8 reads the direction and the size data of the acceleration that action sensing module 2 catches by serial data interface, and action sensing module 2 is carried out data initialization.Simultaneously, baseband chip 8 has an interrupt pin (INT) to link to each other with action sensing module 2, and this interrupt pin is used for when having data to produce on the action sensing module 2, by interrupt notification baseband chip 8.Power management module 86 in the baseband chip 8 is responsible for powering to action sensing module 2.First bluetooth module 1 is connected with baseband chip 8 by parallel data grabbing card (UART), baseband chip 8 carries out communication by the parallel data grabbing card and first bluetooth module 1, comprise the blue-teeth data that obtains on first bluetooth module 1, and action sensing module 2 is controlled etc.Power management module in the baseband chip 8 is responsible for to action sensing module 2 power supplies.Action sensing module 2 is connected with antenna 12 through baseband chip 8, receives and the transmission blue-teeth data by antenna 12.
In the foregoing description, action sensing module 2 is acceleration transducers.
Consult Fig. 9, Fig. 9 is the structured flowchart of lantern slide playing equipment first embodiment of the present invention.This mobile communication terminal comprises: second bluetooth module 100, decoder module 200, second modular converter 300 and handover module 400.
Second bluetooth module 100, be used to set up with terminal between bluetooth be connected, and be used for connecting the blue-teeth data that the back receives the switching lantern slide of self terminal setting up bluetooth;
Decoder module 200 connects second bluetooth module 100, is used to the blue-teeth data of decoding, and obtains to page up switching command or downward one page switching command;
Second modular converter 300 connects decoder module 200, is used for becoming to page up triggering keyboard key assignments or downward one page to trigger the keyboard key assignments to page up switching command or downward one page switching command corresponding conversion; And
Handover module 400 connects second modular converter 300, is used for according to trigger keyboard key assignments or the keyboard of one page triggering downwards key assignments switching lantern slide to page up.
The embodiment of the invention, increase by second bluetooth module 100, decoder module 200, second modular converter 300 and handover module 400, blue-teeth data by the transmission of second bluetooth module, 100 receiving terminals, decoder module 200 is resolved this blue-teeth data and is obtained to page up switching command or downward one page switching command, by second modular converter 300 it is corresponded to the keyboard key assignments of lantern slide playing equipment correspondence, the switching (page turning) that last handover module 400 is realized lantern slide, need not button, can strengthen user experience.
The above only is embodiments of the invention; be not so limit claim of the present invention; every equivalent structure or equivalent flow process conversion that utilizes instructions of the present invention and accompanying drawing content to be done; or directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.