CN105898682A - Method and system for Bluetooth communication - Google Patents
Method and system for Bluetooth communication Download PDFInfo
- Publication number
- CN105898682A CN105898682A CN201610221189.6A CN201610221189A CN105898682A CN 105898682 A CN105898682 A CN 105898682A CN 201610221189 A CN201610221189 A CN 201610221189A CN 105898682 A CN105898682 A CN 105898682A
- Authority
- CN
- China
- Prior art keywords
- state
- bluetooth
- scan
- flag bit
- scanning
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
- H04W8/005—Discovery of network devices, e.g. terminals
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a method and a system for Bluetooth communication. The Bluetooth communication method comprises steps: flag bits are set, wherein the flag bits comprise a scanning start flag bit, a scanning ongoing flag bit and a scanning completion flag bit; the flag bits are initialized; when the scanning start flag bit is in a first state, low-power consumption scanning is executed, and the scanning start flag bit and the scanning ongoing flag bit are set to be in a second state; when low-power consumption scanning is completed, the scanning completion flag bit is set to be in the second state; when the scanning start flag bit and the scanning completion flag bit are in the second state, typical Bluetooth scanning is executed, and the scanning ongoing flag bit is set to be in the first state; and when the typical Bluetooth scanning is completed, the scanning completion flag bit is set to be in the first state. Different Bluetooth scanning is realized through using different time periods and setting different monitoring time in a process, the structure is clear, the system is easy to maintain, and Bluetooth connection reliability is also ensured.
Description
Technical field
The present invention relates to communication technical field, particularly relate to a kind of Bluetooth communication method and system.
Background technology
Bluetooth is a kind of wireless technology standard, can realize fixing equipment, mobile device and building personal area network
Between short-range data exchange (using the UHF radio wave of the ISM band of 2.4 2.485GHz).
Bluetooth technology initially by telecommunications giant Ericsson in initiative in 1994, be as RS232 data at that time
The replacement scheme of line.Bluetooth can connect multiple equipment, overcomes a difficult problem for data syn-chronization.Nowadays bluetooth by
Bluetooth sig (Bluetooth Special Interest Group is called for short SIG) management.Bluetooth technology joins
Alliance has more than 25 in the whole world, 000 member company, they be distributed in telecommunications, computer, network and
The multiple field such as consumer electronics.Bluetooth technology is classified as IEEE802.15.1 by IEEE, but the most no longer ties up
Hold this standard.Bluetooth sig is responsible for supervising the exploitation of Bluetooth specification, administrative authentication project, and safeguards
Trademark right.The equipment of manufacturer has to comply with the standard of bluetooth sig could be with the name of " bluetooth equipment "
Justice comes into the market.Bluetooth technology has a set of patent network, can be issued to standard compliant equipment.
The wave band of bluetooth is 2400 2483.5MHz (including guard band).This is that global range is interior without taking
Obtain the industry of license (but being not without control), science and the 2.4GHz short distance of medical (ISM) wave band
From radio frequency band.Bluetooth master at most can be with an a piconet (interim meter using Bluetooth technology
Calculation machine network) in seven device talks, certain not all equipment can reach this maximum.
Protocol conversion role can be passed through between equipment, also can be exchanged into main equipment (such as a, wear-type from equipment
If earphone initiates connection request to mobile phone, it, as the promoter connected, is exactly main equipment naturally, but
It is the most perhaps to run as from equipment.)
Bluetooth core specification provides two or more piconets to connect to form distributed network, allows specific
Equipment automatically play the part of the most respectively in these piconets advocate peace from role.Data transmission can be at any time
(except applying few broadcast mode) is carried out between main equipment and other equipment.Main equipment is optional to be wanted
Access from equipment;Typically, it can be by between devices with rapid translating in the way of rotating.
Because it is to be accessed from equipment to be that main equipment selects, will await orders in receiving slit from equipment in theory,
The burden of main equipment is fewer than from equipment.Main equipment can be connected from equipment with seven, but from
Equipment is but difficult to be connected with more than one main equipment.Specification requires it is fuzzy for the behavior in scatternet
's.
To 2013, Bluetooth chip was applied and is mainly had five versions:
1.1/1.2/2.0/2.1/3.0/4.0, the Bluetooth chip the most often having has tri-kinds of versions of 2.1/3.0/4.0.City at present
Occur in that many healthy equipment on Chang, such as: clinical thermometer and blood glucose meter etc. in health, these equipment have classics,
Low-power consumption two types.In order to meet the demand in market, intelligent router needs to realize accessing various bluetooths
The function of equipment, receives the data of health medical treatment bluetooth equipment and is pushed to high in the clouds.Owing to bluetooth equipment has
Classical bluetooth and low-power consumption bluetooth two kinds, be currently based on the platform of Linux system for can quickly scan bluetooth
Equipment, have employed 2 scan procedure and processes classical bluetooth and low-power consumption bluetooth respectively, scan, even
Connect.So causing process structure unintelligible, resource consumption adds up, and system is not easy to safeguard.
Summary of the invention
The technical problem to be solved is platform based on Linux system, have employed 2 and is scanned into
Classical bluetooth and low-power consumption bluetooth are processed by journey respectively, scan, connect, cause process structure unclear
Clear, resource consumption adds up, the problem that system is not easy to safeguard.
In order to solve the problems referred to above, the invention provides a kind of Bluetooth communication method, be applied to based on linux
The electronic equipment of system and standard bluetooth equipment and the process setting up Bluetooth communication of low-power consumption bluetooth equipment
In, including:
Arranging flag bit, described flag bit includes scanning opening flag position, being scanned into line flag position and scanning
End mark position, and initialize described flag bit;
When described scanning opening flag position is the first state, perform low power scan, and by described scanning
Opening flag position and the described line flag position that is scanned into are set to the second state;
At the end of described low power scan, described end of scan flag bit is set to the second state;
When described scanning opening flag position and described end of scan flag bit are the second state, perform classics
Bluetooth scans, and the described line flag position that is scanned into is set to the first state;
When the described classical bluetooth end of scan, described end of scan flag bit is set to the first state.
Optionally, also include:
Judgement symbol position is set;
Judging whether Current Scan terminates, if terminating, described judgement symbol position being set to the second state;
Be scanned into line flag position and the state of described judgement symbol position described in judgement, if described in be scanned into rower
Will position and described judgement symbol position are the second state, carry out low-power consumption bluetooth connection;
If described low-power consumption bluetooth successful connection, arranging described complement mark position is the second state;
If described low-power consumption bluetooth connection failure, then perform described in described judgement, to be scanned into line flag position and institute
State the step of the state of judgement symbol position.
Optionally, also include: if described low-power consumption bluetooth connection failure, the described scanning of described judgement is carried out
After the step of the state of flag bit and described judgement symbol position performs n time, arranging described complement mark position is the
Two-state, wherein n is the integer more than 0 and less than 10.
Optionally, also include:
Judgement symbol position is set;
Judging whether Current Scan terminates, if terminating, described judgement symbol position being set to the second state;
Be scanned into line flag position and the state of described judgement symbol position described in judgement, if described in be scanned into rower
Will position is the first state, and described judgement symbol position is the second state, carries out classical bluetooth and connects.
Optionally, when the described flag bit of described initialization, also include: be respectively provided with described low-power consumption and sweep
Retouch listening period and described classical bluetooth scanning listening period.
Present invention also offers a kind of Bluetooth communication system, be applied to electronic equipment based on Linux system
In, including:
Flag bit arranges module, is suitable to arrange flag bit, described flag bit include scan opening flag position,
It is scanned into line flag position and end of scan flag bit, and initializes described flag bit;
Scan module;
When described scanning opening flag position is the first state, described scan module is adapted for carrying out low-power consumption and sweeps
Retouching, described flag bit arranges module and is suitable to described scanning opening flag position and described is scanned into line flag position
It is set to the second state;
At the end of described low power scan, described flag bit arranges module and is suitable to described end of scan mark
Will position is set to the second state;
When described scanning opening flag position and the described end of scan are the second state, described scan module is fitted
In performing classical bluetooth scanning, described flag bit arranges module and is suitable to arrange the described line flag position that is scanned into
It it is the first state;
When the described classical bluetooth end of scan, described flag bit arranges module and is suitable to the described end of scan
Flag bit is set to the first state.
Optionally, also include:
Low-power consumption bluetooth link block;
Flag bit arranges module, is further adapted for arranging judgement symbol position;
Judge module, is suitable to judge whether Current Scan terminates and be scanned into line flag position and institute described in judging
State the state of judgement symbol position;
If Current Scan terminates, described flag bit arranges module and is suitable to described judgement symbol position is set to
Two-state;
Being scanned into line flag position and described judgement symbol position described in if is the second state, described low-power consumption bluetooth
Link block is adapted for low-power consumption bluetooth and connects;
If described low-power consumption bluetooth link block successful connection, described flag bit arranges module and is suitable to arrange institute
Stating complement mark position is the second state;
If described low-power consumption bluetooth link block connection failure, described judge module is adapted for carrying out described judgement
The described state being scanned into line flag position and described judgement symbol position.
Optionally, described Bluetooth communication system also includes: described judge module, is suitable in described low-power consumption
Bluetooth connection failure, it is judged that be scanned into line flag position and the state of described judgement symbol position described in n time;If institute
Stating low-power consumption bluetooth to connect or failure, described flag bit arranges module, is suitable to arrange described complement mark
Position is the second state;Wherein n is the integer more than 0 and less than 10.
Optionally, also include:
Classical bluetooth link block;
Flag bit arranges module, is further adapted for arranging judgement symbol position;
Judge module, is suitable to judge whether Current Scan terminates and be scanned into line flag position and institute described in judging
State the state of judgement symbol position;
If Current Scan terminates, described flag bit arranges module and is suitable to described judgement symbol position is set to
Two-state;
If being scanned into line flag position described in is the first state, and described judgement symbol position is the second state, described
Classical bluetooth link block is adapted for classical bluetooth and connects.
Optionally, also include: scanning listening period arranges module;During the described flag bit of described initialization,
Described scanning listening period arranges module and is suitable to be respectively provided with described low power scan listening period and described warp
Allusion quotation bluetooth scanning listening period.
Compared with prior art, technical scheme has the advantage that
The present invention uses different time sections process, arranges different listening periods and realize reliably
Bluetooth scans.Due to scanning, call is Same Function, therefore triggers different bluetooth-type by flag bit
Scanning.Such mode, can realize structuring clear, and system is easily maintained, bluetooth connection reliability
Also it is guaranteed.
Accompanying drawing explanation
Fig. 1 is the schematic diagram of bluetooth scanning process in the Bluetooth communication method provided in embodiments of the invention.
Fig. 2 is the schematic diagram of Bluetooth connection process in the Bluetooth communication method provided in embodiments of the invention.
Detailed description of the invention
Elaborate a lot of detail in the following description so that fully understanding the present invention.But this
Bright can implement to be much different from alternate manner described here, those skilled in the art can be not
Doing similar popularization in the case of running counter to intension of the present invention, therefore the present invention is not embodied as by following public
Restriction.
Secondly, the present invention utilizes schematic diagram to be described in detail, when describing the embodiment of the present invention in detail, for ease of
Illustrating, described schematic diagram is example, and it should not limit the scope of protection of the invention at this.
Owing to bluetooth equipment has classical bluetooth, low-power consumption bluetooth two types.Based on linux system, at present
Occur in that 2 scan procedure carry out classical bluetooth scanning respectively and low-power consumption bluetooth scans.Such process
Mode, resource consumption maintainability bigger, bad.
With specific embodiment, technical scheme is described further below in conjunction with the accompanying drawings.
In order to solve the technical problem in background technology, the invention provides a kind of Bluetooth communication method, should
Blue with the foundation of standard bluetooth equipment and low-power consumption bluetooth equipment for electronic equipment based on Linux system
During tooth communication, described Bluetooth communication method includes:
Arranging flag bit, described flag bit includes scanning opening flag position disc_start, being scanned into line flag
Position ble_scan and end of scan flag bit edr_scan, and initialize described flag bit;
Wherein, the first state arranging described opening flag position disc_start is 0, represents and will proceed by
Low-power consumption bluetooth scans, and the second state is 1, represents and will carry out classical bluetooth scanning;
Described the first state being scanned into line flag position ble_scan is 0, and represent current execution is classical blue
Tooth scans, and the second state is 1, and represent current execution is low power scan;
First state of described end of scan flag bit edr_scan is 0, represents that classical bluetooth connection has processed
Become, the current satisfied condition carrying out low power scan;Second state is 1, represents that low-power consumption connection has processed
Become, the current satisfied condition carrying out classical bluetooth scanning.
The original state of described flag bit is, scanning opening flag position disc_start is the first state, is
0, being scanned into line flag position ble_scan is the first state, is 0 and end of scan flag bit edr_scan
It is the first state, is 0.
When scanning at first, when described scanning opening flag position disc_start is the first state 0, open
Begin to perform low power scan, and by described scanning opening flag position disc_start with described be scanned into line flag
Position ble_scan is set to the second state 1;
At the end of described low power scan, described end of scan flag bit edr_scan is set to second
State 1;
When described scanning opening flag position disc_start and described end of scan flag bit edr_scan is second
During state 1, perform the scanning of classical bluetooth, and the described line flag position ble_scan that is scanned into is set to the
One state 0;
When the described classical bluetooth end of scan, described end of scan flag bit edr_scan is set to the
One state 0.
Further, described Bluetooth communication method also includes:
Judgement symbol position scan_cmpl is set;
First state of described judgement symbol position scan_cmpl is 0, represents that Current Scan does not also terminate, institute
The second state stating judgement symbol position scan_cmpl is 1, represents that Current Scan is over.
Judging whether Current Scan terminates, if terminating, described judgement symbol position scan_cmpl being set to the
Two-state 1;
Line flag position ble_scan and the state of described judgement symbol position scan_cmpl it is scanned into described in judgement,
Being scanned into line flag position ble_scan and described judgement symbol position scan_cmpl described in if is the second state 1,
Carry out low-power consumption bluetooth connection;
If described low-power consumption bluetooth successful connection, arranging described complement mark position is the second state 1;
If described low-power consumption bluetooth connection failure, then perform to be scanned into described in described judgement line flag position
The step of the state of ble_scan and described judgement symbol position scan_cmpl.
Described Bluetooth communication method also includes: if described low-power consumption bluetooth connection failure, described in described judgement
The step of the state being scanned into line flag position ble_scan and described judgement symbol position scan_cmpl performs n time
After, arranging described complement mark position is the second state 1, and wherein n is the integer more than 0 and less than 10.
Described Bluetooth communication method also includes:
Judgement symbol position scan_cmpl is set;
Judging whether Current Scan terminates, if terminating, described judgement symbol position scan_cmpl being set to the
Two-state;
Line flag position ble_scan and the state of described judgement symbol position scan_cmpl it is scanned into described in judgement,
If being scanned into line flag position ble_scan described in is the first state 0, and described judgement symbol position scan_cmpl is
Second state 1, carries out classical bluetooth and connects.
Also include when the described flag bit of described initialization: be respectively provided with described low power scan listening period
With described classical bluetooth scanning listening period.Open at described low power scan or described classical bluetooth scanning
The when of beginning, clock, meet described low power scan when the sweep time of described low power scan
Listening period, or meet described classical bluetooth scanning monitoring the sweep time of described classical bluetooth scanning
During the time, it can be determined that described low power scan or the described classical bluetooth end of scan.
As fully visible, present solution provides a kind of new Bluetooth communication method, use difference a process
Time period, arrange different listening periods to realize reliable bluetooth scanning.Due to scanning call be with
One function, therefore the scanning of different bluetooth-type is triggered by flag bit.Such mode, can realize knot
Structureization is clear, and system is easily maintained, and bluetooth connection reliability is also guaranteed.
Introduced below one is embodied as the application executing example to introduce the Bluetooth communication method that the present invention provides.Its
In, Fig. 1 is the schematic diagram of bluetooth scanning process in the Bluetooth communication method provided in embodiments of the invention.
Fig. 2 is the schematic diagram of Bluetooth connection process in the Bluetooth communication method provided in embodiments of the invention.With
Lower combination Fig. 1, Fig. 2 are illustrated:
For the most bluetooth health medical treatment equipment occurred on market, for guaranteeing reliably to access, to this end, this
Scheme provides a kind of new bluetooth sweeping scheme, and this scheme uses different time sections a process, sets
Put different listening periods to realize the scanning of reliable bluetooth.Due to scanning, call is Same Function, therefore
The scanning of different bluetooth-type is triggered by flag bit.
1) judge that bluetooth scans executive mode
A. initialization flag position, is respectively provided with low-power consumption, classical bluetooth scanning listening period.
B. it is 0 first according to flag bit disc_start (0 represent proceed by low-power consumption bluetooth scanning) initial value
Execution low power scan, juxtaposition disc_start (1 represents that next round will carry out classical bluetooth scanning),
Ble_scan (the 1 current execution of expression is low power scan) is 1, in order to next round classics bluetooth scanner uni is low
Power consumption bluetooth connects prepares.
C. according to flag bit disc_start, edr_scan (this flag bit is that 1 expression low-power consumption connection has processed,
Current meet the condition carrying out classical bluetooth scanning) it is 1 to perform classical bluetooth scanning, juxtaposition disc_start,
Ble_scan is 0, in order to next round low-power consumption bluetooth scanner uni classics bluetooth connects prepares.If being unsatisfactory for,
Then continue the scanning of next round bluetooth to judge.
2) low-power consumption bluetooth scanning, connection
A. judge whether the current scanning performed completes, if having scanned, juxtaposition flag bit scan_cmpl (1
Represent that a wheel scan completes) it is 1.
If b. current execution scanning completes, then carry out low-power consumption bluetooth attended operation.Connection process is by basis
Flag bit ble_scan, scan_cmpl be 1 to judge whether to low-power consumption bluetooth connect.
If c. low-power consumption bluetooth successful connection, putting flag bit edr_scan is 1, in order to classical bluetooth scanning.
If d. low-power consumption bluetooth connects unsuccessful, then, after circulating 5 times, also putting flag bit edr_scan is
1, in order to classical bluetooth scanning.
3) classical bluetooth scanning, connection
A. judge whether the current scanning performed completes, if having scanned, juxtaposition flag bit scan_cmpl
It is 1.
If b. current execution scanning completes, then carry out classical bluetooth attended operation.Connection process will be according to mark
Will position scan_cmpl is 1 to judge whether to classical bluetooth and connect.
Present invention also offers a kind of Bluetooth communication system, be applied to electronic equipment based on Linux system
In, described Bluetooth communication system includes:
Flag bit arranges module, is suitable to arrange flag bit, described flag bit include scan opening flag position,
It is scanned into line flag position and end of scan flag bit, and initializes described flag bit;
Scan module;
When described scanning opening flag position is the first state, described scan module is adapted for carrying out low-power consumption and sweeps
Retouching, described flag bit arranges module and is suitable to described scanning opening flag position and described is scanned into line flag position
It is set to the second state;
At the end of described low power scan, described flag bit arranges module and is suitable to described end of scan mark
Will position is set to the second state;
When described scanning opening flag position and the described end of scan are the second state, described scan module is fitted
In performing classical bluetooth scanning, described flag bit arranges module and is suitable to arrange the described line flag position that is scanned into
It it is the first state;
When the described classical bluetooth end of scan, described flag bit arranges module and is suitable to the described end of scan
Flag bit is set to the first state.
Optionally, described Bluetooth communication system also includes:
Low-power consumption bluetooth link block;
Flag bit arranges module, is further adapted for arranging judgement symbol position;
Judge module, is suitable to judge whether Current Scan terminates and be scanned into line flag position and institute described in judging
State the state of judgement symbol position;
If Current Scan terminates, described flag bit arranges module and is suitable to described judgement symbol position is set to
Two-state;
Being scanned into line flag position and described judgement symbol position described in if is the second state, described low-power consumption bluetooth
Link block is adapted for low-power consumption bluetooth and connects;
If described low-power consumption bluetooth link block successful connection, described flag bit arranges module and is suitable to arrange institute
Stating complement mark position is the second state;
If described low-power consumption bluetooth link block connection failure, described judge module is adapted for carrying out described judgement
The described state being scanned into line flag position and described judgement symbol position.
Optionally, described Bluetooth communication system also includes: described judge module, is suitable in described low-power consumption
Bluetooth connection failure, it is judged that be scanned into line flag position and the state of described judgement symbol position described in n time;If institute
Stating low-power consumption bluetooth to connect or failure, described flag bit arranges module, is suitable to arrange described complement mark
Position is the second state;Wherein n is the integer more than 0 and less than 10.
Optionally, described Bluetooth communication system also includes:
Classical bluetooth link block;
Flag bit arranges module, is further adapted for arranging judgement symbol position;
Judge module, is suitable to judge whether Current Scan terminates and be scanned into line flag position and institute described in judging
State the state of judgement symbol position;
If Current Scan terminates, described flag bit arranges module and is suitable to described judgement symbol position is set to
Two-state;
If being scanned into line flag position described in is the first state, and described judgement symbol position is the second state, described
Classical bluetooth link block is adapted for classical bluetooth and connects.
Optionally, scanning listening period arranges module;During the described flag bit of described initialization, described scanning
Listening period arranges module and is suitable to be respectively provided with described low power scan listening period and described classical bluetooth is swept
Retouch listening period.
It should be noted that through the above description of the embodiments, those skilled in the art can be clear
That recognizes to Chu the present invention partly or entirely can be by software and combine required general hardware platform and come real
Existing.Based on such understanding, prior art is contributed by technical scheme the most in other words
Part can embody with the form of software product, this computer software product can include on it store
Have one or more machine readable medias of machine-executable instruction, these instruction by such as computer,
One or more machines such as computer network or other electronic equipments can make this one or more machines when performing
Device performs operation according to embodiments of the invention.Machine readable media can include, but not limited to floppy disk,
CD, CD-ROM (compact-disc-read only memory), magneto-optic disk, ROM (read only memory), RAM
(random access memory), EPROM (Erasable Programmable Read Only Memory EPROM), (electricity can for EEPROM
Erasable programmable read-only memory (EPROM)), magnetic or optical card, flash memory or be suitable to store machine-executable instruction
Other kinds of medium/machine readable media.
It addition, the present invention can be used in numerous general or special purpose computing system environment or configuration.Such as:
Personal computer, server computer, handheld device or portable set, laptop device, multiprocessing
Device system, system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC,
Minicomputer, mainframe computer, include the distributed computing environment etc. of any of the above system or equipment.
The present invention can described in the general context of computer executable instructions,
Such as program module.Usually, program module includes performing particular task or realizing specific abstract data class
The routine of type, program, object, assembly, data structure etc..Can also be in a distributed computing environment
Put into practice the present invention, in these distributed computing environment, by by communication network connected remotely
Reason equipment performs task.In a distributed computing environment, program module may be located at and includes storage device
In interior local and remote computer-readable storage medium.
It should be noted that it will be understood by those skilled in the art that above-mentioned members can be able to programme
Logical device, including: programmable logic array (Programmable Array Logic, PAL), general
Array logic (Generic Array Logic, GAL), field programmable gate array (Field-
Programmable Gate Array, FPGA), CPLD (Complex
Programmable Logic Device, CPLD) in one or more, this is not done concrete limit by the present invention
System.
Although the present invention is open as above with preferred embodiment, but it is not for limiting the present invention, appoints
What those skilled in the art without departing from the spirit and scope of the present invention, may be by the disclosure above
Technical solution of the present invention is made possible variation and amendment by method and technology contents, therefore, every does not takes off
From the content of technical solution of the present invention, it is any that above example is made by the technical spirit of the foundation present invention
Simple modification, equivalent variations and modification, belong to the protection domain of technical solution of the present invention.
Claims (10)
1. a Bluetooth communication method, be applied to electronic equipment based on Linux system and standard bluetooth equipment and
Low-power consumption bluetooth equipment set up Bluetooth communication during, it is characterised in that including:
Arranging flag bit, described flag bit includes scanning opening flag position, being scanned into line flag position and scanning
End mark position, and initialize described flag bit;
When described scanning opening flag position is the first state, perform low power scan, and by described scanning
Opening flag position and the described line flag position that is scanned into are set to the second state;
At the end of described low power scan, described end of scan flag bit is set to the second state;
When described scanning opening flag position and described end of scan flag bit are the second state, perform classics
Bluetooth scans, and the described line flag position that is scanned into is set to the first state;
When the described classical bluetooth end of scan, described end of scan flag bit is set to the first state.
Bluetooth communication method the most according to claim 1, it is characterised in that also include:
Judgement symbol position is set;
Judging whether Current Scan terminates, if terminating, described judgement symbol position being set to the second state;
Be scanned into line flag position and the state of described judgement symbol position described in judgement, if described in be scanned into rower
Will position and described judgement symbol position are the second state, carry out low-power consumption bluetooth connection;
If described low-power consumption bluetooth successful connection, arranging described complement mark position is the second state;
If described low-power consumption bluetooth connection failure, then perform described in described judgement, to be scanned into line flag position and institute
State the step of the state of judgement symbol position.
Bluetooth communication method the most according to claim 2, it is characterised in that also include: if described low merit
Consume bluetooth connection failure, described in described judgement, be scanned into line flag position and the state of described judgement symbol position
Step perform after n time, arranging described complement mark position is the second state, wherein n be more than 0 and
Integer less than 10.
Bluetooth communication method the most according to claim 1, it is characterised in that also include:
Judgement symbol position is set;
Judging whether Current Scan terminates, if terminating, described judgement symbol position being set to the second state;
Be scanned into line flag position and the state of described judgement symbol position described in judgement, if described in be scanned into rower
Will position is the first state, and described judgement symbol position is the second state, carries out classical bluetooth and connects.
5. according to the Bluetooth communication method described in claim 2 or 4, it is characterised in that in described initialization institute
When stating flag bit, also include: be respectively provided with described low power scan listening period and described classical bluetooth
Scanning listening period.
6. a Bluetooth communication system, is applied in electronic equipment based on Linux system, it is characterised in that
Including:
Flag bit arranges module, is suitable to arrange flag bit, described flag bit include scan opening flag position,
It is scanned into line flag position and end of scan flag bit, and initializes described flag bit;
Scan module;
When described scanning opening flag position is the first state, described scan module is adapted for carrying out low-power consumption and sweeps
Retouching, described flag bit arranges module and is suitable to described scanning opening flag position and described is scanned into line flag position
It is set to the second state;
At the end of described low power scan, described flag bit arranges module and is suitable to described end of scan mark
Will position is set to the second state;
When described scanning opening flag position and the described end of scan are the second state, described scan module is fitted
In performing classical bluetooth scanning, described flag bit arranges module and is suitable to arrange the described line flag position that is scanned into
It it is the first state;
When the described classical bluetooth end of scan, described flag bit arranges module and is suitable to the described end of scan
Flag bit is set to the first state.
Bluetooth communication system the most according to claim 6, it is characterised in that also include:
Low-power consumption bluetooth link block;
Flag bit arranges module, is further adapted for arranging judgement symbol position;
Judge module, is suitable to judge whether Current Scan terminates and be scanned into line flag position and institute described in judging
State the state of judgement symbol position;
If Current Scan terminates, described flag bit arranges module and is suitable to described judgement symbol position is set to
Two-state;
Being scanned into line flag position and described judgement symbol position described in if is the second state, described low-power consumption bluetooth
Link block is adapted for low-power consumption bluetooth and connects;
If described low-power consumption bluetooth link block successful connection, described flag bit arranges module and is suitable to arrange institute
Stating complement mark position is the second state;
If described low-power consumption bluetooth link block connection failure, described judge module is adapted for carrying out described judgement
The described state being scanned into line flag position and described judgement symbol position.
Bluetooth communication system the most according to claim 7, it is characterised in that also include: described judgement mould
Block, is suitable in described low-power consumption bluetooth connection failure, it is judged that be scanned into line flag position and institute described in n time
State the state of judgement symbol position;If described low-power consumption bluetooth connects or failure, described flag bit is arranged
Module, being suitable to arrange described complement mark position is the second state;Wherein n is more than 0 and less than 10
Integer.
Bluetooth communication system the most according to claim 6, it is characterised in that also include:
Classical bluetooth link block;
Flag bit arranges module, is further adapted for arranging judgement symbol position;
Judge module, is suitable to judge whether Current Scan terminates and be scanned into line flag position and institute described in judging
State the state of judgement symbol position;
If Current Scan terminates, described flag bit arranges module and is suitable to described judgement symbol position is set to
Two-state;
If being scanned into line flag position described in is the first state, and described judgement symbol position is the second state, described
Classical bluetooth link block is adapted for classical bluetooth and connects.
10. according to the Bluetooth communication system described in claim 7 or 9, it is characterised in that also include: scanning prison
Listen set of time module;During the described flag bit of described initialization, described scanning listening period arranges module
Be suitable to be respectively provided with described low power scan listening period and described classical bluetooth scanning listening period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610221189.6A CN105898682A (en) | 2016-04-11 | 2016-04-11 | Method and system for Bluetooth communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610221189.6A CN105898682A (en) | 2016-04-11 | 2016-04-11 | Method and system for Bluetooth communication |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105898682A true CN105898682A (en) | 2016-08-24 |
Family
ID=57012410
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610221189.6A Pending CN105898682A (en) | 2016-04-11 | 2016-04-11 | Method and system for Bluetooth communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105898682A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491293A (en) * | 2018-03-14 | 2018-09-04 | 北京思特奇信息技术股份有限公司 | A kind of data managing method and system |
CN111405536A (en) * | 2020-03-18 | 2020-07-10 | 深圳创维数字技术有限公司 | Network distribution method, equipment and storage medium |
WO2023283794A1 (en) * | 2021-07-12 | 2023-01-19 | 华为技术有限公司 | Bluetooth connection method and apparatus |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110021142A1 (en) * | 2009-07-24 | 2011-01-27 | Prasanna Desai | Method and system for a dual-mode bluetooth low energy device |
CN103874166A (en) * | 2014-04-04 | 2014-06-18 | 北京赢销通软件技术有限公司 | Method for finding device based on Bluetooth technology |
CN104702322A (en) * | 2013-12-09 | 2015-06-10 | 通用汽车环球科技运作有限责任公司 | Method and apparatus for controlling operating states of bluetooth interfaces of a bluetooth module |
CN105246029A (en) * | 2015-10-23 | 2016-01-13 | 上海斐讯数据通信技术有限公司 | Bluetooth communication method and system and electronic device |
CN105430595A (en) * | 2015-10-26 | 2016-03-23 | 上海斐讯数据通信技术有限公司 | Connection method of bluetooth equipment and bluetooth equipment |
-
2016
- 2016-04-11 CN CN201610221189.6A patent/CN105898682A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110021142A1 (en) * | 2009-07-24 | 2011-01-27 | Prasanna Desai | Method and system for a dual-mode bluetooth low energy device |
CN104702322A (en) * | 2013-12-09 | 2015-06-10 | 通用汽车环球科技运作有限责任公司 | Method and apparatus for controlling operating states of bluetooth interfaces of a bluetooth module |
CN103874166A (en) * | 2014-04-04 | 2014-06-18 | 北京赢销通软件技术有限公司 | Method for finding device based on Bluetooth technology |
CN105246029A (en) * | 2015-10-23 | 2016-01-13 | 上海斐讯数据通信技术有限公司 | Bluetooth communication method and system and electronic device |
CN105430595A (en) * | 2015-10-26 | 2016-03-23 | 上海斐讯数据通信技术有限公司 | Connection method of bluetooth equipment and bluetooth equipment |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491293A (en) * | 2018-03-14 | 2018-09-04 | 北京思特奇信息技术股份有限公司 | A kind of data managing method and system |
CN111405536A (en) * | 2020-03-18 | 2020-07-10 | 深圳创维数字技术有限公司 | Network distribution method, equipment and storage medium |
CN111405536B (en) * | 2020-03-18 | 2023-03-24 | 深圳创维数字技术有限公司 | Network distribution method, equipment and storage medium |
WO2023283794A1 (en) * | 2021-07-12 | 2023-01-19 | 华为技术有限公司 | Bluetooth connection method and apparatus |
EP4336873A4 (en) * | 2021-07-12 | 2024-05-01 | Huawei Technologies Co., Ltd. | Bluetooth connection method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10536866B2 (en) | Orchestrating wireless network operations | |
CN104137439B (en) | Equity finds | |
US11119839B2 (en) | Remote debugging and management | |
WO2022017256A1 (en) | Device binding method and apparatus | |
CN104380700A (en) | System and method for persistent wireless docking | |
CN109041140B (en) | Method for rapidly switching wireless network, intelligent hardware and terminal equipment | |
CN105898682A (en) | Method and system for Bluetooth communication | |
CN108055144A (en) | The monitoring method and system of a kind of network equipment | |
CN103957580A (en) | Rapid WIFI networking matching method and module for smart hardware | |
JP2005210713A (en) | Configuration of ad-hoc radio network using portable media device | |
US20180034699A1 (en) | Network coordination apparatus | |
CN105246029B (en) | A kind of Bluetooth communication method, system and a kind of electronic equipment | |
CN103477677A (en) | Method and apparatus for cell type specific measurement configuration | |
CN105319973B (en) | A kind of method and device that smart home device is replaced by scanning the two-dimensional code | |
US9312948B2 (en) | Method and apparatus for enabling wireless dockees to find and dock with a wireless docking host being used by another dockee | |
US11564074B2 (en) | GAP and GATT adaptation protocol over internet protocol | |
CN109462880A (en) | WiFi network connection method and device | |
CN104105218A (en) | Method and system for achieving Android system mobile phone hotspot WPS connection | |
WO2017101544A1 (en) | Station opening method and device for relay system | |
CN106714200A (en) | Test system and test method of wireless network device | |
CN108809683A (en) | Dispose the method and device of cloud application system | |
CN204231671U (en) | A kind of Bluetooth beacon device and WLAN terminal authentication connecting system | |
CN107277896A (en) | Wifi hotspot management method, device and terminal device | |
CN112003821B (en) | Cloud platform security management method and system and security management server | |
CN106919836B (en) | Application port detection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160824 |