LINKTYPE_BLUETOOTH_LINUX_MONITOR

Packet structure

+---------------------------+
|         Adapter ID        |
|         (2 Octets)        |
+---------------------------+
|           Opcode          |
|         (2 Octets)        |
+---------------------------+
|           Payload         |
.                           .
.                           .
.                           .

Description

All fields are in network byte order (big-endian).

The adapter ID field identifies the interface to which the packet applies. On single-interface systems, this will typically be 0.

The opcode field describes the type of packet. Its value is:

  • 0x00 - New Index Event;
  • 0x01 - Delete Index Event;
  • 0x02 - HCI Command Packet;
  • 0x03 - HCI Event Packet;
  • 0x04 - transmitted HCI ACL Data Packet;
  • 0x05 - received HCI ACL Data Packet;
  • 0x06 - transmitted HCI Synchronous Data Packet;
  • 0x07 - received HCI Synchronous Data Packet.

New Index Event

A New Index Event is a message that indicates the appearance of a new interface, with the adapter ID field giving the ID of the new interface. Its payload has the following format:

+---------------------------+
|            Bus            |
|         (1 Octet)         |
+---------------------------+
|           Type            |
|         (1 Octet)         |
+---------------------------+
|          BD_ADDR          |
|         (6 Octets)        |
+---------------------------+
|            Name           |
|         (8 Octets)        |
+---------------------------+

The bus field specifies the type of controller:

  • 0x00 - BR/EDR;
  • 0x01 - AMP.

The type field specifies the transport type of the controller:

  • 0x00 - Virtual;
  • 0x01 - USB;
  • 0x02 - PC Card;
  • 0x03 - UART;
  • 0x04 - RS-232;
  • 0x05 - PCI;
  • 0x06 - SDIO.

The BD_ADDR field contains the MAC address of the interface.

The name contains the name of the interface (typically hciN, for example: hci0).

Delete Index Event

A Delete Index Event is a message that indicates the disappearance of an existing interface, with the adapter ID field giving the ID of the interface that disappeared. It has no payload.

HCI packets

The remaining types are HCI packets as specified by the Host Controller Interface Functional Specification portion of the most recent Bluetooth Core Specification:

The payload of an HCI Command Packet is as specified by the "HCI Command Packet" section of that document.

The payload of an HCI ACL Data Packet is as specified by the "HCI ACL Data Packets" section of that document.

The payload of an HCI Command Packet is as specified by the "HCI Synchronous Data Packets" section of that document.

The payload of an HCI Command Packet is as specified by the "HCI Event Packet" section of that document.