Crate btsnoop

Source
Expand description

A parser for the BTSnoop file format, which is a bluetooth HCI logs format similar to the snoop format, as documented in RFC 1761. Reference: https://fte.com/webhelpii/bpa600/Content/Technical_Information/BT_Snoop_File_Format.htm

Notably this is used in Android and can be captured from your device following instructions from Verifying and Debugging Bluetooth on source.android.com.

§Example

use btsnoop::parse_btsnoop_file;

let btsnoop_bytes: &[u8] = include_bytes!("testdata/btsnoop_hci.log");
let file: btsnoop::File = parse_btsnoop_file(btsnoop_bytes).unwrap();
for packet in file.packets {
    println!("Packet={:x?}", packet.packet_data);
}

Structs§

File
Represents the entire btsnoop file. This includes one fixed-size file header followed by an arbitrary number of Packets.
FileHeader
The file header contains general metadata about the packet file and format of the packets it contains.
Packet
A packet record in the logs.
PacketFlags
The packet flags field.
PacketHeader
Header fields for a packet record.

Enums§

CommandFlag
The packet type, whether it contains data or commands.
DatalinkType
The type of datalink header used in the packet records that follow.
DirectionFlag
Direction of data transfer.
Error
Error type returned in parse_btsnoop_file if parsing failed.

Functions§

parse_btsnoop_file
Parses a given btsnoop file.