Vanetza
Loading...
Searching...
No Matches
data_rates.hpp
1
#
ifndef
DATA_RATES_802DOT11P_HPP_SL3RZPZO
2
#
define
DATA_RATES_802DOT11P_HPP_SL3RZPZO
3
4
#
include
<
cstddef
>
5
6
namespace
vanetza
7
{
8
namespace
access
9
{
10
11
class
DataRateG5
12
{
13
public
:
14
/**
15
* Create data rate for ITS-G5 band
16
* \param kbps kilo-bits per second transfer rate
17
* \param cbits number of coded bits per symbol
18
*/
19
constexpr
DataRateG5
(
unsigned
kbps,
unsigned
cbits) :
20
m_bytes_per_second(kbps * 1000 / 8),
21
m_coded_bits_per_symbol(cbits) {}
22
23
/**
24
* Get tranfer rate as number of bytes per second
25
* \return transfer rate
26
*/
27
unsigned
bytes_per_second
()
const
{
return
m_bytes_per_second; }
28
29
/**
30
* Calculate length of PHY data length
31
* \param psdu size of PSDU, i.e. MPDU (MAC header + payload)
32
* \return length in bytes
33
*/
34
std::size_t
data_length
(std::size_t psdu)
const
;
35
36
private
:
37
unsigned
m_bytes_per_second;
38
unsigned
m_coded_bits_per_symbol;
39
};
40
41
static
const
DataRateG5
G5_3Mbps
{
3000
,
48
}
;
42
static
const
DataRateG5
G5_4dot5Mbps
{
4500
,
48
}
;
43
static
const
DataRateG5
G5_6Mbps
{
6000
,
96
}
;
44
static
const
DataRateG5
G5_9Mbps
{
9000
,
96
}
;
45
static
const
DataRateG5
G5_12Mbps
{
12000
,
192
}
;
46
static
const
DataRateG5
G5_18bps
{
18000
,
192
}
;
47
static
const
DataRateG5
G5_24Mbps
{
24000
,
288
}
;
48
static
const
DataRateG5
G5_27Mbps
{
27000
,
288
}
;
49
50
}
// namespace access
51
}
// namespace vanetza
52
53
#
endif
/* DATA_RATES_802DOT11P_HPP_SL3RZPZO */
vanetza::access::DataRateG5
Definition
data_rates.hpp:12
vanetza::access::DataRateG5::bytes_per_second
unsigned bytes_per_second() const
Definition
data_rates.hpp:27
vanetza::access::DataRateG5::data_length
std::size_t data_length(std::size_t psdu) const
Definition
data_rates.cpp:9
vanetza::access::DataRateG5::DataRateG5
constexpr DataRateG5(unsigned kbps, unsigned cbits)
Definition
data_rates.hpp:19
vanetza
access
data_rates.hpp
Generated on
for Vanetza by
1.16.1