The alarming method for power of bluetooth equipment in abnormal association
Technical field
The relevant a kind of communication technology of the present invention, particularly a kind of alarming method for power that adopts the bluetooth equipment in abnormal association of Bluetooth technology, it is for a kind of alarming method for power of the bluetooth equipment in abnormal association of setting, be to check link quality numerical value with host controller interface instruction cycle property ground with the central processing unit in the blue-tooth device, but and with set point relatively, and can learn whether communication conditions anomaly occurs.
Background technology
Bluetooth technology starts from the beginning of 1998, and the Bluetooth technology standard of being promoted by Bluetooth Special Interest Group (Billetooth specialInterest Group) at present is a kind of lower powered wireless communication technology standard.
The desirable cable that substitutes numerous portable equipments such as linking PC, printer, palmtop computer and mobile phone of its development prospect with the space simplicity with these equipment utilizations, and can reduce numerous and diverse line process.
General blue-tooth device there is no the technical measures of reminding the user contact occurring when unusual, until contact is when interrupting, the user just realize write to each other occur unusual.At this moment, the user must spend the plenty of time and energy has rebulid interrupted contact, if unusual the generation frequently, with the waste that causes on time and the expense.If can learn early that contact can produce unusually, the user just can take measures as quickly as possible.
Summary of the invention
Main purpose of the present invention is to provide a kind of alarming method for power that can in time detect the bluetooth equipment in abnormal association of anomaly, so that after setting up contact between the Bluetooth communication device, the central processing unit of each blue-tooth device is checked link quality numerical value with host controller interface (Host Controller Interface) the instruction cycle property ground of Bluetooth technology standard.
Of the present invention time a purpose is to provide a kind of alarming method for power that can in time send the bluetooth equipment in abnormal association of alarm signal, when the quality numerical value of being checked out is lower than comparison value, the central processing unit of blue-tooth device promptly sends alarm signal (as vibration, the tinkle of bells or screen display) by the caution element, to remind the user.
Another purpose of the present invention is to provide a kind of alarming method for power of the bluetooth equipment in abnormal association that can return to normal automatically, and when quality numerical value returns to when being higher than comparison value, the central processing unit of system promptly stops to send the caution instruction, makes the system restoration normality.
Another purpose of the present invention is to provide the alarming method for power of a kind of suitable different users's bluetooth equipment in abnormal association, allow the user between two blue-tooth devices of having set up contact, to adjust distance, and be worth as a comparison with the mean value of the several quality numerical value that instantaneous distance was read, with the unusual caution demand of the contact of satisfying the different users, make the different users can have the contact of different distance to warn setting unusually.
For achieving the above object, the present invention takes following technical measures:
The alarming method for power of bluetooth equipment in abnormal association of the present invention, after the blue-tooth device start is set up line with another bluetooth cellular phone, carry out following steps:
A. will warn flag and be set at 0;
B. start and check link quality timer;
C. wait state;
Wherein, after described step c, blue-tooth device also carries out following steps after receiving link quality numerical value:
D1. check whether this quality numerical value is lower than a comparison value;
Wherein, in described steps d 1,, then carry out following steps if quality numerical value is lower than described comparison value:
E1. send information warning;
N. will warn flag and be set at 1;
G1. wait state;
Wherein, described comparison value can dynamically be adjusted according to the distance between described blue-tooth device and the bluetooth cellular phone.Concrete set-up procedure is:
After described step c, carry out following steps:
D. the user adjusts two distances between device;
E. read and for several times link quality numerical value, with one mean value as this comparison value;
F. check whether this comparison value is higher than a preset value;
If described comparison value is not higher than preset value, then carry out following steps:
G. upgrade comparison value;
H. wait state;
If described comparison value is higher than preset value, then carry out following steps:
G '. be worth as a comparison with preset value;
H '. wait state.
Wherein, in described step e1, described information warning is at least one of in involving vibrations, the tinkle of bells or the screen display.
Wherein, in described steps d 1,, then carry out following steps if quality numerical value is greater than or equal to described comparison value:
E1 '. check whether the caution flag is 1.
Wherein, in described step e1 ',, then carry out following steps if alarm flag is designated as 1:
F1 '. will warn flag and be made as 0;
G1 '. stop caution;
H1 ' y. wait state.
Wherein, in described step e1 ',, then directly carry out step h1 ': wait state if the caution flag is not 1.
Wherein, at described step h1 ' afterwards, arrive, then carry out following step if check link quality timer time:
D2. the timer of resetting;
E2. send and check the instruction of link quality;
F2. wait state.
Wherein, after described step c,, then carry out following step if two blue-tooth device contacts are interrupted:
D3. stop timer;
E3. seek again to get in touch with another blue-tooth device foundation.
Compared with prior art, the present invention has following effect:
Method of the present invention can periodically be checked link quality numerical value, when the bluetooth equipment in abnormal association phenomenon occurs, can send alarm signal and remind the user, can reduce the probability that contact is interrupted between blue-tooth device.
Description of drawings
Fig. 1: two blue-tooth devices are set up the flow chart that link quality numerical value is checked in the contact back;
Fig. 2: the control flow chart of the alarming method for power of bluetooth equipment in abnormal association of the present invention;
Fig. 3: the circuit block diagram of the blue-tooth device among the present invention and contact schematic diagram therebetween.
Embodiment
Reaching embodiment in conjunction with the accompanying drawings is described in detail as follows architectural feature of the present invention:
As shown in Figure 1, it is that two blue-tooth devices are set up the flow chart that link quality numerical value is checked in the contact back; By among the figure as can be known, when two blue-tooth devices will be set up contact, one of them blue-tooth device can send an inquiry command by Bluetooth chip by central processing unit, and (step 11) is to the Bluetooth chip of another blue-tooth device, the central processing unit of another blue-tooth device promptly carries out demand scan (step 12), after the blue-tooth device that sends inquiry is received by the answer of another blue-tooth device inquiry, Bluetooth chip can be sent a signal of receiving answer back to central processing unit (step 13), this central processing unit promptly sends one and sets up instructing to Bluetooth chip (step 14) of getting in touch, Bluetooth chip will be set up the information notification central processing unit (step 15) of contact after receiving instruction.
Two blue-tooth devices are after setting up contact, send host controller interface the CPU cycle of either party's blue-tooth device and instruct to Bluetooth chip inspection link (Link) quality numerical value (step 16), Bluetooth chip is promptly repaid central processing unit link quality numerical value (step 17) after receiving instruction.Periodically repeating step 16 and 17 just can be learnt quality numerical value at any time.Above-mentioned host controller interface is meant between blue-tooth device controller and the Bluetooth chip interface circuit in order to Data transmission or instruction, the host controller interface instruction then is the instruction of blue-tooth device controller in order to the control Bluetooth chip, and these are the personage who has the knack of this technology and know, so seldom give unnecessary details at this.
As shown in Figure 2, it is the control flow chart of the alarming method for power of bluetooth equipment in abnormal association of the present invention, wherein, in blue-tooth device (as mobile phone) start back (step 20), wait for another blue-tooth device foundation and get in touch (step 21), check and whether get in touch (step 22), get in touch if also set up with another blue-tooth device foundation, then get back to step 21, proceed to get in touch the affirmation of foundation; If affirmation has been set up with another blue-tooth device and got in touch, then will warn flag and be set at 0 (this situation is set up for contact, and the anomaly generation is not arranged) (step 23), at this moment, can start and check link quality timer (step 24), afterwards, enter wait state (step 25).
In above-mentioned wait (step 25) afterwards, can have following four kinds of situations to produce:
First kind of situation received link quality numerical value (step 26), and at this moment, central processing unit can judge whether to be lower than comparison value (step 29).If quality numerical value is not lower than comparison value (i.e. expression does not have anomaly to produce or got rid of unusually), promptly confirm that whether the caution flag is 1 (that is whether alarm signal is still sending among the process) (step 291) this moment again, if not, be that indication device is not among the caution process, then directly enter wait state (step 294); If alarm flag is designated as 1 (promptly before had anomaly to produce, and got rid of at present), will warn then that flag establishes back is 0 (step 292), stops to warn (step 293) afterwards, directly enters wait state (step 294).In above-mentioned steps 29, be lower than comparison value if judge link quality numerical value, the contact anomaly will produce, so alarming device promptly sends alarm signal (step 295), and will warn flag and be set at 1 (step 296), and enter wait state (step 297).
Second kind of situation promptly is to check link quality timer time to (step 27), and necessary replacement timer (step 271) was sent and checked link quality instruction (step 272) this moment, afterwards, entered wait state (step 273).The function of link quality numerical value is checked on these step property performance period ground.
The third situation, the setting of relevant comparison value.At first, the user adjusts the distance (step 251) of two blue-tooth devices, wherein, this distance can be adjusted to the maximum distance of wishing caution, then, read for several times link quality numerical value mean value as comparison value (step 252), then, whether the comparison value of step gained is higher than preset value (step 253) above judging, this preset value can be the maximum that can preset.If be higher than preset value, then be comparison value (step 256) with the preset value, afterwards, enter wait state (step 255); If this comparison value is not higher than preset value, then the comparison value that will before store is updated to the comparison value (step 254) of above-mentioned gained, afterwards, enters wait state (step 255), and finishes the setting of whole comparison value.
Last a kind of situation when blue-tooth device will be interrupted contact (step 28), stops (step 281) with timer, seeks to set up in the waiting step of getting in touch (step 282) with another blue-tooth device and enter.
As shown in Figure 3, it is circuit block diagram of the blue-tooth device among the present invention and contact schematic diagram therebetween, by among the figure as can be known, general blue-tooth device 30 comprises Bluetooth chip 31, memory 32 and central processing unit 33, wherein, Bluetooth chip 31 and memory 32 are connected with central processing unit 33 respectively; Bluetooth chip 31 comprises radio frequency unit 311 and fundamental frequency unit 312, and an external antenna 35.When two blue-tooth devices will be set up contact, by the line of 35 on central processing unit 33, Bluetooth chip 31 and antenna, set up contact to send and to receive instruction, this is known by the personage who has the knack of this technology, so seldom give unnecessary details at this.
The present invention has also set up the alarming device of forming as jingle bell 341 and vibrating motor 342 etc. 34, utilizes said method, can start alarming device, and the alarm signal of bluetooth equipment in abnormal association is provided.
Foregoing is to utilize embodiment that technical characterictic of the present invention is described, is not to be used to limit protection scope of the present invention, even there is the people to change slightly on the basis of the present invention's design, must belong in protection scope of the present invention.