btsnoop-decoder  1.0
Small library to decode Bluetooth Snoop file used to store radio packet records
BtSnoopPacket Class Reference

#include <btsnooppacket.h>

Public Member Functions

 BtSnoopPacket ()
 
 BtSnoopPacket (char *data)
 build snoop packet More...
 
 ~BtSnoopPacket ()
 
void decode_data (char *data)
 decode packet data field More...
 
int getOriginalLength ()
 get length of original packet (could be more than this packet's length) More...
 
int getincludedLength ()
 get packet data field length More...
 
int getCumulativeDrops ()
 get number of packet lost between the first record and this record for this file More...
 
uint64_t getUnixTimestampMicroseconds ()
 get unix timestamp for this packet record More...
 
bool is_packet_sent ()
 define if packet record is sent More...
 
bool is_packet_received ()
 define if packet record is received More...
 
bool is_data ()
 define if packet record is data record More...
 
bool is_command_event ()
 define if packet record is command or event More...
 
std::vector< char > getPacketData ()
 retrieve packet data More...
 
void printInfo ()
 print info in debug mode More...
 
std::string toJson (bool beautify)
 convert packet to json More...
 

Detailed Description

The MIT License (MIT)

Copyright (c) 2015 Bertrand Martel

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. btsnooppacket.h

Parse bt snoop packet record

Author
Bertrand Martel
Version
0.1

Constructor & Destructor Documentation

BtSnoopPacket::BtSnoopPacket ( )
BtSnoopPacket::BtSnoopPacket ( char *  data)

build snoop packet

Parameters
datadata of size 24 (4 + 4 + 4 + 4 + 8)
BtSnoopPacket::~BtSnoopPacket ( )

Member Function Documentation

void BtSnoopPacket::decode_data ( char *  data)

decode packet data field

Parameters
data
int BtSnoopPacket::getCumulativeDrops ( )

get number of packet lost between the first record and this record for this file

Returns
int BtSnoopPacket::getincludedLength ( )

get packet data field length

Returns
int BtSnoopPacket::getOriginalLength ( )

get length of original packet (could be more than this packet's length)

Returns
std::vector< char > BtSnoopPacket::getPacketData ( )

retrieve packet data

Returns
uint64_t BtSnoopPacket::getUnixTimestampMicroseconds ( )

get unix timestamp for this packet record

Returns
bool BtSnoopPacket::is_command_event ( )

define if packet record is command or event

Returns
bool BtSnoopPacket::is_data ( )

define if packet record is data record

Returns
bool BtSnoopPacket::is_packet_received ( )

define if packet record is received

Returns
bool BtSnoopPacket::is_packet_sent ( )

define if packet record is sent

Returns
void BtSnoopPacket::printInfo ( )

print info in debug mode

std::string BtSnoopPacket::toJson ( bool  beautify)

convert packet to json

convert packet class to json

Parameters
beautifybeautify/uglify json

The documentation for this class was generated from the following files: