Public Member Functions | Static Public Attributes | Private Attributes | List of all members
pcapReader::PcapDevice Class Reference

Class for handling a pcap file. More...

#include <pcap_reader.hpp>

Public Member Functions

bool connect (const char *device)
 Try to open a pcap file. More...
 
void disconnect ()
 Close connected file. More...
 
bool isConnected () const
 Check if file is open and healthy. More...
 
 PcapDevice (ROSaicNodeBase *node, buffer_t &buffer)
 Constructor for PcapDevice. More...
 
ReadResult read ()
 Attempt to read a packet and store data to buffer. More...
 
 ~PcapDevice ()
 Destructor for PcapDevice. More...
 

Static Public Attributes

static const size_t BUFFSIZE = 100
 

Private Attributes

buffer_tm_dataBuff
 Reference to raw data buffer to write to. More...
 
pcap_t * m_device {nullptr}
 File handle to pcap file. More...
 
char * m_deviceName
 
char m_errBuff [BUFFSIZE] {}
 
buffer_t m_lastPkt
 
bpf_program m_pktFilter {}
 
ROSaicNodeBasenode_
 Pointer to the node. More...
 

Detailed Description

Class for handling a pcap file.

Definition at line 69 of file pcap_reader.hpp.

Constructor & Destructor Documentation

◆ PcapDevice()

pcapReader::PcapDevice::PcapDevice ( ROSaicNodeBase node,
buffer_t buffer 
)
explicit

Constructor for PcapDevice.

Parameters
[out]bufferBuffer to write read raw data to

Definition at line 53 of file pcap_reader.cpp.

◆ ~PcapDevice()

pcapReader::PcapDevice::~PcapDevice ( )

Destructor for PcapDevice.

Definition at line 58 of file pcap_reader.cpp.

Member Function Documentation

◆ connect()

bool pcapReader::PcapDevice::connect ( const char *  device)

Try to open a pcap file.

Parameters
[in]devicePath to pcap file
Returns
True if success, false otherwise

Definition at line 60 of file pcap_reader.cpp.

◆ disconnect()

void pcapReader::PcapDevice::disconnect ( )

Close connected file.

Definition at line 78 of file pcap_reader.cpp.

◆ isConnected()

bool pcapReader::PcapDevice::isConnected ( ) const

Check if file is open and healthy.

Returns
True if file is open, false otherwise

Definition at line 88 of file pcap_reader.cpp.

◆ read()

ReadResult pcapReader::PcapDevice::read ( )

Attempt to read a packet and store data to buffer.

Returns
Result of read operation

Definition at line 90 of file pcap_reader.cpp.

Member Data Documentation

◆ BUFFSIZE

const size_t pcapReader::PcapDevice::BUFFSIZE = 100
static

Definition at line 72 of file pcap_reader.hpp.

◆ m_dataBuff

buffer_t& pcapReader::PcapDevice::m_dataBuff
private

Reference to raw data buffer to write to.

Definition at line 111 of file pcap_reader.hpp.

◆ m_device

pcap_t* pcapReader::PcapDevice::m_device {nullptr}
private

File handle to pcap file.

Definition at line 113 of file pcap_reader.hpp.

◆ m_deviceName

char* pcapReader::PcapDevice::m_deviceName
private

Definition at line 116 of file pcap_reader.hpp.

◆ m_errBuff

char pcapReader::PcapDevice::m_errBuff[BUFFSIZE] {}
private

Definition at line 115 of file pcap_reader.hpp.

◆ m_lastPkt

buffer_t pcapReader::PcapDevice::m_lastPkt
private

Definition at line 117 of file pcap_reader.hpp.

◆ m_pktFilter

bpf_program pcapReader::PcapDevice::m_pktFilter {}
private

Definition at line 114 of file pcap_reader.hpp.

◆ node_

ROSaicNodeBase* pcapReader::PcapDevice::node_
private

Pointer to the node.

Definition at line 109 of file pcap_reader.hpp.


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


septentrio_gnss_driver
Author(s): Tibor Dome
autogenerated on Sat Mar 11 2023 03:12:56