LINKTYPE_BLUETOOTH_LINUX_MONITOR

Packet structure

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

Description

All fields are in big-endian byte order.

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 Volume 4, Part E "Host Controller Interface Functional Specification" of the Bluetooth Core specification, of the packet type indicated by the opcode field. value.