Public Member Functions | Public Attributes | Static Public Attributes
Beacon Class Reference

#include <Beacon.h>

List of all members.

Public Member Functions

 Beacon (unsigned char *source, std::string hostname)
 Beacon (unsigned char *buffer)
int GetCrc32 (const std::string &my_string)
std::string getFrameAsNetworkString ()
virtual ~Beacon ()

Public Attributes

bool correct_crc_
 Indicates whether CRC of received beacon is correct.
struct ethhdr * eh_
 Defines layer 2 Ethernet header.
std::string hostname_
 Stores host name of the beacon sender.
unsigned char mac_source_ [6]
 The mac address of the source robot that emits the Beacon.

Static Public Attributes

static uint32_t HEADER_FIXED_LEN = 23
 The lenght of the beacon header (23 bytes)

Detailed Description

Beacons are transmitted periodically to enable robot detection. They allow to

Definition at line 16 of file Beacon.h.


Constructor & Destructor Documentation

Beacon::Beacon ( unsigned char *  source,
std::string  hostname 
)

Constructs the Beacon on the sender side.

Parameters:
sourceThe mac address of the source robot that emits the Beacon
hostnameThe hostname of the source robot that emits the Beacon

Definition at line 22 of file Beacon.cpp.

Beacon::Beacon ( unsigned char *  buffer)

Constructs the Beacon on the receiver side.

Parameters:
bufferThe received network buffer

Definition at line 30 of file Beacon.cpp.

Beacon::~Beacon ( ) [virtual]

Definition at line 68 of file Beacon.cpp.


Member Function Documentation

int Beacon::GetCrc32 ( const std::string &  my_string)

Calculates the Crc32 of a Beacon Is needed to detect corrupt beacons caused by transmission errors.

Returns:
the Crc32 checksum of a Beacon.

Definition at line 120 of file Beacon.cpp.

Returns a Beacon as a C++ string. Converts the beacon into a C++ string to be written to the socket.

Returns:
Bacon as C++ string.

Definition at line 73 of file Beacon.cpp.


Member Data Documentation

Indicates whether CRC of received beacon is correct.

Definition at line 46 of file Beacon.h.

struct ethhdr* Beacon::eh_

Defines layer 2 Ethernet header.

Definition at line 48 of file Beacon.h.

uint32_t Beacon::HEADER_FIXED_LEN = 23 [static]

The lenght of the beacon header (23 bytes)

Definition at line 51 of file Beacon.h.

std::string Beacon::hostname_

Stores host name of the beacon sender.

Definition at line 49 of file Beacon.h.

unsigned char Beacon::mac_source_[6]

The mac address of the source robot that emits the Beacon.

Definition at line 47 of file Beacon.h.


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


adhoc_communication
Author(s): Guenter Cwioro , Torsten Andre
autogenerated on Thu Aug 27 2015 11:56:40