CN106951184A - A kind of Bluetooth address generation method - Google Patents
A kind of Bluetooth address generation method Download PDFInfo
- Publication number
- CN106951184A CN106951184A CN201710114630.5A CN201710114630A CN106951184A CN 106951184 A CN106951184 A CN 106951184A CN 201710114630 A CN201710114630 A CN 201710114630A CN 106951184 A CN106951184 A CN 106951184A
- Authority
- CN
- China
- Prior art keywords
- random number
- timer
- generation method
- bluetooth
- address generation
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4411—Configuring for operating with peripheral devices; Loading of device drivers
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C16/00—Erasable programmable read-only memories
- G11C16/02—Erasable programmable read-only memories electrically programmable
- G11C16/06—Auxiliary circuits, e.g. for writing into memory
- G11C16/10—Programming or data input circuits
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C16/00—Erasable programmable read-only memories
- G11C16/02—Erasable programmable read-only memories electrically programmable
- G11C16/06—Auxiliary circuits, e.g. for writing into memory
- G11C16/22—Safety or protection circuits preventing unauthorised or accidental access to memory cells
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C17/00—Read-only memories programmable only once; Semi-permanent stores, e.g. manually-replaceable information cards
- G11C17/14—Read-only memories programmable only once; Semi-permanent stores, e.g. manually-replaceable information cards in which contents are determined by selectively establishing, breaking or modifying connecting links by permanently altering the state of coupling elements, e.g. PROM
- G11C17/146—Write once memory, i.e. allowing changing of memory content by writing additional bits
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C17/00—Read-only memories programmable only once; Semi-permanent stores, e.g. manually-replaceable information cards
- G11C17/14—Read-only memories programmable only once; Semi-permanent stores, e.g. manually-replaceable information cards in which contents are determined by selectively establishing, breaking or modifying connecting links by permanently altering the state of coupling elements, e.g. PROM
- G11C17/18—Auxiliary circuits, e.g. for writing into memory
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
Abstract
The present invention provides Bluetooth address generation method, by setting timer, when system does not have Bluetooth address, produce to interrupt by timer and read system clock as the seed for producing random number, so as to produce random number, Bluetooth address is obtained by default algorithm again, manufacturing process is reduced, reliability is high.
Description
Technical field
The present invention relates to Bluetooth technology field, more particularly to a kind of Bluetooth address generation method.
Background technology
The generation method of current Bluetooth address has:
Scheme one:,, will at PC ends by replication tool by special burning plate using replication tool and upper computer software
The Bluetooth address woven is burnt in memory cell.
Scheme two:By increasing automatic station, after the completion of Product Assembly, by automation protocol with sending bluetooth
Location, product is received after order, and Bluetooth address is burnt in memory cell.
Above two scheme all existing defects:
The defect of scheme one has:
1) the upper computer software use to burning, burning operation step is needed to carry out special staff training, technical requirements
It is higher.
2) because of artificial operation, error rate is high, it is necessary to which special messenger does verification inspection to this, and cost of labor is high, and efficiency is low.
3) Bluetooth address is needed to carry out preprogrammed and the management of special project, and because of the volume production continuous in batches of product, management is got up
It is time-consuming, also easily chaotic error.
The defect of scheme two has:
1) need to increase automatic station in producing line production process, increase the production hour of whole machine, influence production efficiency.
2) need to do data protection to the Bluetooth address part of burning in product memory cell, prevent follow-up in upgrading production
Cause Bluetooth address to be wiped free of during product, cause Bluetooth function not use.
Therefore, prior art is further improved.
The content of the invention
The present invention provides a kind of Bluetooth address generation method, it is intended to solves defect of the prior art, realizes fast and reliable
Bluetooth address is generated, production cost is reduced.
To reach above-mentioned purpose, the technical solution used in the present invention is:
S1, at least two timers of setting;
S2, system electrification, read the data in default bluetooth storage address;
Whether S3, judgement have currently had Bluetooth MAC address, are to perform normal electrifying timing sequence, otherwise into next
Step;
S4, the timer T1, timer T2 obtain current system time clock respectively after producing interruption;
S5, using the current system time clock be used as random number seed, produce preset number random number;
S6, judge whether to receive system boot and complete information, be then to enter next step, otherwise return to step S4;
S7, according to the first random number X, the second random number Y, and the current system time clock C, calculating is obtained
First mediant Z1, and remove described timer T1, T2;
S8, the mediant Z1 is converted into its corresponding the second mediant of 16 system Z2;
S9, take the second mediant Z2 specified byte value as bluetooth equipment address.
Specifically, the specific steps of the random number for producing preset number include:
S501, the current system time clock is called as the seed of random number, pass through srand () function and initialize random letter
Number rand ();
S502, random function rand () is called, the first random number X, and the second random number Y are produced respectively.
Specifically, the duration of the timer should be much smaller than the time required to system boot.
Specifically, second timer when 10 times of a length of first timer duration.
Specifically, the duration T1=10ms of the first timer, the duration T2=100ms of the second timer.
Specifically, the preset number is 2.
Specifically, the Z1=X*Y*C.
Specifically, the specified byte is low three bytes.
The beneficial effects of the present invention are:The present invention is by setting timer, when system does not have Bluetooth address, by fixed
When device produce interrupt read system clock as produce random number seed, so as to produce random number, then pass through default algorithm
Bluetooth address is obtained, manufacturing process is reduced, reliability is high.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the Bluetooth address generation of the present invention.
Embodiment
Specifically illustrate embodiments of the present invention below in conjunction with the accompanying drawings, accompanying drawing is only for reference and explanation is used, do not constitute pair
The limitation of scope of patent protection of the present invention.
Fig. 1 is referred to, the Bluetooth address generation method that the present embodiment is provided is mainly included the following steps that:
Step 1, at least two timers of setting.
Numerical value identical possibility is obtained for reduction result of calculation, two timers should be at least set.
The duration of the timer should be different, as big as possible to ensure the system clock difference subsequently randomly generated, at this
In embodiment, second timer when 10 times of a length of first timer duration.
In the present embodiment, the duration T1=10ms of the first timer, every 10ms meetings since being set timer
Generation is once interrupted, the duration T2=100ms of the second timer, and one can be produced every 100ms since being set timer
It is secondary to interrupt.
In addition, the time required to the duration of the timer should be much smaller than system boot, in order to avoid timing after the completion of system boot
Device also cannot be introduced into, it is impossible to produce random number.
Step 2, system electrification, read the data in default bluetooth storage address.
Whether step 3, judgement have currently had Bluetooth MAC address, are to perform normal electrifying timing sequence, under otherwise entering
One step.
Step 4, the timer T1, timer T2 obtain current system time clock respectively after producing interruption.
In the present embodiment, the system clock is produced by a simulation clock inside main control chip, can be with system
Operation and change, can be obtained by directly reading correspondence register, as system clock.
For example, due to timer T1, T2 presence, since being set timer, can be read after 10ms produces interruption
Correspondence register value, and it regard the register value as current system time clock C1;Produced every 100ms and read after interruption corresponding post
Storage value, and it regard the register value as current system time clock C2.
Step 5, using the current system time clock be used as random number seed, produce preset number random number.
In this example, the preset number is 2.
In this embodiment, the specific steps of the random number for producing preset number include:
Step 501, call the current system time clock as the seed of random number, by the initialization of srand () function with
Machine function rand ();
Step 502, random function rand () is called, the first random number X, and the second random number Y are produced respectively.
Step 6, judge whether to receive system boot and complete information, be then to enter next step, otherwise return to step 4.
Step 7, according to the first random number X, the second random number Y, and the current system time clock C, calculate
The first mediant Z1 is obtained, and removes described timer T1, T2.
In the present embodiment, because step 4,5 are repeated, X, Y value are dynamic value, obtain X, and Y random numbers can be continuous
Change at random between 1~10000.
When system boot is completed, the first mediant Z1 be the first random number X, the second random number Y with it is described
The product of clock C when current system start is completed, i.e. Z1=X*Y*C.
Step 8, the mediant Z1 is converted into its corresponding the second mediant of 16 system Z2.
Step 9, take the second mediant Z2 specified byte value as bluetooth equipment address.
In the present embodiment, the specified byte is low three bytes.
Above disclosed is only presently preferred embodiments of the present invention, it is impossible to the rights protection model of the present invention is limited with this
Enclose, therefore the equivalent variations made according to scope of the present invention patent, still belong to the scope that the present invention is covered.
Claims (8)
1. a kind of Bluetooth address generation method, it is characterised in that including:
S1, at least two timers of setting;
S2, system electrification, read the data in default bluetooth storage address;
Whether S3, judgement have currently had Bluetooth MAC address, are to perform normal electrifying timing sequence, otherwise into next step;
S4, the timer T1, timer T2 obtain current system time clock respectively after producing interruption;
S5, using the current system time clock be used as random number seed, produce preset number random number;
S6, judge whether to receive system boot and complete information, be then to enter next step, otherwise return to step S4;
S7, according to the first random number X, the second random number Y, and the current system time clock C, calculating obtains first
Mediant Z1, and remove described timer T1, T2;
S8, the mediant Z1 is converted into its corresponding the second mediant of 16 system Z2;
S9, take the second mediant Z2 specified byte value as bluetooth equipment address.
2. Bluetooth address generation method according to claim 1, it is characterised in that the random number of the generation preset number
Specific steps include:
S501, the current system time clock is called as the seed of random number, pass through srand () function and initialize random function
rand();
S502, random function rand () is called, the first random number X, and the second random number Y are produced respectively.
3. Bluetooth address generation method according to claim 1, it is characterised in that the duration of the timer should be much smaller than
The time required to system boot.
4. Bluetooth address generation method according to claim 1, it is characterised in that second timer when a length of first determine
When 10 times of device duration.
5. Bluetooth address generation method according to claim 4, it is characterised in that the duration T1=of the first timer
10ms, the duration T2=100ms of the second timer.
6. Bluetooth address generation method according to claim 1, it is characterised in that the preset number is 2.
7. Bluetooth address generation method according to claim 1, it is characterised in that the first mediant Z1=X*Y*C.
8. Bluetooth address generation method according to claim 1, it is characterised in that the specified byte is low three words
Section.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710114630.5A CN106951184A (en) | 2017-02-28 | 2017-02-28 | A kind of Bluetooth address generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710114630.5A CN106951184A (en) | 2017-02-28 | 2017-02-28 | A kind of Bluetooth address generation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106951184A true CN106951184A (en) | 2017-07-14 |
Family
ID=59467022
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710114630.5A Pending CN106951184A (en) | 2017-02-28 | 2017-02-28 | A kind of Bluetooth address generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106951184A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109345803A (en) * | 2018-09-25 | 2019-02-15 | 浙江凯耀照明股份有限公司 | A kind of fast automatic method and its mechanism for generating random address code |
CN110390806A (en) * | 2018-04-16 | 2019-10-29 | 松下家电研究开发(杭州)有限公司 | The generation method of on-fixed address code |
CN115277646A (en) * | 2022-09-29 | 2022-11-01 | 河北振创电子科技有限公司 | Method and device for automatically setting MAC address of Ethernet data acquisition instrument |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1617464A (en) * | 2003-11-14 | 2005-05-18 | 华为技术有限公司 | Frequency hopping sequence generating method for realizing blue tooth cellural organized net |
CN1987770A (en) * | 2005-12-22 | 2007-06-27 | 佛山市顺德区顺达电脑厂有限公司 | Seed number producer and its producing method |
CN201628952U (en) * | 2010-01-19 | 2010-11-10 | 上海华平信息技术股份有限公司 | Random serial number generating system for hardware products |
CN102063285A (en) * | 2010-12-24 | 2011-05-18 | 倍奥锐(北京)科技有限公司 | True random number generation method implemented by software |
CN102710413A (en) * | 2012-04-25 | 2012-10-03 | 杭州晟元芯片技术有限公司 | System and method with function of DPA/SPA (Differential Power Analysis/Simple Power Analysis) attack prevention |
CN105528216A (en) * | 2015-12-15 | 2016-04-27 | 大连理工大学 | Method for randomly generating Bluetooth address by android system |
-
2017
- 2017-02-28 CN CN201710114630.5A patent/CN106951184A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1617464A (en) * | 2003-11-14 | 2005-05-18 | 华为技术有限公司 | Frequency hopping sequence generating method for realizing blue tooth cellural organized net |
CN1987770A (en) * | 2005-12-22 | 2007-06-27 | 佛山市顺德区顺达电脑厂有限公司 | Seed number producer and its producing method |
CN201628952U (en) * | 2010-01-19 | 2010-11-10 | 上海华平信息技术股份有限公司 | Random serial number generating system for hardware products |
CN102063285A (en) * | 2010-12-24 | 2011-05-18 | 倍奥锐(北京)科技有限公司 | True random number generation method implemented by software |
CN102710413A (en) * | 2012-04-25 | 2012-10-03 | 杭州晟元芯片技术有限公司 | System and method with function of DPA/SPA (Differential Power Analysis/Simple Power Analysis) attack prevention |
CN105528216A (en) * | 2015-12-15 | 2016-04-27 | 大连理工大学 | Method for randomly generating Bluetooth address by android system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110390806A (en) * | 2018-04-16 | 2019-10-29 | 松下家电研究开发(杭州)有限公司 | The generation method of on-fixed address code |
CN109345803A (en) * | 2018-09-25 | 2019-02-15 | 浙江凯耀照明股份有限公司 | A kind of fast automatic method and its mechanism for generating random address code |
CN115277646A (en) * | 2022-09-29 | 2022-11-01 | 河北振创电子科技有限公司 | Method and device for automatically setting MAC address of Ethernet data acquisition instrument |
CN115277646B (en) * | 2022-09-29 | 2022-12-30 | 河北振创电子科技有限公司 | Method and device for automatically setting MAC address of Ethernet data acquisition instrument |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107820603A (en) | A kind of firmware update and controller | |
CN104317617A (en) | Batch BMC Firmware refreshing method | |
CN106951184A (en) | A kind of Bluetooth address generation method | |
CN109582525A (en) | Test code verification method, verifying device, equipment and storage medium | |
CN107870948A (en) | Method for scheduling task and device | |
CN106406266B (en) | A method of the equipment that simulation is controlled by nuclear power station DCS system | |
US20190265668A1 (en) | Simulation device and simulation method | |
CN110347590A (en) | The interface testing control method and device of operation system | |
CN110632461B (en) | Test method, test terminal and test system for synchrophasor data concentrator | |
CN109167701B (en) | Consistency checking method, device and system for power distribution automation standardization extension communication protocol | |
CN108508296B (en) | Bidirectional ring network-based in-place element protection test method and system | |
CN111526213A (en) | Equipment control system based on block chain | |
CN106482299A (en) | Machine set system data backup device, method and the air-conditioner set with the device | |
CN107247827B (en) | Virtual terminal model modeling and automatic wiring method based on machine learning | |
CN110868458B (en) | Communication method and device for stable control system | |
CN108038127A (en) | A kind of method, apparatus, terminal device and the storage medium of data synchronization | |
CN101551769B (en) | Agglomeration method and device of configurable firmware | |
CN107678917A (en) | Test machine automatic management method, apparatus, equipment and storage medium | |
CN110175096B (en) | GPU (graphics processing Unit) pressurization test method, system, terminal and storage medium | |
CN115037651A (en) | RDMA bandwidth transmission testing method, system and storage medium | |
CN103532937A (en) | Application identification verifying method and device | |
CN114218011A (en) | Test simulation method and device, terminal equipment and storage medium | |
CN113568646A (en) | Novel portable program upgrading method | |
CN111126277A (en) | Power failure alarm signal identification method, device, terminal and storage medium | |
CN109558321A (en) | Android device test method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170714 |
|
RJ01 | Rejection of invention patent application after publication |