1. 程式人生 > >Bluetooth4.0 廣播資料詳解

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: