Vanetza
Loading...
Searching...
No Matches
dcc_information_sharing.hpp
1
#
ifndef
DCC_INFORMATION_SHARING_HPP_GZCSHZLD
2
#
define
DCC_INFORMATION_SHARING_HPP_GZCSHZLD
3
4
#
include
<
vanetza
/
common
/
clock
.
hpp
>
5
#
include
<
vanetza
/
common
/
hook
.
hpp
>
6
#
include
<
vanetza
/
common
/
unit_interval
.
hpp
>
7
#
include
<
vanetza
/
geonet
/
cbr_aggregator
.
hpp
>
8
#
include
<
vanetza
/
geonet
/
dcc_field_generator
.
hpp
>
9
10
namespace
vanetza
11
{
12
13
class
Runtime
;
14
15
namespace
geonet
16
{
17
18
class
LocationTable
;
19
20
/**
21
* DccInformationSharing realises the DCC_net behaviour for ITS-G5
22
* \see TS 102 636-4-2 V1.1.1
23
*
24
* CBR_target mentioned in TS 102 636-4-2 V1.1.1 is probably the same constant as
25
* NDL_maxChannelUse mentioned in TS 102 687 V1.1.1. However, no value is given:
26
* Table A.3 in TS 102 687 declares them (implicitly through NDL_tmPacketArrivalrate) "n.a.".
27
* Thus, we simply assume CBR_target = NDL_maxChannelUse = NDL_maxChannelLoad.
28
*/
29
class
DccInformationSharing
:
public
DccFieldGenerator
30
{
31
public
:
32
/**
33
* Create DCC_net instance
34
*
35
* \param rt Runtime for scheduling periodic update cycles
36
* \param lt Location Table with LocTEX_G5 entries
37
* \param target CBR_target value (usually NDL_maxChannelLoad)
38
* \param delay Delaying first update cycle randomly
39
*
40
* \note Set random delay interval when multiple stations are created at the same time!
41
* Values shall be distributed uniformly across full integer range.
42
*/
43
DccInformationSharing
(
Runtime
& rt,
const
LocationTable
& lt, dcc::
ChannelLoad
target,
UnitInterval
delay);
44
DccInformationSharing(
Runtime
& rt,
const
LocationTable
& lt, dcc::
ChannelLoad
target);
45
46
DccField generate_dcc_field()
override
;
47
48
/**
49
* Update local CBR measurement
50
*
51
* Local measurement rate is decoupled from processing in DCC_net,
52
* i.e. DccInformationSharing buffers the given value and the latest
53
* measurement value when its internal update cycle runs.
54
*
55
* \param cbr local CBR measurement
56
*/
57
void
update_local_cbr
(dcc::
ChannelLoad
cbr);
58
59
/**
60
* Set packet TX power
61
*
62
* \param power Packet transmission output power in dBm
63
*/
64
void
set_tx_power
(
unsigned
power);
65
66
private
:
67
void
trigger();
68
69
Runtime
& m_runtime;
70
const
LocationTable
& m_location_table;
71
const
dcc::
ChannelLoad
m_cbr_target;
72
dcc::
ChannelLoad
m_cbr_local;
73
unsigned
m_tx_power;
74
CbrAggregator
m_aggregator;
75
Clock
::duration m_trigger_interval;
76
Timestamp
m_last_aggregation;
77
Hook
<
const
CbrAggregator
&> m_update_hook;
78
79
public
:
80
/**
81
* on_global_cbr_update is called at each update cycle,
82
* i.e. when a new global CBR has been calculated
83
*/
84
HookRegistry
<
const
CbrAggregator
&>
on_global_cbr_update
;
85
};
86
87
}
// namespace geonet
88
}
// namespace vanetza
89
90
#
endif
/* DCC_INFORMATION_SHARING_HPP_GZCSHZLD */
vanetza::Clock
Definition
clock.hpp:16
vanetza::HookRegistry
Definition
hook.hpp:71
vanetza::Hook
Definition
hook.hpp:15
vanetza::Runtime
Definition
runtime.hpp:16
vanetza::UnitInterval
Definition
unit_interval.hpp:24
vanetza::dcc::ChannelLoad
Definition
channel_load.hpp:12
vanetza::geonet::CbrAggregator
Definition
cbr_aggregator.hpp:22
vanetza::geonet::DccFieldGenerator
Definition
dcc_field_generator.hpp:12
vanetza::geonet::DccInformationSharing
Definition
dcc_information_sharing.hpp:30
vanetza::geonet::DccInformationSharing::DccInformationSharing
DccInformationSharing(Runtime &rt, const LocationTable <, dcc::ChannelLoad target, UnitInterval delay)
Definition
dcc_information_sharing.cpp:10
vanetza::geonet::DccInformationSharing::on_global_cbr_update
HookRegistry< const CbrAggregator & > on_global_cbr_update
Definition
dcc_information_sharing.hpp:84
vanetza::geonet::DccInformationSharing::set_tx_power
void set_tx_power(unsigned power)
Definition
dcc_information_sharing.cpp:40
vanetza::geonet::DccInformationSharing::update_local_cbr
void update_local_cbr(dcc::ChannelLoad cbr)
Definition
dcc_information_sharing.cpp:35
vanetza::geonet::DccMcoField
Definition
dcc_mco_field.hpp:18
vanetza::geonet::DccMcoField::output_power
void output_power(unsigned dbm)
Definition
dcc_mco_field.cpp:56
vanetza::geonet::LocationTable
Definition
location_table.hpp:112
vanetza::geonet::Timestamp
Definition
timestamp.hpp:20
vanetza
geonet
dcc_information_sharing.hpp
Generated on
for Vanetza by
1.16.1