F. Examples of different HCI packets

Figure F.1: Bluetooth communication between device A and device B

INQUIRY

Device A

Command: 0104 05 338B9E 06 00

Inquiry:

LAP: 0x9E8B33, Inquiry Length: 0x06

Num Response: 0x00

---------------------------------------------------------------------------------------

Event: 0F 04 00 01 0104

Command Status ->

Status: Command currently in pending

Num HCI Command Packets: 1

Command OpCode: Inquiry

Event: 02 0F 01 111111111111 01 00 00 000000 DE7D

Inquiry Result ->

Num Response: 1

BD_ADDR: 0x111111111111

Page Scan Repetition Mode: R1

Page Scan Period Mode: P0

Page Scan Mode: Mandatory Page Scan Mode

Class of Device: 0x000000

Clock Offset: 0x7DDE

Event: 02 0F 01 5C270F378000 01 00 00 040260 EC1A

Inquiry Result ->

Num Response: 1

BD_ADDR: 0x0080370F275C

Page Scan Repetition Mode: R1

Page Scan Period Mode: P0

Page Scan Mode: Mandatory Page Scan Mode

Class of Device: 0x600204

Clock Offset: 0x1AEC

 

Event: 01 02 00 02

Inquiry Complete ->

Status: Command Succeeded

Num Response: 2

---------------------------------------------------------------------------------------

Description device A makes an inquiry and get two answers. The OpCode for the inquiry command is 0104 in little Endian. The parameter total length is 05 and then there follows 3 parameters. See [1] for more detail

This command generates 4 events: one command status, two inquiry results (as there are two devices found) and one inquiry complete event.

 

ACL_CONNECTION

Device A

Command: 0504 0D 111111111111 0800 01 00 0000 00

Create Connection:

BD_ADDR: 0x111111111111,

Packet Type: DM1,

Page Scan Repetition Mode: 0x01,

Page Scan Mode: 0x00, Clock Offset: 0x0000, Allow Role Switch: 0x00

-----------------------------------------------------------------------------------

Device A

Event: 0F 04 00 01 0504

Command Status ->

Status: Command currently in pending

Num HCI Command Packets: 1

Command OpCode: Create Connection

Event: 03 0B 00 0100 111111111111 01 00

Connection Complete ->

Status: Command Succeeded

Connection Handle: 0x0001

BD_ADDR: 0x111111111111

Link Type: ACL Link (Data Channel)

Encryption Mode: Disabled

-----------------------------------------------------------------------------------

Device B

Event: 03 0B 00 0100 222222222222 01 00

Connection Complete ->

Status: Command Succeeded

Connection Handle: 0x0001

BD_ADDR: 0x222222222222

Link Type: ACL Link (Data Channel)

Encryption Mode: Disabled

-----------------------------------------------------------------------------------

Device A makes a ACL-connection to Device B. The OpCode for ACL-connection is 0504 in little Endian. The parameter total length is 0D and there are 5 parameters for this command, for example the address parameter is 111111111111 etc.

The events received by both device A and device B follow the event packet. For example the first event received by device A is a command status event with the code 0F then the length which is 04 and then the two parameters for this event. See [1] for more detail

DATA_PACKET_SEND (FIRST PACKAGE PRINCIPLE)

Device A

Command: 0120 0A00 0600 0000 AAAAAAAAAAAA

Send Custom HCI Packet: 012007000300000041540D

Length: 0x0E

------------------------------------------------------------------------------------------

Device A

Number of completed packets Event

Event: 04 13 05 01 0100 0500

------------------------------------------------------------------------------------------

Device B

0xAAAAAAAAAAAA

------------------------------------------------------------------------------------------

Device A wants to send the data AAAAAAAAAAAA to device B. See [1] for more detail.

DATA_PACKET_SEND (FRAGMENT PACKAGE PRINCIPLE)

Device A

Command: 02 0120 0800 0600 0000 22222222

Send Custom HCI Packet: (Only for testing...)

HCI Packet: 012008000600000022222222

Length: 0x0C

Command: 02 0110 0200 2222

Send Custom HCI Packet: 011002002222

Length: 0x06

------------------------------------------------------------------------------------------

Device B

0x222222222222

------------------------------------------------------------------------------------------

Device A wants to send the data 222222222222 to device B. See [1] for more detail.