Volume 4 - SPEC PDF
Volume 4 - SPEC PDF
Specification
of the Bluetooth
System
Wireless connections made easy
Host Controller
Interface
[Transport Layer]
Volume 04
Revision 1.2 or later
Issued: 01 January 2006
Including:
A: UART v1.1
B: SD v1.1
C: USB v1.0
D: 3-wire v0.95
BLUETOOTH SPECIFICATION [vol 4] page 2 of 76
Revision History
Rev Date Comments
D05R00 May 13 2004 First revision of this volume with informational content.
Contributors
Toru Aihara IBM Corporation
Edgar Kerstan IBM Corporation
Nathan Lee IBM Corporation
Kris Fleming Intel Corporation
Robert Hunter Intel Corporation
Patrick Kane Motorola, Inc.
Uwe Gondrum Nokia Corporation
Thomas Müller Nokia Corporation
Christian Zechlin Nokia Corporation
Johannes Elg Telefonaktiebolaget LM Ericsson
Sven Jerlhagen Telefonaktiebolaget LM Ericsson
Christian Johansson Telefonaktiebolaget LM Ericsson
Patrik Lundin Telefonaktiebolaget LM Ericsson
Lars Novak Telefonaktiebolaget LM Ericsson
Masahiro Tada Toshiba Corporation
Steve Ross Digianswer A/S
Chatschik Bisdikian IBM Corporation
Les Cline Intel Corporation
Brad Hosler Intel Corporation
John Howard Intel Corporation
Srikanth Kambhatla Intel Corporation
Kosta Koeman Intel Corporation
John McGrath Intel Corporation
Patrik Lundin Telefonaktiebolaget LM Ericsson
Leonard Ott Socket Communications
Rebecca O’Dell Signia Technologies
Tsuyoshi Okada Matsushita Electric
Robin Heydon CSR
Web Site
This specification can also be found on the official Bluetooth website: http://
www.bluetooth.org
Any use of the Specification not in compliance with the terms of the applicable
Membership Agreement, Early Adopters Agreement or Promoters Agreement is
prohibited and any such prohibited use may result in termination of the applica-
ble Membership Agreement or Early Adopters Agreement and other liability per-
mitted by the applicable agreement or by applicable law to Bluetooth SIG or any
of its members for patent, copyright and/or trademark infringement.
Each Member hereby acknowledges that products equipped with the Bluetooth
technology ("Bluetooth products") may be subject to various regulatory controls
under the laws and regulations of various governments worldwide. Such laws
and regulatory controls may govern, among other things, the combination,
operation, use, implementation and distribution of Bluetooth products. Exam-
ples of such laws and regulatory controls include, but are not limited to, airline
regulatory controls, telecommunications regulations, technology transfer con-
trols and health and safety regulations. Each Member is solely responsible for
the compliance by their Bluetooth Products with any such laws and regulations
and for obtaining any and all required authorizations, permits, or licenses for
their Bluetooth products related to such regulations within the applicable juris-
dictions. Each Member acknowledges that nothing in the Specification pro-
vides any information or assistance in connection with securing such
compliance, authorizations or licenses. NOTHING IN THE SPECIFICATION
CREATES ANY WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARD-
ING SUCH LAWS OR REGULATIONS.
Bluetooth SIG reserve the right to adopt any changes or alterations to the Spec-
ification as it deems necessary or appropriate.
Copyright © 2001, 2002, 2003, 2004, 2005, 2006. Bluetooth SIG Inc. All copy-
rights in the Bluetooth Specifications themselves are owned by Agere Systems
Inc., Ericsson Technology Licensing AB, IBM Corporation, Intel Corporation,
Microsoft Corporation, Motorola, Inc., Nokia Mobile Phones and Toshiba Cor-
poration.
*Other third-party brands and names are the property of their respective own-
ers.
TABLE OF CONTENTS
Part A
UART TRANSPORT LAYER
1 General ............................................................................................... 15
2 Protocol .............................................................................................. 16
3 RS232 Settings................................................................................... 17
4 Error Recovery................................................................................... 18
Part B
SECURE DIGITAL (SD)
TRANSPORT LAYER
1 Introduction........................................................................................ 23
2 Goals................................................................................................... 24
2.1 Hardware Goals......................................................................... 24
2.2 Software Goals .......................................................................... 24
3 Physical Interface Documents.......................................................... 25
4 Communication.................................................................................. 26
4.1 Overview.................................................................................... 26
5 Appendix A - Acronyms and Abbreviations.................................... 27
6 Appendix B - Related Documents .................................................... 28
7 Appendix C - Tests............................................................................. 29
7.1 Test Suite Structure ................................................................... 29
Part C
USB TRANSPORT LAYER
1 Overview............................................................................................. 34
2 USB Endpoint Expectations ............................................................. 36
2.1 Descriptor Overview .................................................................. 36
2.2 Control Endpoint Expectations .................................................. 41
2.3 Bulk Endpoints Expectations ..................................................... 41
2.4 Interrupt Endpoint Expectations ................................................ 42
2.5 Isochronous Endpoints Expectations......................................... 42
3 Class Code ......................................................................................... 43
Part D
THREE-WIRE UART TRANSPORT LAYER
1 General ............................................................................................... 51
2 Overview............................................................................................. 52
3 Slip Layer ........................................................................................... 53
3.1 Encoding a Packet .................................................................... 53
3.2 Decoding a Packet .................................................................... 53
4 Packet Header.................................................................................... 55
4.1 Sequence Number .................................................................... 55
4.2 Acknowledge Number ............................................................... 56
4.3 Data Integrity Check Present .................................................... 56
4.4 Reliable Packet ......................................................................... 56
4.5 Packet Type............................................................................... 56
4.6 Payload Length ......................................................................... 57
4.7 Packet Header Checksum......................................................... 57
5 Data Integrity Check .......................................................................... 58
5.1 16 Bit CCITT-CRC..................................................................... 58
6 Reliable Packets ................................................................................ 59
6.1 Header Checksum Error............................................................ 59
6.2 Slip Payload Length Error ......................................................... 59
6.3 Data Integrity Check Error ......................................................... 59
6.4 Out Of Sequence Packet Error.................................................. 59
6.5 Acknowledgement ..................................................................... 60
6.6 Resending Packets ................................................................... 60
6.7 Example Reliable Packet Flow.................................................. 60
7 Unreliable Packets............................................................................. 63
7.1 Unreliable Packet Header ......................................................... 63
7.2 Unreliable Packet Error ............................................................. 63
8 Link Establishment............................................................................ 64
8.1 Uninitialized State...................................................................... 65
8.2 Initialized State .......................................................................... 65
Revision 1.1
BLUETOOTH SPECIFICATION [vol 4] page 12 of 76
UART Transport Layer
CONTENTS
1 General ............................................................................................... 15
2 Protocol .............................................................................................. 16
3 RS232 Settings................................................................................... 17
4 Error Recovery................................................................................... 18
1 GENERAL
The objective of this HCI UART Transport Layer is to make it possible to use the
Bluetooth HCI over a serial interface between two UARTs on the same PCB.
The HCI UART Transport Layer assumes that the UART communication is free
from line errors.
2 PROTOCOL
There are four kinds of HCI packets that can be sent via the UART Transport
Layer; i.e. HCI Command Packet, HCI Event Packet, HCI ACL Data Packet and
HCI SCO Data Packet (see “Host Controller Interface Functional Specification”
in Volume 2, Part E). HCI Command Packets can only be sent to the Bluetooth
Host Controller, HCI Event Packets can only be sent from the Bluetooth Host
Controller, and HCI ACL/SCO Data Packets can be sent both to and from the
Bluetooth Host Controller.
HCI does not provide the ability to differentiate the four HCI packet types.
Therefore, if the HCI packets are sent via a common physical interface, a HCI
packet indicator has to be added according to Table 2.1 below.
The HCI packet indicator shall be sent immediately before the HCI packet. All
four kinds of HCI packets have a length field, which is used to determine how
many bytes are expected for the HCI packet. When an entire HCI packet has
been received, the next HCI packet indicator is expected for the next HCI
packet. Over the UART Transport Layer, only HCI packet indicators followed by
HCI packets are allowed.
3 RS232 SETTINGS
The HCI UART Transport Layer uses the following settings for RS232:
Table 3.1:
Flow control with RTS/CTS is used to prevent temporary UART buffer overrun.
It should not be used for flow control of HCI, since HCI has its own flow control
mechanisms for HCI commands, HCI events and HCI data.
The flow-off response time defines the maximum time from setting RTS to 0
until the byte flow actually stops.
The RS232 signals should be connected in a null-modem fashion; i.e. the local
TXD should be connected to the remote RXD and the local RTS should be con-
nected to the remote CTS and vice versa.
4 ERROR RECOVERY
See “Host Controller Interface Functional Specification” for HCI commands and
HCI events in the Bluetooth Specification v1.2 or later.
Revision 1.0
BLUETOOTH SPECIFICATION [vol 4] page 20 of 76
Secure Digital (SD) Transport Layer
CONTENTS
1 Introduction........................................................................................ 23
2 Goals................................................................................................... 24
2.1 Hardware Goals......................................................................... 24
2.2 Software Goals .......................................................................... 24
3 Physical Interface Documents.......................................................... 25
4 Communication.................................................................................. 26
4.1 Overview.................................................................................... 26
5 Appendix A - Acronyms and Abbreviations.................................... 27
6 Appendix B - Related Documents .................................................... 28
7 Appendix C - Tests............................................................................. 29
7.1 Test Suite Structure ................................................................... 29
1 INTRODUCTION
This document discusses the requirements of the Secure Digital (SD) interface
for Bluetooth hardware. Readers should be familiar with SD, SD design issues,
and the overall Bluetooth architecture. The reader should also be familiar with
the Bluetooth Host Controller Interface.
2 GOALS
The interface is not designed for embedded applications where much of the
information passed via the interface is known in advance.
The SDA also defines a Bluetooth interface for embedded applications where
the Controller contains protocol layers above HCI (RFComm, SDP etc.). This
specification is called SDIO Card Type-B Specification for Bluetooth. Informa-
tion about this specification can be obtained from the SDA (http://
www.sdcard.org).
This specification references the SD SDIO Card Type-A Specification for Blue-
tooth. This SDA document defines the Bluetooth HCI for all SD devices that
support an HCI level interface. Any SD Bluetooth device claiming compliance
with the SD Bluetooth Transport must support this interface and additionally
adhere to its device type specification, which is set by the Secure Digital Associ-
ation. The SDIO Card Type-A Specification for Bluetooth document is based on
the SDIO Card Specification, which in turn is based on the SD Memory Card
Specification: Part 1 Physical Layer Specification. All of these documents are
copyrighted by the SDA and are available ONLY to SDA member companies
that have signed the appropriate NDA documents with the SDA. As an introduc-
tion to the SD Bluetooth Type A specification, the SDA has created ‘Simplified’
versions of each of these documents. The simplified versions do not contain
enough information to fully implement a device, however they do contain
enough information to convey the structure and intent of the specifications.
4 COMMUNICATION
4.1 OVERVIEW
Figure 4.1 below is a diagram of the communication interface between a Blue-
tooth SD device and the Bluetooth host protocol stack. Modifications to this dia-
gram might be needed for operating systems that do not support a miniport
model:
SD HCI Driver
Bluetooth
SD-Compliant
Device
SD Bus Driver
SD Compliant Bus
Acronym Description
OS Operating System
SD Secure Digital
7 APPENDIX C - TESTS
The SDA has defined formal test procedures for SDIO Type A Bluetooth cards
(Controller) and Hosts. It is expected that both Controllers and Hosts will comply
with all test requirements set forth by the SDA in accordance with the rules of
the SDA. The Bluetooth SIG does not require any formal testing to comply with
SIG requirements. The test document names are listed in Appendix B.
1. Functional Tests
2. Protocol Tests
Tests of both types are defined for both the Host and Controller.
The purpose of the functional tests is to verify that the SD Bluetooth Type A
Specification, SDIO Standard and SD Physical Standard have been imple-
mented according to the specifications. These tests and the test environment for
these tests are defined in documents provided by the SDA.
The purpose of the protocol tests are to verify that the Bluetooth Controller SD
implementation or the Host implementation are according to the SD Bluetooth
Type A specification.
The test environment for the protocol tests consists of the tester and the Device
Under Test (DUT) as illustrated in Figure 7.1 below.
Tester DUT
SD Interface
The tester is typically a PC with an SD interface. The DUT is placed into local
loopback mode and standard HCI commands are used to drive the tests. The
test results are verified in the tester.
Revision 1.1
BLUETOOTH SPECIFICATION [vol 4] page 32 of 76
USB Transport Layer
CONTENTS
1 Overview............................................................................................. 35
2 USB Endpoint Expectations ............................................................. 37
2.1 Descriptor Overview .................................................................. 37
2.2 Control Endpoint Expectations .................................................. 42
2.3 Bulk Endpoints Expectations ..................................................... 42
2.4 Interrupt Endpoint Expectations ................................................ 42
2.5 Isochronous Endpoints Expectations......................................... 43
3 Class Code ......................................................................................... 44
4 Device Firmware Upgrade................................................................. 45
5 Limitations.......................................................................................... 46
5.1 Power Specific Limitations......................................................... 46
5.2 Other Limitations ....................................................................... 46
1 OVERVIEW
This document discusses the requirements of the Universal Serial Bus (USB)
interface for Bluetooth hardware. Readers should be familiar with USB, USB
design issues, Advanced Configuration Power Interface (ACPI), the overall
Bluetooth architecture, and the basics of the radio interface.
The reader should also be familiar with the Bluetooth Host Controller Interface.
Referring to Figure 1.1 below, notice that this document discusses the imple-
mentation details of the two-way arrow labelled ’USB Function’.
Baseband Controller
Other Host Drivers
LMP Firmware
RFBD (with Bluetooth HCI Library) Bluetooth HCI Bluetooth HCI Firmware
USB Device
USB Host Controller USB Cable
Controller
Figure 1.1: Relationship between the host and the Bluetooth Radio Module
This section outlines specific USB endpoints that are required in order to func-
tion properly with the host. This section assumes a basic familiarity with USB.
The endpoint numbers (labelled ’Suggested Endpoint Address’ below) may be
dynamically recognized upon driver initialization – this depends on the imple-
mentation.
An HCI frame, consisting of an HCI header and HCI data, should be contained
in one USB transaction. A USB transaction is defined as one or more USB
frames that contain the data from one IO request. For example, an ACL data
packet containing 256 bytes (both HCI header and HCI data) would be sent
over the bulk endpoint in one IO request. That IO request will require four 64-
byte USB frames, and forms a transaction.
The endpoints are spread across two interfaces so that when adjusting isochro-
nous bandwidth consumption (via select interface calls), any pending bulk and/
or interrupt transactions do not have to be terminated and resubmitted.
HCI Commands
HCI Events
ACL Data
Two voice channels with 8-bit encoding & One voice channel with 16-bit encoding
The following two examples are used to demonstrate the flow of data given the
describe endpoints.
Number of voice
channels Duration of voice data Encoding
Queued
USB data data Amount
Time (header refers to HCI header) (read / Time Received/
(ms (Receive & Send from the host) write) (ms) Air data Sent (ms)
Queued
USB data data Amount
Time (header refers to HCI header) (read / Time Received/
(ms (Receive & Send from the host) write) (ms) Air data Sent (ms)
Number of voice
channels Duration of voice data Encoding
Queued
USB data data Amount
Time (header refers to HCI header) (read Time Received /
(ms (Receive & Send from the host) / write) (ms) Air data Sent (ms)
0 Receive 0 bytes for Channel #1 C1- 0/14 0 Send 0 for C1- 0/0
Send 17 bytes (3 header, 14 data) C2- 0/0 C1 C2- 0/0
for Channel #1
Queued
USB data data Amount
Time (header refers to HCI header) (read Time Received /
(ms (Receive & Send from the host) / write) (ms) Air data Sent (ms)
1 Receive 0 bytes for Channel #1 C1- 20/31 1.25 Send 0 for C1- 2.5/0
Send 17 bytes (17 bytes HCI data) C2- 0/0 C2 C2- 0/0
for Channel #1
2 Receive 0 bytes for Channel #1 C1- 20/28 2.50 Send 20 C1- 2.5/2.5
Send 17 bytes (17 bytes HCI data) C2- 20/0 for C1 C2- 2.5/0
for Channel #1
3 Receive 0 bytes for Channel #2 C1- 40/28 3.75 Send 0 for C1- 5.0/2.5
Send 17 bytes (3 header, 14 data) C2- 20/14 C2 C2- 2.5/0
for Channel #2
4 Receive 0 bytes for Channel #2 C1- 40/28 4.375 Receive 20 C1- 5.0/2.5
Send 17 bytes (17 bytes HCI data) C2- 40/31 for C2 C2- 5.0/0
for Channel #2
5 Receive 0 bytes for Channel #2 C1- 40/8 5.0 Send 20 C1- 5.0/5.0
Send 17 bytes (17 bytes HCI data) C2- 40/48 for C1 C2- 5.0/0
for Channel #2
7 Receive 17 bytes (17 bytes data) C1- 29/19 7.5 Send 20 C1- 7.5/7.5
for Channel #1 C2- 60/28 for C1 C2- 7.5/2.5
Send 17 bytes (17 bytes HCI data)
for Channel #1
Queued
USB data data Amount
Time (header refers to HCI header) (read Time Received /
(ms (Receive & Send from the host) / write) (ms) Air data Sent (ms)
8 Receive 17 bytes (17 bytes data) C1- 32/36 8.125 Receive 20 C1- 10/7.5
for Channel #1 C2- 60/28 for C1 C2- 7.5/2.5
Send 17 bytes (17 bytes HCI data)
for Channel #1
10 Receive 17 bytes (17 bytes data) C1- 32/16 10 Send 20 C1- 10/10
for Channel #2 C2- 37/39 for C1 C2- 10/5.0
Send 17 bytes (17 bytes HCI data)
for Channel #2
11 Receive 17 bytes (17 bytes data) C1- 52/16 11.25 Send 20 C1- 12.5/10
for Channel #2 C2- 20/36 for C2 C2- 10/7.5
Send 17 bytes (17 bytes HCI data)
for Channel #2
Suggested bulk max packet size is 64 bytes. Bulk has the ability to transfer mul-
tiple 64-byte buffers per one millisecond frame, depending on available bus
bandwidth.
Bulk has the ability to detect errors and correct them. Data flowing through this
pipe might be destined for several different slaves. In order to avoid starvation,
a flow control model similar to the shared endpoint model is recommended for
the host controller.
The USB software and firmware requires no intimate knowledge of the events
passed to the host controller.
Time is the critical aspect for this type of data. The USB firmware should trans-
fer the contents of the data to the host controllers' SCO FIFOs. If the FIFOs are
full, the data should be overwritten with new data.
The radio is capable of three (3) 64Kb/s voice channels (and can receive the
data coded in different ways – 16-bit linear audio coding is the method that
requires the most data). A suggested max packet size for this endpoint would
be at least 64 bytes. (It is recommended that max packet sizes be on power of
2 boundaries for optimum throughput.) However, if it is not necessary to support
three voice channels with 16-bit coding, 32 bytes could also be considered an
acceptable max packet size.
3 CLASS CODE
A class code will be used that is specific to all USB Bluetooth devices. This will
allow the proper driver stack to load, regardless of which vendor built the device.
It also allows HCI commands to be differentiated from USB commands across
the control endpoint.
5 LIMITATIONS
Another issue with the USB host controller is that, while a device is attached, it
continually snoops memory to see if there is any work that needs to be done.
The frequency that it checks memory is 1ms. This prevents the processor from
dropping into a low power state known as C3. Because the notebook processor
is not able to enter the C3 state, significant power loss will occur. This is a real
issue for business users – as a typical business user will spend almost 90% of
their time in the C3 state.
USB provides 16-CRC on all data transfers. The USB has a bit error rate of
10-13.
Note that when a dongle is removed from the system, the radio will lose power
(assuming this is a bus-powered device). This means that devices will lose con-
nection.
Revision 0.951
1. This specification is v0.95 and though included in the Bluetooth SIG's qualification
program, the specification should not be considered finalized until interoperable pro-
totypes have been developed and the specification is adopted at the v1.0 level.
BLUETOOTH SPECIFICATION [vol 4] page 48 of 76
Three-wire UART Transport Layer
CONTENTS
1 General ............................................................................................... 51
2 Overview............................................................................................. 52
3 Slip Layer............................................................................................ 53
3.1 Encoding a Packet..................................................................... 53
3.2 Decoding a Packet .................................................................... 53
4 Packet Header .................................................................................... 55
4.1 Sequence Number..................................................................... 55
4.2 Acknowledge Number ............................................................... 56
4.3 Data Integrity Check Present..................................................... 56
4.4 Reliable Packet.......................................................................... 56
4.5 Packet Type............................................................................... 56
4.6 Payload Length.......................................................................... 57
4.7 Packet Header Checksum......................................................... 57
5 Data Integrity Check .......................................................................... 58
5.1 16 Bit CCITT-CRC ..................................................................... 58
6 Reliable Packets ................................................................................ 59
6.1 Header Checksum Error............................................................ 59
6.2 Slip Payload Length Error.......................................................... 59
6.3 Data Integrity Check Error ......................................................... 59
6.4 Out Of Sequence Packet Error.................................................. 59
6.5 Acknowledgement ..................................................................... 60
6.6 Resending Packets.................................................................... 60
6.7 Example Reliable Packet Flow .................................................. 60
7 Unreliable Packets............................................................................. 63
7.1 Unreliable Packet Header.......................................................... 63
7.2 Unreliable Packet Error ............................................................. 63
8 Link Establishment............................................................................ 64
8.1 Uninitialized State ...................................................................... 65
8.2 Initialized State .......................................................................... 65
8.3 Active State................................................................................ 65
8.4 Sync Message ........................................................................... 66
8.5 Sync Response Message.......................................................... 66
8.6 Config Message......................................................................... 67
8.7 Config Response Message ....................................................... 67
1 GENERAL
The HCI Three-Wire UART Transport Layer makes it possible to use the Blue-
tooth HCI over a serial interface between two UARTs. The HCI Three-Wire
UART Transport Layer assumes that the UART communication may have bit
errors, overrun errors or burst errors. See also “UART Transport Layer” on
page 11[vol. 4].
2 OVERVIEW
The HCI Three-Wire UART Transport Layer is a connection based protocol that
transports HCI commands, events, ACL and Synchronous packets between the
Bluetooth Host and the Bluetooth Controller. Packet construction is in done in
two steps. First, it adds a packet header onto the front of every HCI Packet
which describes the payload. Second, it frames the packets using a SLIP proto-
col. Finally, it sends this packet over the UART interface.
The SLIP layer converts an unreliable octet stream into an unreliable packet
stream. The SLIP layer places start and end octets around the packet. It then
changes all occurrences of the frame start or end octet in the packet to an
escaped version.
The packet header describes the contents of the packet, and if this packet
needs to be reliably transferred, a way of identifying the packet uniquely, allow-
ing for retransmission of erroneous packets.
Host Controller
Baseband Controller/
Host HCI Drivers
LMP Firmware
Figure 2.1: The Relationship Between the Bluetooth Host and the Bluetooth Controller
3 SLIP LAYER
The SLIP layer places packet framing octets around each packet being trans-
mitted over the Three-Wire UART Transport Layer. This delimits the packets
and allows packet boundaries to be detected if the receiver loses synchroniza-
tion. The SLIP layer is based upon the RFC 1055 Standard [1].
The SLIP layer places octet 0xC0 at the start and end of every packet it trans-
mits. Any occurrence of 0xC0 in the original packet is changed to the sequence
0xDB 0xDC before being transmitted. Any occurrence of 0xDB in the original
packet is changed to the sequence 0xDB 0xDD before being transmitted. These
sequences, 0xDB 0xDC and 0xDB 0xDD are SLIP escape sequences. All SLIP
escape sequences start with 0xDB. All SLIP escape sequences are listed in
Table 3.1.
Figure 3.1: SLIP Packets with 0xC0 at the Start and End of Each Packet
4 PACKET HEADER
Every packet that is sent over the Three-Wire UART Transport Layer has a
packet header. It also has an optional Data Integrity Check at the end of the
payload. The Transport Layer does not support packet segmentation and reas-
sembly. Each transport packet will contain at most one higher layer packet.
Each new reliable packet will be assigned a sequence number which will be
equal to the sequence number of the previous reliable packet plus one modulo
eight. A packet will use the same sequence number each time it is retransmit-
ted.
HCI packet coding does not provide the ability to differentiate the four HCI
packet types. Therefore, the Packet Type field is used to distinguish the differ-
ent packets. The acceptable values for this Packet Type field are given in Table
4.1.
Acknowledgement Packets 0
Reserve 5-13
Vendor Specific 14
HCI Command Packets, HCI ACL Data Packets and HCI Event Packets are
always sent as reliable packets. HCI Synchronous Data Packets are sent as
unreliable packets unless HCI Synchronous Flow Control is enabled, in which
case they are sent as reliable packets.
In addition to the four HCI packet types, other packet types are defined. One
packet type is defined for pure Acknowledgement Packets, and one additional
packet type is to support link control. One packet type is made available to ven-
dors for their own use. All other Three-Wire UART Packet Types are reserved
for future use.
The Data Integrity Check field is optional. It can be used to ensure that the
packet is valid. The Data Integrity Check field is appended onto the end of the
packet. Each octet of the Packet Header and Packet Payload is used to com-
pute the Data Integrity Check.
The CRC shift register is filled with 1s before calculating the CRC for each
packet. Octets are fed through the CRC generator least significant bit first.
The most significant parity octet is transmitted first (where the CRC shift regis-
ter is viewed as shifting from the least significant bit towards the most signifi-
cant bit). Therefore, the transmission order of the parity octets within the CRC
shift register is as follows:
where x[15] corresponds to the highest power CRC coefficient and x[0] corre-
sponds to the lowest power coefficient.
The switch S shall be set in position 1 while the data is shifted in. After the last
bit has entered the LFSR, the switch shall be set in position 2, and the registers
contents shall be read out for transmission.
D0 D5 D12 S
2 D16
1
Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
6 RELIABLE PACKETS
If a reliable packet is received which does not have the expected sequence
number, then the packet shall be discarded.
6.5 ACKNOWLEDGEMENT
Whenever a reliable packet is received, an acknowledgement shall be gener-
ated.
The maximum number of reliable packets that can be sent without acknowl-
edgement defines the sliding window size of the link. This is configured during
link establishment. See Sections 8.6, 8.7 and 8.8.
SEQ 6, ACK 3
SEQ 3, ACK 7
SEQ 7, ACK 4
SEQ 0, ACK 4
SEQ 4, ACK 1
SEQ 1, ACK 5
SEQ 2, ACK 5
SEQ 5, ACK 1
SEQ 1, ACK 6
SEQ 2, ACK 6
ACK 3
Device A sends two packets, Sequence Numbers 7 and 0. Both packets have
the Acknowledgement Number of 4, the next sequence number it expects from
Device B. Device B receives the first correctly, and increments its next expected
sequence number to 0. It then receives the second packet correctly, and incre-
ments the next expected sequence number to 1.
Device A now sends two more packets, Sequence Numbers 1 and 2. Unfortu-
nately, the first packet is corrupted. Device B receives the first packet, and dis-
covers the error, so discards this packet (see Section 6.1, Section 6.2 or Section
6.3). It must generate an acknowledgement of this erroneously received reliable
packet. Device B then receives the second packet. This is received out of
sequence, as it is currently expecting Sequence Number 1, but has received
Sequence Number 2 (see 6.4). Again, it must generate an acknowledgement.
Device A has not had either of its last two packets acknowledged, so it must
resend them (see 6.6). It does this, but must update the Acknowledgement
Number of the original packets that were sent (see Section 6.5). The Sequence
Numbers of these packets must stay the same (see Section 4.1).
7 UNRELIABLE PACKETS
To allow the transmission of unreliable packets through the transport, the follow-
ing method shall be used.
8 LINK ESTABLISHMENT
Before any packets except Link Control Packets can be sent, the Link Estab-
lishment procedure must be performed. This ensures that the sequence num-
bers are initialized correctly, it also ensures that the two sides are using the
same baud rate, allow detection of peer reset, and allows the device to be con-
figured.
Uninitialized
Initialized
Active
In the Uninitialized State the Controller may wait until it receives a SYNC mes-
sage before sending its first SYNC message. This allows the Host to control
when the Controller starts to send data.
The SYNC message can be used for automatic baud rate detection. It is
assumed that the Controller shall stay on a single baud rate, while the Host
could hunt for the baud rate. Upon receipt of a SYNC RESPONSE message,
the Host can assume that the correct baud rate has been detected.
1. During link establishment, various messages are sent periodically. It is suggested to send 4
messages per second.
2. Any packet that was erroneous would normally be acknowledged, as the recipient does not
know if the packet was a reliable packet or not. The recipient cannot do this in the Uninitial-
ized State, as it is possible to receive corrupt data while the Uninitialized state.
If a SYNC message is received while in the Active State, it is assumed that the
peer device has reset. The local device should therefore perform a full reset of
the upper stack, and start Link Establishment again at the Uninitialized State.
Upon entering the Active State, the first packet sent shall have its SEQ and
ACK numbers set to zero.
LSB MSB
0x01 0x7E
LSB MSB
0x02 0x7D
1. The second octet for all Link Control Packets equals the least significant 7 bits of the first
octet, inverted, with the most significant bit set to ensure even parity.
LSB MSB
LSB MSB
To allow for future extension of the Configuration Field, the size of the message
determines the number of significant Configuration Octets in the payload.
Future versions of this specification may use extra octets. Any bits that are not
included in the message shall be set to 0. Any bits that are not defined are
reserved and shall be set to 0.
A device shall not change the values if sends in the Configuration Field during
Link Establishment.
The CONFIG and CONFIG RESPONSE messages contain a set of options for
both devices on the link. The Host sends a CONFIG message with the set of
options that the Host would like to use. The Controller
responds with a CONFIG RESPONSE message with the set of options that the
Host and the Controller will use. This means that the Controller is in full control
of the set of options that will be used for all messages sent by both the Host
and Controller.
This is the maximum number of reliable packets a sender of the CONFIG mes-
sage can send without requiring an acknowledgement. The value of this field
shall be in the range one to seven. The value in the CONFIG RESPONSE mes-
sage shall be less than or equal to the value in the CONFIG message. For
example, the Host may suggest a window size of five in its CONFIG message
and the Controller may respond with a value of three in its CONFIG
RESPONSE message, but not six or seven. Both devices will then use a maxi-
mum sliding window size of three.
The CONFIG message contains a bit field describing the types of Data Integrity
Checks the sender is prepared to transmit. The peer will select the one it is pre-
pared to use and send its choice in the CONFIG RESPONSE message.
If data integrity checks are not required, then the Data Integrity Check Present
bit shall be set to 0 by the Host and Controller.
Level of Data
Integrity Parameter Description for CONFIG Message
Level of Data
Integrity Parameter Description for CONFIG RESPONSE Message
Figure 8.8: Data Integrity Check Type in the CONFIG RESPONSE Message
By default, the transport uses no flow control except that mandated by the HCI
Functional Specification and the flow control achieved by not acknowledging
reliable Host messages. If Software Flow Control is to be used, this needs to be
negotiated.
The CONFIG message specifies whether the sender of the CONFIG message
is prepared to receive Out of Frame Software Flow Control messages. The
CONFIG RESPONSE message specifies whether the peer can send Out of
Frame Software Flow Control messages. The CONFIG RESPONSE message
may have the field set to 1 only if the CONFIG message had it set to 1. (See
Section 10.1)
The Version Number of this protocol shall determine which facilities are avail-
able to be used.
The CONFIG message specifies the Version Number supported by the Host.
The CONFIG RESPONSE message specifies the Version Number that shall be
used by the Host and Controller when sent by the Controller. The value in the
CONFIG RESPONSE message shall be less than or equal to the value in the
CONFIG message. The Version Numbers are enumerated in Figure 8.9. This
specification is version 1.0 (Version Number = 0).
Version
Number Parameter Description for CONFIG and CONFIG RESPONSE Message
Figure 8.9: Version Number in the CONFIG and CONFIG RESPONSE message
9 LOW POWER
After a device is in the Active State, either side of the transport link may wish to
enter a low power state. Because recovery from a loss of synchronization is
possible, it is allowable to stop listening for incoming packets at any time.
To make the system more responsive after a device has entered a low power
state, a system of messages is employed to allow either side to notify the other
that they are entering a low power state and to wake a device from that state.
These messages are sent as Link Control Packets. It is optional for a device to
support the Sleep message. The Wakeup and Woken messages are manda-
tory.
LSB MSB
0x05 0xFA
LSB MSB
0x06 0xF9
The sending of this message is optional. The receiver of this message need not
go to sleep, but cooperating devices may be able to schedule sleeping more
effectively with this message.
LSB MSB
0x07 0x78
If Software Flow Control is disabled, then the SLIP escape sequences 0xDB
0xDE and 0xDB 0xDF are undefined. In this case, the original octets of 0x11
and 0x13 shall not be changed. Flow control should always be provided by the
tunneled protocols, e.g. HCI Flow Control. Flow control is still available using
the standard Sequence Number / Acknowledge Number. This can be done by
not acknowledging packets until traffic can resume.
11 HARDWARE CONFIGURATION
11.1 WIRES
There are three wires used by the HCI Three-Wire UART Transport. These are
Transmit, Receive, and Ground.
The transmit line from one device shall be connected to the receive line of the
other device.
11.1.2 Ground
Request to Send indicates to the remote side that the local device is able to
accept more data.
12 RECOMMENDED PARAMETERS
The maximum size of a packet in bits is either the number of bits in a 4095 octet
packet (32,760) or less if required in an embedded system or as determined by
the Host or Controller1. Thus, at a baud rate of 921,600 and the maximum
packet size of 4095 octets, Tmax is: (4095*10) / 921,600 = 44.434ms.
13 REFERENCES