11 广播和扫描响应数据格式
广播、周期性广播和扫描响应数据格式如Figure 11.1所示。数据由重要部分和不重要部分组成。重要部分包含一系列的AD结构。每个AD结构都有一个1 octet的长度值和Length octets的数据字段。数据字段的第一个octet是AD类型,剩下的Length - 1 octets是AD数据,具体数据依赖AD类型。不重要部分用于在必要时扩充数据,全为0。
如果长度值设置为0,那么数据字段的字节数为零。这种情况只会发生在允许重要部分提前终止的情况下。
只有重要部分的数据应该播送。
主机广播数据放在ADV_IND、ADV_NONCONN_IND、ADV_SCAN_IND、AUX_ADV_IND和AUX_CHAIN_IND PDUs的AdvData字段中。
额外的控制器广播数据放在AUX_ADV_IND、AUX_SYNC_IND和AUX_SCAN_RSP PDUs的ACAD字段中。
周期性广播数据放在AUX_SYNC_IND和AUX_CHAIN_IND PDUs的AdvData字段中。
扫描响应数据放在SCAN_RSP PDUs的ScanRspData字段或AUX_SCAN_RSP PDUs的AdvData字段中发送。
如果完整的数据无法放入AUX_ADV_IND、AUX_SYNC_IND或AUX_SCAN_RSP PDU的AdvData字段,则使用AUX_CHAIN_IND PDUs发送数据的剩余片段。一个AD结构可能会分在两个或多个PDUs上。
数据类型和定义:参见 Core Specification Supplement,Part A,Section 1
数据类型值:https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/
广播数据-Advertising Data (AD), 扫描响应数据-Scan Response Data (SRD),额外的控制器广播数据-Additional Controller Advertising Data (ACAD)
Data type 大分类 | AD | SRD | ACAD | Data type 小分类 | 类型值 | 描述 |
Service UUID | O | O | O | «Incomplete List of 16-bit Service UUIDs» | 0x02 | More 16-bit Service UUIDs available |
«Complete List of 16-bit Service UUIDs» | 0x03 | Complete list of 16-bit Service UUIDs | ||||
«Incomplete List of 32-bit Service UUIDs» | 0x04 | More 32-bit Service UUIDs available | ||||
«Complete List of 32-bit Service UUIDs» | 0x05 | Complete list of 32-bit Service UUIDs | ||||
«Incomplete List of 128-bit Service UUIDs» | 0x06 | More 128-bit Service UUIDs available | ||||
«Complete List of 128-bit Service UUIDs» | 0x07 | Complete list of 128-bit Service UUIDs | ||||
Local Name | C1 | C1 | X | «Shortened Local Name» | 0x08 | Shortened local name |
«Complete Local Name» | 0x09 | Complete local name | ||||
Flags | C1 | X | X | «Flags» | 0x01 | 参见下表 |
Manufacturer Specific Data | O | O | O | «Manufacturer Specific Data» | 0xFF | Size: 2 or more octets The first 2 octets contain the Company Identifier Code followed by additional manufacturer specific data |
TX Power Level | O | O | X | «TX Power Level» | 0x0A | Size: 1 octet 0xXX: -127 to +127 dBm |
Slave Connection Interval Range | O | O | X | «Slave Connection Interval Range» | 0x12 | Size: 4 Octets The first 2 octets defines the minimum value for the connection interval The other 2 octets defines the maximum value for the connection interval |
Service Solicitation | O | O | X | «List of 16 bit Service Solicitation UUIDs» | 0x14 | List of 16 bit Service Solicitation UUIDs |
«List of 32 bit Service Solicitation UUIDs» | 0x1F | List of 32 bit Service Solicitation UUIDs | ||||
«List of 128 bit Service Solicitation UUIDs» | 0x15 | List of 128 bit Service Solicitation UUIDs | ||||
Service Data | O | O | O | «Service Data - 16 bit UUID» | 0x16 | Size: 2 or more octets The first 2 octets contain the 16 bit Service UUID followed by additional service data |
«Service Data - 32 bit UUID» | 0x20 | Size: 4 or more octets The first 4 octets contain the 32 bit Service UUID followed by additional service data |
||||
«Service Data - 128 bit UUID» | 0x21 | Size: 16 or more octets The first 16 octets contain the 128 bit Service UUID followed by additional service data |
||||
Appearance | C2 | C2 | X | «Appearance» |
0x19 |
The Appearance value shall be the enumerated value as defined by Assigned Numbers. 2 octets in length. A device shall have only one instance of the Appearance characteristic |
Public Target Address | C2 | C2 | X | «Public Target Address» | 0x17 | Size: Multiples of 6 octets The format of each 6 octet address is the same as the Public Device Address defined in [Vol 6] Part B, Section 1.3. The Public Target Address value shall be the enumerated value as defined by Assigned Numbers. |
Random Target Address | C2 | C2 | X | «Random Target Address» | 0x18 | Size: Multiples of 6 octets The format of each 6 octet address is the same as the Random Device Address defined in [Vol 6] Part B, Section 1.3. The Random Target Address value shall be the enumerated value as defined by Assigned Numbers. |
Advertising Interval | C1 | C1 | X | «Advertising Interval» | 0x1A | Size: 2 octets (UINT16) Units: 0.625 ms advInterval value |
Uniform Resource Identifier | O | O | X | «URI» | 0x24 | Scheme name string and URI as a UTF-8 string |
LE Supported Features | C1 | C1 | X | «LE Supported Features» | 0x27 | The format is the same as the FeatureSet defined in [Vol 6] Part B, Section 4.6. |
Channel Map Update Indication | X | X | C1 | «Channel Map Update Indication» | 0x28 | 0-4 octet:ChM 5-6 octet:Instant |
BIGInfo | X | X | C1 | «BIGInfo» | 0x2C | The format for BIGInfo is described in [Vol 6] Part B, Section 4.4.6.11. |
O:可选的,一个block中可以出现多次。 | ||||||
C1:可选的,一个block中不应出现超过一次。 | ||||||
C2:可选的,一个block中不应出现超过一次,并且同一扩展广播间隔中不应在AD和SDR中都出现。 | ||||||
X:预留未来使用。 |