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

#include <btsnooptask.h>

Public Member Functions

 BtSnoopTask ()
 build decoding task More...
 
 BtSnoopTask (std::string file_path)
 build decoding task with btsnoop file input More...
 
 BtSnoopTask (std::string file_path, std::vector< IBtSnoopListener * > *snoopListenerList)
 build decoding task with btsnoop file input & packet listener list More...
 
 ~BtSnoopTask ()
 exit control loop More...
 
void * decoding_task (void)
 decoding thread task More...
 
int decode_streaming_file (std::ifstream *fileStream, int current_position)
 decode full snoop file header / packet record data More...
 
bool decode_file ()
 decode full snoop file header / packet record data More...
 
void stop ()
 stop decoding : exit control loop More...
 
BtSnoopFileInfo getFileInfo ()
 get file information header object More...
 
std::vector< BtSnoopPacketgetPacketDataRecords ()
 get list of decoded packet More...
 

Static Public Member Functions

static void * decoding_helper (void *context)
 

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.

Constructor & Destructor Documentation

BtSnoopTask::BtSnoopTask ( )

build decoding task

BtSnoopTask::BtSnoopTask.

BtSnoopTask::BtSnoopTask ( std::string  file_path)

build decoding task with btsnoop file input

BtSnoopTask::BtSnoopTask.

Parameters
file_pathbtsnoop file path
BtSnoopTask::BtSnoopTask ( std::string  file_path,
std::vector< IBtSnoopListener * > *  snoopListenerList 
)

build decoding task with btsnoop file input & packet listener list

build a BtSnoopTask object with file path and a list of listener (for standalone streaming task)

Parameters
file_pathbtsnoop file path
snoopListenerListlist of listeners to be notified when a packet is decoded
file_pathsnoop file path
snoopListenerListlist of listeners
BtSnoopTask::~BtSnoopTask ( )

exit control loop

Member Function Documentation

bool BtSnoopTask::decode_file ( )

decode full snoop file header / packet record data

Returns
success status
int BtSnoopTask::decode_streaming_file ( std::ifstream *  fileStream,
int  current_position 
)

decode full snoop file header / packet record data

Parameters
fileStreamfile
current_positioncurrent position of file (initial is 0 / cant be -1)
Returns
new position of file (to match with incoming changes)
static void* BtSnoopTask::decoding_helper ( void *  context)
inlinestatic
void * BtSnoopTask::decoding_task ( void  )

decoding thread task

streaming decoding / monitoring snoop file for changes

Returns
BtSnoopFileInfo BtSnoopTask::getFileInfo ( )

get file information header object

Returns
file information
std::vector< BtSnoopPacket > BtSnoopTask::getPacketDataRecords ( )

get list of decoded packet

Returns
list of btsnoop decoded packets
void BtSnoopTask::stop ( )

stop decoding : exit control loop


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