Bluetooth4.0 广播数据详解

1.广播通道:
   1.1  CH0, CH12,CH39为广播通道,其余为数据通道

  1.2   链路层数据包格式:
  

    preamble (前导码) :广播通道  Advertising channel packets shall have 10101010b as the preamble.
                                    数据通道:The data channel packet preamble is either 10101010b or 01010101b
     
    Access Address:(接入地址):
            广播 -The Access Address for all advertising channel packets shall be 10001110100010011011111011010110b  (0x8E89BED6)
            数据 -  The Access Address in data channel packets shall be different for each Link Layer connection between any two devices with certain restrictions as   defined   below
  
 CRC : 由PDU计算得到。
  

  PDU:     

         Header格式
      
 PDU type 广播包类型


  Advertising PDUS包含下面几种类型
- ADV_IND: 表明自己是可以被连接的
    Payload - AdvA(6 octets) + AdvData(0~31 octets)
        AdvA字段为advertiser的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)
- ADV_DIRECT_IND: 向特定设备建立连接
    Payload - AdvA(6 octets) + InitA(6 octets)
        AdvA字段为advertiser的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)
        InitA字段为initiator(接收方)的地址(RxAdd=0表示公共地址, Rxadd=1表示随机地址)
- ADV_NONCONN_IND: 用于广播信息
    Payload - AdvA(6 octets) + AdvData(0~31 octets)
        AdvA字段为advertiser的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)
- ADV_SCAN_IND: scannable undirected advertising event
    Payload - AdvA(6 octets) + AdvData(0~31 octets)
        AdvA字段为advertiser的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)


Scanning PDUS包含下面几种类型
- SCAN_REQ: 数据流向为 scanner->advertiser
    Payload - ScanA(6 octets) + AdvA(6 octets)
        ScanA字段为scanner的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)
        AdvA字段为advertiser的地址(RxAdd=0表示公共地址, Rxadd=1表示随机地址)
- SCAN_RSP: 数据流向为 advertiser->scanner
    Payload - AdvA(6 octets) + ScanRspData(0~31 octets)
        AdvA字段为advertiser的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)


Initiating PDUS包含下面的类型
- CONNECT_REQ: 数据流向为 initiator->advertiser
    Payload - InitA(6 octets) + AdvA(6 octets) + LLData(22 octets)
        InitA字段为scanner的地址(TxAdd=0表示公共地址, Txadd=1表示随机地址)
        AdvA字段为advertiser的地址(RxAdd=0表示公共地址, Rxadd=1表示随机地址)
        LLData字段如下,详细信息请参看规范
 


2.广播和扫描数据格式
   广播和扫描包最长31个字节。
   Length: 1字节, 表示DATA字段的数据长度
   AD TYPE : 1字节,  data字段的第一个字节是AD TYPE 。 (The first octet of the Data field contains the AD type        field)
   AD DATA :Length -1个字节,表示广播数据。

     Length为0时, Data字段
  
   

     2.1 AD TYPE DEFINITIONS:
    
0x01
«Flags»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.3 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.3 and 18.1 (v4.0)Core Specification Supplement, Part A, section 1.3











0x02
«Incomplete List of 16-bit Service Class UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.1 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.1 and 18.2 (v4.0)Core Specification Supplement, Part A, section 1.1











0x03
«Complete List of 16-bit Service Class UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.1 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.1 and 18.2 (v4.0)Core Specification Supplement, Part A, section 1.1











0x04
«Incomplete List of 32-bit Service Class UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.1 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, section 18.2 (v4.0)Core Specification Supplement, Part A, section 1.1











0x05
«Complete List of 32-bit Service Class UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.1 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, section 18.2 (v4.0)Core Specification Supplement, Part A, section 1.1











0x06
«Incomplete List of 128-bit Service Class UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.1 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.1 and 18.2 (v4.0)Core Specification Supplement, Part A, section 1.1











0x07
«Complete List of 128-bit Service Class UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.1 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.1 and 18.2 (v4.0)Core Specification Supplement, Part A, section 1.1











0x08
«Shortened Local Name»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.2 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.2 and 18.4 (v4.0)Core Specification Supplement, Part A, section 1.2











0x09
«Complete Local Name»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.2 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.2 and 18.4 (v4.0)Core Specification Supplement, Part A, section 1.2











0x0A
«Tx Power Level»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.5 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.5 and 18.3 (v4.0)Core Specification Supplement, Part A, section 1.5











0x0D
«Class of Device»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.6 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.5 and 18.5 (v4.0)Core Specification Supplement, Part A, section 1.6











0x0E
«Simple Pairing Hash C»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.6 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.5 and 18.5 (v4.0)
0x0E
«Simple Pairing Hash C-192»
Core Specification Supplement, Part A, section 1.6







0x0F
«Simple Pairing Randomizer R»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.6 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.5 and 18.5 (v4.0)
0x0F
«Simple Pairing Randomizer R-192»
Core Specification Supplement, Part A, section 1.6







0x10
«Device ID»
Device ID Profile v1.3 or later









0x10
«Security Manager TK Value»
Bluetooth Core Specification:Vol. 3, Part C, sections 11.1.7 and 18.6 (v4.0)Core Specification Supplement, Part A, section 1.8
0x11
«Security Manager Out of Band Flags»
Bluetooth Core Specification:Vol. 3, Part C, sections 11.1.6 and 18.7 (v4.0)Core Specification Supplement, Part A, section 1.7
0x12
«Slave Connection Interval Range»
Bluetooth Core Specification:Vol. 3, Part C, sections 11.1.8 and 18.8 (v4.0)Core Specification Supplement, Part A, section 1.9
0x14
«List of 16-bit Service Solicitation UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, sections 11.1.9 and 18.9 (v4.0)Core Specification Supplement, Part A, section 1.10
0x15
«List of 128-bit Service Solicitation UUIDs»
Bluetooth Core Specification:Vol. 3, Part C, sections 11.1.9 and 18.9 (v4.0)Core Specification Supplement, Part A, section 1.10
0x16
«Service Data»
Bluetooth Core Specification:Vol. 3, Part C, sections 11.1.10 and 18.10 (v4.0)




0x16
«Service Data - 16-bit UUID»
Core Specification Supplement, Part A, section 1.11







0x17
«Public Target Address»
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.13




0x18
«Random Target Address»
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.14




0x19
«Appearance»
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.12




0x1A
«Advertising Interval»
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.15




0x1B
«LE Bluetooth Device Address»
Core Specification Supplement, Part A, section 1.16







0x1C
«LE Role»
Core Specification Supplement, Part A, section 1.17







0x1D
«Simple Pairing Hash C-256»
Core Specification Supplement, Part A, section 1.6







0x1E
«Simple Pairing Randomizer R-256»
Core Specification Supplement, Part A, section 1.6







0x1F
«List of 32-bit Service Solicitation UUIDs»
Core Specification Supplement, Part A, section 1.10







0x20
«Service Data - 32-bit UUID»
Core Specification Supplement, Part A, section 1.11







0x21
«Service Data - 128-bit UUID»
Core Specification Supplement, Part A, section 1.11







0x22
«LE Secure Connections Confirmation Value»
Core Specification Supplement Part A, Section 1.6







0x23
«LE Secure Connections Random Value»
Core Specification Supplement Part A, Section 1.6







0x24
«URI»
Bluetooth Core Specification:Core Specification Supplement, Part A, section 1.18




0x25
«Indoor Positioning»
Indoor Posiioning Service v1.0 or later








0x26
«Transport Discovery Data»
Transport Discovery Service v1.0 or later








0x27
«LE Supported Features»
Core Specification Supplement, Part A, Section 1.19











0x28
«Channel Map Update Indication»
Core Specification Supplement, Part A, Section 1.20











0x29
«PB-ADV»
Mesh Profile Specification Section 5.2.1











0x2A
«Mesh Message»
Mesh Profile Specification Section 3.3.1











0x2B
«Mesh Beacon»
Mesh Profile Specification Section 3.9











0x3D
«3D Information Data»
3D Synchronization Profile, v1.0 or later








0xFF
«Manufacturer Specific Data»
Bluetooth Core Specification:Vol. 3, Part C, section 8.1.4 (v2.1 + EDR, 3.0 + HS and 4.0)Vol. 3, Part C, sections 11.1.4 and 18.11 (v4.0)Core Specification Supplement, Part A, section 1.4











  2.2 常用AD_TYPE  
        
        Flags: 

    
      service :
   

    Local Name :
    

    TX Power:
     

     MANUFACTURER SPECIFIC DATA:
   

    SLAVE CONNECTION INTERVAL RANGE:
  
    




阅读更多

扫码向博主提问

wulazula

非学,无以致疑;非问,无以广识
  • 擅长领域:
  • BLE
  • 嵌入式
去开通我的Chat快问
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wulazula/article/details/80320978
个人分类: BLE低功耗蓝牙技术
上一篇Nordic协议栈与app的调用方式
下一篇ble广播包解析
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭