DESERT 3.5.1
Loading...
Searching...
No Matches
packer_uwRangingTDOA Class Reference

#include <packer-uwranging-tdoa.h>

Inheritance diagram for packer_uwRangingTDOA:
Collaboration diagram for packer_uwRangingTDOA:

Public Member Functions

 packer_uwRangingTDOA ()
 
virtual ~packer_uwRangingTDOA ()=default
 
- Public Member Functions inherited from packer
 packer (bool)
 
 ~packer ()
 
int command (int, const char *const *)
 
size_t getPayloadBytesLength ()
 
size_t getHdrBytesLength ()
 
size_t getPayloadBinLength ()
 
size_t getHdrBinLength ()
 
std::string packPayload (Packet *)
 
std::string packHdr (Packet *)
 
Packet * unpackPayload (Packet *)
 
Packet * unpackHdr (Packet *)
 
void printMap ()
 

Private Types

enum  nbits_index { SOURCE_PKT_ID_FIELD = 0 , SOURCE_NODE_ID_FIELD , TIMES_SIZE_FIELD , LAST_ELEM }
 

Private Member Functions

virtual void init () override
 
virtual size_t packMyHdr (Packet *p, unsigned char *buffer, size_t offset) override
 
virtual size_t unpackMyHdr (unsigned char *buffer, size_t offset, Packet *p) override
 
virtual void printMyHdrMap () override
 
virtual void printMyHdrFields (Packet *) override
 

Private Attributes

size_t source_pkt_id_Bits
 
size_t source_node_id_Bits
 
size_t times_size_Bits
 

Additional Inherited Members

- Static Public Member Functions inherited from packer
template<typename T >
static T restoreSignedValue (T _header_field, const uint32_t &_num_compressed_bits)
 
static std::string hexdump_nice (std::string)
 
static std::string hexdump_nice (const char *, size_t)
 
static std::string hexdump (std::string)
 
static std::string hex_bytes (float)
 
static std::string hex_bytes (double)
 
static std::string hex_bytes (const char &, const uint32_t &)
 
static std::string hex_bytes (const int8_t &, const uint32_t &)
 
static std::string hex_bytes (const int16_t &, const uint32_t &)
 
static std::string hex_bytes (const int32_t &, const uint32_t &)
 
static std::string hex_bytes (const int64_t &, const uint32_t &)
 
static std::string hex_bytes (const uint8_t &, const uint32_t &)
 
static std::string hex_bytes (const uint16_t &, const uint32_t &)
 
static std::string hex_bytes (const uint32_t &, const uint32_t &)
 
static std::string hex_bytes (const uint64_t &, const uint32_t &)
 
static std::string hexdump (const char *, size_t)
 
static std::string bindump (std::string)
 
static std::string bindump (const char *, size_t)
 
- Protected Member Functions inherited from packer
virtual void printMyHdrField (Packet *, int)
 
size_t getMyHdrBinLength ()
 
size_t get (unsigned char *buffer, size_t offset, void *val, size_t h)
 
size_t put (unsigned char *buffer, size_t offset, void *val, size_t h)
 
- Protected Attributes inherited from packer
std::vector< size_t > n_bits
 
int debug_
 

Detailed Description

Class to map a ns2 uwRangingTDOA header into a bit stream, and vice-versa.

Definition at line 45 of file packer-uwranging-tdoa.h.

Member Enumeration Documentation

◆ nbits_index

Index bits.

Enumerator
SOURCE_PKT_ID_FIELD 

ID of the ranging packet.

SOURCE_NODE_ID_FIELD 

ID of the node.

TIMES_SIZE_FIELD 

Size of the payload.

LAST_ELEM 

Definition at line 105 of file packer-uwranging-tdoa.h.

Constructor & Destructor Documentation

◆ packer_uwRangingTDOA()

packer_uwRangingTDOA::packer_uwRangingTDOA ( )

Constructor packer_uwRangingTDOA class.

Definition at line 57 of file packer-uwranging-tdoa.cc.

◆ ~packer_uwRangingTDOA()

virtual packer_uwRangingTDOA::~packer_uwRangingTDOA ( )
virtualdefault

Destructor packer_uwRangingTDOA class.

Member Function Documentation

◆ init()

void packer_uwRangingTDOA::init ( )
overrideprivatevirtual

Init the packer for uwRangingTDOA prototocol.

Reimplemented from packer.

Definition at line 71 of file packer-uwranging-tdoa.cc.

◆ packMyHdr()

size_t packer_uwRangingTDOA::packMyHdr ( Packet *  p,
unsigned char *  buffer,
size_t  offset 
)
overrideprivatevirtual

Method to transform the headers of uwRangingTDOA protocol into a stream of bits.

Parameters
Pointerto the packet to serialize
Pointerto the buffer
Offsetfrom the begin of the buffer
Returns
size_t New offset after packing the headers of the packets

Reimplemented from packer.

Definition at line 86 of file packer-uwranging-tdoa.cc.

◆ printMyHdrFields()

void packer_uwRangingTDOA::printMyHdrFields ( Packet *  p)
overrideprivatevirtual

Method used for debug purposes.

It prints the value of the headers of a packet

Parameters
Pointerof the packet

Reimplemented from packer.

Definition at line 170 of file packer-uwranging-tdoa.cc.

◆ printMyHdrMap()

void packer_uwRangingTDOA::printMyHdrMap ( )
overrideprivatevirtual

Method used for debug purposes.

It prints the number of bits for each header serialized

Reimplemented from packer.

Definition at line 156 of file packer-uwranging-tdoa.cc.

◆ unpackMyHdr()

size_t packer_uwRangingTDOA::unpackMyHdr ( unsigned char *  buffer,
size_t  offset,
Packet *  p 
)
overrideprivatevirtual

Method responsible to take the informations from the received buffer and store it into the headers of the packet.

Parameters
Pointerto the buffer received
Offsetfrom the begin of the buffer
Pointerto the new packet
Returns
size_t New offset after unpacking the headers

Reimplemented from packer.

Definition at line 120 of file packer-uwranging-tdoa.cc.

Member Data Documentation

◆ source_node_id_Bits

size_t packer_uwRangingTDOA::source_node_id_Bits
private

Bit length of the source_node_id to be put in the header stream of bits.

Definition at line 113 of file packer-uwranging-tdoa.h.

◆ source_pkt_id_Bits

size_t packer_uwRangingTDOA::source_pkt_id_Bits
private

Bit length of the source_pkt_id field to be put in the header stream of bits.

Definition at line 112 of file packer-uwranging-tdoa.h.

◆ times_size_Bits

size_t packer_uwRangingTDOA::times_size_Bits
private

Bit length of the times_size_field to be put in the header stream of bits.

Definition at line 114 of file packer-uwranging-tdoa.h.


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