HCI学习笔记

一、HCI介绍

HCI:Host Controller Interface

HCI提供了访问Controller的统一接口

所谓的Controller,主要包含下面几种类型

  • BR/EDR Controller
  • BD/EDR/LE Controller
  • LE Controller
  • AMP Controller

前三种属于Primary Controller。一个Host可以有一个Primary Controller以及零个或者多个AMP Controller。


HCI在蓝牙软件协议栈中的位置

HCI学习笔记_第1张图片

                               图1-1 HCI在蓝牙软件协议栈中的位置

从端到端的视角来看

HCI学习笔记_第2张图片

                                                                                                图1-2 端到端视角看HCI与蓝牙数据传输

二、HCI Commands和Events

HCI的Commands是Host发给Controller的,Events则是Controller发给Host的,根据功能,可以分成17组

  • Generic Events,包含Command Complete Event,Command Status Event和Hardware Error Event
  • Device Setup ,包含Reset command
  • Controller Flow Control, Controller Flow Control Commands 和Events用于实现Host到Controller的流控,包含Read Buffer Size Command,Num Of Completed Packets Event, Read Data Block Size Command,Num Of Completed Data Blocks Event, Read Flow Control Mode Command, Write Read Flow Control Mode Command和LE Read Buffer Size Command。
  • Controller Information, Controller Information Commands 用来获取local device信息。它包含Read Local Version Information Command,Read Local Supportted Commands Command,Read Local Supported Feature Command,Read Local Extended Feature Command,Read BD_ADDR Command, LE Read Local Supported Feature Command和LE Read Supported States Command。
  • Controller Configuration, Controller Configuration Commands 和Events用来读取或者配置local device,包含Read Local Name Command,Write Local Name Command,Read Scan Enable Command,Write Scan Enable Command等。
  • Device Discovery, Device Discovery Commands和Events用于discover周围的设备,包含Inquiry Command , Inquiry Result Event, Inquiry Result With RSSI Event,Extended inquiry Result Event,Inquiry Cancel Command, Inquiry Complete Event,Periodic Inquiry Mode Command等。
  • Connection Setup,Connection Setup Commands和Events用来同其他设备建立连接。包含Create Connection Command, Connection Request Event, Accept Connnection Request Command, Reject Connection Requet Command,Create Connection Cancel Command,Connection Complete Event,Disconnect Command,Disconnection Complete Event等。
  • Remote Information, Remote Information Commands 和Events用于获取远端设备的信息,包含Remote Name Request Command,Remote Name Request Cancel Command, Remote Name Request Complete Event,Read Remote Supported Features Command,Read Remote Supported Features Complete Event等。
  • Synchronous Connections,Synchronous Connections Commands 和Events用来建立同步连接。包含Setup Synchronous Connection Command,Synchronous Connection Complete Event,Synchronous Connection Changed Event,Accept Synchronous Connection Request Event,Reject Synchronous Connection Request Command,Read Voice Setting Command, Write Voice Setting Command.
  • Connection State,Connection State Commands 和Events用于对一条link进行配置,特别是对于low power operation。
  • Piconet Structure,Piconet Structure Commands和Events用于发现及对一个Piconet重新配置
  • Quality Of Service,Quality Of Service Commands和Events用于配置一条link的Qos
  • Physical Links, Physical Links Commands和Events用于配置Physical Link.
  • Host Flow Control, Host Flow Control Comamnds and Events用来往Host方向的流控。包含Host Buffer Size Command,Set Event Mask Command,Set Event Filter Command,Set Controller to Host Flow Control Command,Host Number Of Completed Packets Command等。
  • Link Information,Link Information commands and events用于读取Link的信息。包含Read LMP Handle Command,Read Transmit Power Command,Read Link Quality Command, Read RSSI Command等。
  • Authentication And Encryption, Authentication And Encryption Commands and Events用于远端设备的鉴权和对link的加密。包含Read Authentication Enable Command,Write Authentication Enable Command,Read Encryption Mode Command,Write Encrypiton Mode Command,Link Key Request Event,Link Key Request Reply Command,Link Key Request Negative Reply Command, PIN Code Request Event,PIN Code Request Reply Command,PIN Code Request Negative Reply Command,Link Key Notification Event,Authentication Request Command,Authentication Complete Event等
  • Testing

你可能感兴趣的:(bluetooth)