您的位置:首页 > 产品设计 > UI/UE

Bluetooth Device Address

2015-12-23 14:35 1106 查看
(The article is a note about Bluetooth device address in Bluetooth Core spec V4.2)

Bluetooth Device Address

All Bluetooth devices shall have a Bluetooth Device Address (BD_ADDR) that uniquely identifies the device to another Bluetooth device. The specific Bluetooth Device Address requirements depend on the type of Bluetooth device. There are two types of Bluetooth Device Address: Public Bluetooth Address and Random Bluetooth Address. They are both 48 bits in length.

A device shall use at least one type of device address and may contain both.

Public Bluetooth Address

for BR/EDR Device ([Vol 2] Part B Section 1.2)

Each Bluetooth device shall be allocated a unique 48-bit Bluetooth address (BD_ADDR). This address shall be obtained from the IEEE Registration Authority. The address shall be created in accordance with Section 9.2 (“48-bit universal LAN MAC addresses”) of the IEEE 802-2001 standard (http://standards.ieee.org/findstds/standard/802-2001.html) and using a valid Organizationally Unique Identifier (OUI) obtained from the IEEE Registration Authority (see http://standards.ieee.org/regauth/oui/forms/ and Sections 9 and 9.1 of the IEEE 802-2001 specification). The LAP and UAP form the significant part of the BD_ADDR. The bit pattern in Figure 1.5 is an example BD_ADDR.



for LE Device ([Vol 6] Part B Section 1.3.1)

The public device address shall be created in accordance with Section 9.2 (“48-bit universal LAN MAC addresses”) of the IEEE 802-2001 standard (http://standards.ieee.org/findstds/standard/802-2001.html) and using a valid Organizationally Unique Identifier (OUI) obtained from the IEEE Registration Authority (see http://standards.ieee.org/regauth/oui/forms/ and Sections 9 and 9.1 of the IEEE 802-2001 specification). The public device address is divided into the following two fields:

company_assigned field is containd in the 24 least significant bits

company_id field is contained in 24 most significant bits



Random Device Address

Random device address is only supported by LE. The random device address may be of either of the following two sub-types:

Static address

Private address

The term random device address refers to both static and private address types.

The transmission of a random device address is optional. A device shall accept the reception of a random device address from a remote device.

A bonded device shall process a resolvable private address as defined in Section 10.8.2.3 or by establishing a connection and then performing the authentication procedure as defined in Section 10.3. A device that uses resolvable private address shall always request to distribute its IRK value as defined in [Vol 3] Part H Section 3.6.4 if both sides are bondable, unless keys have been pre-distributed. If the request to distribute the IRK fails then the peer device may authenticate re-connections using the authentication procedure as defined in Section 10.3 o terminate the current connection.

Static Address ([Vol 6] Part B Section 1.3.2.1)

A static address is a 48-bit randomly generated address and shall meet the following requirements:

The two most significant bits of the address shall be equal to 1

All bits of the random part of the address shall not be equal to 1

All bits of the random part of the address shall not be equal to 0

The format of a static address is shown in Figure 1.3.



A device may choose to initialize its static address to a new value after each power cycle. A device shall not change its static address value once initialized until the device is power cycled.

Note: If the static address of a device is changed, then the address stored in peer devices will not be valid and the ability to reconnect using the old address will be lost.

Private Address ([Vol 6] Part B Section 1.3.2.2&3)

The private address may be of either of the following two sub-types:

Non-resolvable private address

Resolvable private address

Non-resolvable Private Address

Generation

To generate a non-resolvable private address, the device shall generate a 48-bit address with the following requirements:

The two most significant bits of the address shall be equal to 0

All bits of the random part of the address shall not be equal to 0

All bits of the random part of the address shall not be equal to 1

The address shall not be equal to the public address

The format of a non-resolvable private address is shown in Figure 1.4.



Resolution

A non-resolvable private address cannot be resolved.

Resolvable Private Address

Generation

To generate a resolvable private address, the device must have either the Local Identity Resolving Key (IRK) or the Peer Identity Resolving Key (IRK). The resolvable private address shall be generated with the IRK and a randomly generated 24-bit number. The random number is known as prand and shall meet the following requirements:

The two most significant bit s of prand shall be equal to 0 and 1 as shown in Figure 1.5

All bits of the random part of prand shall not be equal to 0

All bits of the random part of prand shall not be equal to 1

The format of the resolvable private address is shown in Figure 1.5.



The hash is generated using the random address function ah defined in [Vol 3] Part H Section 2.2.2 with the input parameter k set to the device’s IRK and the input parameter r set to prand.

hash = ah(IRK, prand)

The prand and hash are concatenated to generate the random address (randomAddress) in the following manner:

randomAddress = hash || prand

The least significant octet of hash becomes the least significant octet of randomAddress and the most significant octet of prand become the most significant octet of randomAddress.

Resolution

A resolvable private address may be resolved if the corresponding device’s IRK is available using this procedure. If a resolvable private address is resolved, the device can associate this address with the peer device.

The resolvable private address (RPA) is divided into a 24-bit random part (prand) and a 24-bit part (hash). The least significant octet of the RPA becomes the least significant octet of hash and the most significant octet of RPA becomes the most significant octet of prand. A localHash value is then generated using the random address hash function ah defined in [Vol 3] Part H Section 2.2.2 with the input parameter k set to IRK of the know device and the input parameter r set to the prand value extracted from the RPA.

localHash = ah(IRK, prand)

The localHash value is then compared with the hash value extracted from RPA. If the localHash value matches the extracted hash value, then the identity of the peer device has been resolved.

If a device has more than one stored IRK, the device repeats the above procedure for each stored IRK to determine if the received resolvable private address is associated with a stored IRK, until either address resolution is successful for one of the IRKs or all have been tried.

Note: A device that cannot resolve a private address within T_IFS may respond on the reception of the next event.

Bluetooth Device Address Summary

Public Bluetooth Address (for BR/EDR and LE)

Random Bluetooth Address (for LE)

Static Address (MSB: 11)

Private Address

Non-resolvable Private Address (MSB: 00)

Resolvable Private Address (MSB: 01)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  蓝牙 Bluetooth