HCI TRANSPORT LAYER - Ting-Chao Hou's Home Page

Post on 03-Feb-2022

4 views 0 download

Transcript of HCI TRANSPORT LAYER - Ting-Chao Hou's Home Page

HCI TRANSPORT LAYER

BLUETOOTH SPEC. Version 1.1

Presented by Leon Lee

2001/09/12

OUTLINE

n Introductionn HCI USB Transport Layern HCI RS232 Transport Layern HCI UART Transport Layern Conclusion and discussionn Implementation of HCI driver

INTRODUCTION

n What is HCI transport layer

n Physical object photos

n The position of transport layer

n Bluetooth implementation solutions

WHAT IS THE TRANSPORT LAYER

n Physical link : between Host and Host Controller

n Transparency : NOT decode the packet flow (packet payload)

n Supported physical busesn USB (Universal Serial Bus)

n RS232

n UART (Universal Asynchronous Receiver/Transmitter)

n PC card(derivatives of the ISA bus (Compact Flash/PC Card

interfaces)

PHYSICAL OBJECT PHOTO

Bluetooth module(ericsson)

Interface through USB,UART/PCM

USB 1.1 compliant(voice and data)

Application tool kit

USBRS232

RESETJumper

PHYSICAL OBJECT PHOTO(con’d)

POSITION OF TRANSPORT LAYER

n Bluetooth device end to end viewn Bluetooth low layer software view

n Bluetooth hardware block diagram viewn Bluetooth components viewn Bluetooth physical block diagram view

BLUETOOTH DEVICE END TO END VIEW

BLUETOOTH LOW LAYER SOFEWARE VIEW

BLUETOOTH HARDWARE BLOCK DIAGRAM VIEW

BLUETOOTH COMPONENTS VIEW

BLUETOOTH COMPONENTS VIEW(con’d)

BLUETOOTH PHYSICAL DIAGRAM VIEW

BLUETOOTH IMPLEMENTATION SOLUTIONS

BLUETOOTH IMPLEMENTATION SOLUTIONS(con’d)

BLUETOOTH IMPLEMENTATION SOLUTIONS(con’d)

BLUETOOTH IMPLEMENTATION SOLUTIONS(con’d)

BLUETOOTH IMPLEMENTATION SOLUTIONS(con’d)

HCI USB TRANSPORT LAYER

n Introduction to USB

n Relationship figure

n Flow of data

n USB endpoint expectations

n Class code

INTRODUCTION TO USB

n Characters of USB 1.0

n Bus topology

n Taxonomy of application space

n USB packet types

n Data flow types

CHARACTERS OF USB 1.0

n Hot-plugn Ease of usen High performance: 12 Mbpsn Up to 127 devicesn Power supplied by cablen Power management:enter suspend when no

activity,and the current will be changed to 0.5mA

n Error detection and recovery

BUS TOPOLOGY

TACONOMY OF APPLICATION SPACE

From USB 2.0 for ref.

USB PACKET TYPES (USB 1.0)

n Tocken: SOF,SETUP,IN,OUTn DATA: DATA0,DATA1

n Handshake: ACK,NAK,STALLn Special: PRE(Low-speed(1.5Mbps))n Others

USB PACKET TYPES(con’d)

n Start-Of-Frame(SOF) : 1ms per packet, 11bits for frame num, 5bits for CRC check

n Setup,IN,and OUT : including 7-bit device address,a 4-bit endpoint address,and a 5-bit CRC

n DATA0,DATA1 : A data transfer packet can have a payload varying from 0 to 1023 bytes and a 16-bit CRC

n ACK NAK: acknowledge, and not acknolwdge

n STALL : failed commands

DATA FLOW TYPES

n Control transfers : setup phase,data phase,status phase

n Bulk data transfers : large and bursty quantities (ack)

n Interrupt data transfers : for timely but reliable delivery of data

n Isochronous data transfers : occupy aprenegotiated amount of USB bandwidth with a prenegotiated delivery latency(no ack)

RELATIONSHIP FIGURE

FLOW OF DATAS

USB ENDPOINT EXPECTATIONS

n Required configuration

n Control endpoint expectations

n Bulk endpoint expectations

n Interrupt endpoint expectations

n Isochronous endpoint expectations

REQUIRED CONFIGURATION

REQUIRED CONFIGURATION(con’d)

CONTROL ENDPOINT EXPECTATONS

n Endpoint 0 n Configuring and controlling the USB device

n Host to send HCI-specific commands to host controller

n UBS commands vs. HCI commands

BULK ENDPOING EXPECTATIONS

n Data integrity issuen Bulk maximum packer size = 64 bytes

n The ability of error detecting and correcting

n Starvation avoidance

INTERRUPT ENDPOING EXPECTATIONS

n Guaranteed latency (event)n Time interval : 1ms

n No intimate knowledge about events

ISOCHRONOUS ENDPOING EXPECTATIONS

n Transferring SCO datan Timely sending packet

n 1 ms intervaln Three 64 kb/s channels => 64 bytes(max

packet size)n One/two channels => 32 bytes (max

packet size)

CLASS CODE

From spec. 1.1 p794

HCI RS232 TRANSPORT LAYER

n Introduction to RS232

n HCI RS232 packet

n Using delimiters with COBS for synchronization(Consistent Overhead Byte Stuffing)

n Using RTS/CTS for synchronization(Ready to send/Clear to send)

INTRODUCTION TO RS232

n Recommended Standard by EIA n Data terminal equipment(DTE) : ex. PC

n Data communication equipment(DCE) : ex. MODEM

n Transfer rate : 0-20000 bps

HCI RS232 PACKET

Basic RS232 transport packet frame

HCI RS232 PACKET(con’d)

•The Error Mes-sage Packet (0x05) is used by the receiver to report the nature of error to the transmitting side

•The Negotiation Packet (0x06) is used to negotiate the communication

settings and protocols

BASIC RS232 TRANSPORT PACKET FRAME

NEGOTIATION PROTOCOL

n Initiating parametersn The negotiation packet format

INITIATING PARAMETERS

n Baud rate : 9600n Parity type : no parity

n Number of data bit : 8n Number of stop bit : 1n Protocol mode : 0x13

THE NEGOTIATION PACKET FORMAT

USING DELIMITERS WITH COBS FOR SYNCHRONIZATION

Frame format

Error message format

USING DELIMITERS WITH COBS FOR SYNCHRONIZATION(con’d)

Error types

USING RTS/CTS FOR SYNCHRONIZATION

Error-message packet format

HCI UART TRANSPORT LAYER

n Introduction to UART(Universal Asynchronous Receiver Transmitter)

n Protocol

n RS232 settings

INTRODUCTION TO UART

n A programmable processor(8250)n Parallel data to serial data

n Control , status , and buffer registersn Working standalonen UART I/O ports

PROTOCOL

RS232 SETTINGS

CONCLUSION AND DISCUSSION

CONCLUSION AND DISCUSSION(con’d)

NO HCI

CONCLUSION AND DISCUSSION(con’d)

NO HCI

IMPLEMENTATION OF HCI DRIVER

n Function introductionn HCI driver use case

n HCI driver architecture

FUNCTION INTRODUCTION

n HCI Driver n 提供HCI 的 Commands 以及和L2CAP 溝通的命令n 接收並區分上層所送來的packet type n 將收到的Command或DATA Packet轉成HCI

Firmware 可以接受的HCI Packet形式n 透過 Transport Layer 將HCI Packets 送給 HCI

Firmware n 接收由 Transport Layer 所送來的 DATA Packet 和

Event Packet做分析並做出相應的動作n 將相應的資料往上傳

HCI DRIVER USE CASE

Initial the system

Interprete HCI Event from lowwer layer

Receive data packet

Send data packet

L2CAP Software

TCS Software

Host controller

Interprete HCI command from higher l a y e r

Receive data from High layer

<<Uses>>

Receive data from lower layer

<<Uses>>

<<Uses>>

<<Uses>>

HCI DRIVER ARCHITECTURE