Communication Library for Autonomous Systems v1.0
Reliable and secure communication library for autonomous vehicle systems
Loading...
Searching...
No Matches
RSU Class Reference

#include <rsu.h>

Public Types

typedef Network::Communicator Communicator
 
typedef Network::Protocol Protocol
 
typedef Protocol::Address Address
 
typedef Network::Message Message
 
typedef Message::Unit Unit
 

Public Member Functions

 RSU (unsigned int rsu_id, Unit unit, std::chrono::milliseconds period, double x=0.0, double y=0.0, double radius=400.0, const void *data=nullptr, unsigned int data_size=0)
 Construct a new RSU object.
 
 ~RSU ()
 Destroy the RSU object.
 
void start ()
 Start the RSU broadcasting.
 
void stop ()
 Stop the RSU broadcasting.
 
bool running () const
 Check if the RSU is running.
 
const Addressaddress () const
 Get the RSU's network address.
 
Unit unit () const
 Get the unit type being broadcast.
 
std::chrono::milliseconds period () const
 Get the broadcasting period.
 
void adjust_period (std::chrono::milliseconds new_period)
 Adjust the broadcasting period.
 
void broadcast ()
 Send a single broadcast message (called by periodic thread)
 
void initialize_neighbor_rsus ()
 Initialize neighbor RSUs directly in Protocol structure In a real system, this would be loaded from configuration.
 

Member Typedef Documentation

◆ Address

◆ Communicator

◆ Message

◆ Protocol

◆ Unit

Constructor & Destructor Documentation

◆ RSU()

RSU::RSU ( unsigned int  rsu_id,
Unit  unit,
std::chrono::milliseconds  period,
double  x = 0.0,
double  y = 0.0,
double  radius = 400.0,
const void data = nullptr,
unsigned int  data_size = 0 
)
inline

Construct a new RSU object.

Parameters
rsu_idUnique identifier for this RSU (used for MAC address generation)
unitThe unit type that this RSU will broadcast
periodThe broadcasting period in milliseconds
dataOptional data payload for the RESPONSE message
data_sizeSize of the data payload

◆ ~RSU()

RSU::~RSU ( )
inline

Destroy the RSU object.

Member Function Documentation

◆ address()

const RSU::Address & RSU::address ( ) const
inline

Get the RSU's network address.

Returns
const Address& RSU's address

◆ adjust_period()

void RSU::adjust_period ( std::chrono::milliseconds  new_period)
inline

Adjust the broadcasting period.

Parameters
new_periodNew period in milliseconds

◆ broadcast()

void RSU::broadcast ( )
inline

Send a single broadcast message (called by periodic thread)

◆ initialize_neighbor_rsus()

void RSU::initialize_neighbor_rsus ( )
inline

Initialize neighbor RSUs directly in Protocol structure In a real system, this would be loaded from configuration.

◆ period()

std::chrono::milliseconds RSU::period ( ) const
inline

Get the broadcasting period.

Returns
std::chrono::milliseconds The current period

◆ running()

bool RSU::running ( ) const
inline

Check if the RSU is running.

Returns
bool True if running, false otherwise

◆ start()

void RSU::start ( )
inline

Start the RSU broadcasting.

◆ stop()

void RSU::stop ( )
inline

Stop the RSU broadcasting.

◆ unit()

RSU::Unit RSU::unit ( ) const
inline

Get the unit type being broadcast.

Returns
Unit The unit type

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