QCC300x — 藍牙地址的規則

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XX  作       者:ZHS(文化人)

XX  聯繫方式:文章末尾Chat快問(或進羣:471144274

XX  版權聲明:原創文章,歡迎評論和轉載~轉載時能告訴我一聲就最好了

XX  要說的話:作者水平有限,難免有不足之處,懇請指正!

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

藍牙地址分爲三部分:

LAP(24位地址低端部分)、UAP(8位地址高端部分)和NAP(16位無意義地址部分)。

其中,NAP和UAP是生產廠商的唯一標識碼,必須由藍牙權威部門分配給不同的廠商。

而LAP是由廠商內部自由分配。

以下是CSR官方文檔有關藍牙地址的描述:

The local device's Bluetooth address.  This should be unique to this device.  It is allocated during manufacturing.
The type bdaddr can be viewed as a uint16[4] array:

    1st uint16:  The top 8 bits of the LAP are in the bottom 8 bits of this word. The top 8 bits of this word must be zero.
    2nd uint16: The lower 16 bits of the LAP
    3rd uint16:  The 8-bit UAP is in the bottom 8 bits of this word. The top 8 bits of this word must be zero.
    4th uint16:  16-bit NAP

For example, the Bluetooth address 0002  5b  00a5a5 is encoded as 0000, a5a5, 005b, 0002.


The default value of this key is one of CSR's legal addresses: 0002  5b  00a5a5.
As stated in the Bluetooth specification, LAP values from 9e8b00 up to, and including, 9e8b3f must not be used as this range is reserved for inquiry access codes (IACs).

Bluetooth module manufacturers must obtain their own block of addresses from the Bluetooth SIG/IEEE. If CSR's experience is typical, these authorities define the NAP and UAP, allowing manufacturers to set the 24-bit LAP.

對於某一種型號的手機或者設備,所有個體的NAP、UAP是固定的,可變的是LAP。

LAP共有24位,一般來說廠家在製造時會從0開始分配地址直到2的24次方,以保證個體之間地址的區別。

但是當產品數量太多,導致2的24次方都用完之後,或者在寫地址的時候出了問題,就會出現藍牙地址重複使用的情況, 但是概率非常小。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章