Vanetza
 
Loading...
Searching...
No Matches
data_rates.cpp
1#include "data_rates.hpp"
2#include <cassert>
3
4namespace vanetza
5{
6namespace access
7{
8
9std::size_t DataRateG5::data_length(std::size_t psdu) const
10{
11 static const unsigned service_bits = 16;
12 static const unsigned tail_bits = 6;
13
14 const unsigned body = service_bits + tail_bits + psdu * 8;
15 unsigned padding = body % m_coded_bits_per_symbol;
16 if (padding > 0) {
17 padding = m_coded_bits_per_symbol - padding;
18 }
19
20 assert((body + padding) % 8 == 0);
21 return (body + padding) / 8;
22}
23
24} // namespace access
25} // namespace vanetza
std::size_t data_length(std::size_t psdu) const
Definition: data_rates.cpp:9