hcidump

Parse Host Controler Interface data

hcidump [option [option… ]] [filter ]

Reads raw HCI data coming from and going to a Bluetooth device.
Default is the first available, and outputs commands, events and data in a human-readable form. Optionally, the dump can be written to a file rather than parsed, to be parsed in a subsequent moment.

-t,--timestamp Prepend a time stamp
-r file
--read-dump=file
Data from file created with -w
-i hciX read from hciX. Default: first available.
-l len
--snap-len=len
max length of processed packets
-p psm
--psm=psm
default Protocol Service Multiplexer
-m compid
--manufacturer=compid
default company id for manufacturer
-w file
--save-dump=file
data is saved in file file.
subsequently parsed with -r.

The file can be opened in Wireshark for full decoding

-a
--ascii
 
-x
--hex
 
-X
--ext
hex and ASCII.
 sudo hcidump -t -X
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
2017-10-23 16:56:12.682372 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2017-10-23 16:56:22.426958 > HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 60:FB:42:83:72:48 mode 1 clkoffset 0x1d00 class 0x38010c rssi -79
    Complete local name: 'smackerpro'
    Complete service classes: 0x1101 0x1117 0x1200
    Unknown type 0xff with 16 bytes data
2017-10-23 16:56:30.604903 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
2017-10-23 16:56:37.884463 > HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 60:FB:42:83:72:48 mode 1 clkoffset 0x1cfa class 0x38010c rssi -84
    Complete local name: 'smackerpro'
    Complete service classes: 0x1101 0x1117 0x1200
    Unknown type 0xff with 16 bytes data
2017-10-23 16:56:44.687380 > HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
-R
--raw
only the raw data is displayed.
-C
--cmtp=psm
for the CAPI Message Transport Protocol.
-H
--hcrp=psm
for the Hardcopy Control Channel.
-O
--obex=channel
Sets RFCOMM channel value for the Object Exchange Protocol.
-P
--ppp=channel
Sets RFCOMM channel value for the Point-to-Point Protocol.
-D
--pppdump=
Extract PPP traffic with pppdump format.
-A
--audio=file
Extract SCO audio data.
-Y
--novendor
Don't display any vendor commands, events
any pin code or link key in plain text.
-h

FILTERS

filter is a space-separated list of packet categories:
lmp hci sco l2cap rfcomm sdp bnep cmtp hidp hcrp avdtp avctp obex capi and ppp.

lmp,(01) hci(02), sco(04), l2cap(08), rfcomm(10), sdp(20), bnep(40), cmtp(80), hidp(100), hcrp(200), avdtp(400), avctp(800), obex(1000), capi(2000) and ppp(4000).

Protocol and Service Multiplexers (PSMs)
Protocol PSM Reference
SDP 01 Bluetooth Service Discovery Protocol (SDP)
RFCOMM 03 RFCOMM with TS 07.10
TCS-BIN 05 Bluetooth Telephony Control Specification / TCS Binary
TCS-BIN-CORDLESS 07 Bluetooth Telephony Control Specification / TCS Binary
BNEP 0F Bluetooth Network Encapsulation Protocol
HID_Control 11 Human Interface Device
HID_Interrupt 13 Human Interface Device
UPnP 15 [ESDP]
AVCTP 17 Audio/Video Control Transport Protocol
AVDTP 19 Audio/Video Distribution Transport Protocol
AVCTP_Browsing 1B Audio/Video Remote Control Profile
UDI_C-Plane 1D the Unrestricted Digital Information Profile [UDI]
ATT 1F Bluetooth Core Specification
3DSP 21 3D Synchronization Profile.
LE_PSM_IPSP 23 Internet Protocol Support Profile (IPSP)
OTS 25 Object Transfer Service (OTS)