Files
Ashin Walpola d107534eb2 Keep vanetza-idf in obu-firmware, so a plain clone builds the firmware
obu-firmware builds against the vanetza-idf C-ITS library, which until now
came from the colleague's microbu-esp32c5 tree beside the repository and was
not tracked here, so a clone of this repository could not build the firmware
it ships. The library alone is now part of obu-firmware, as
obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit
cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from
there by default; -DVANETZA_IDF_DIR still points the build elsewhere.

The rest of the colleague's tree (their own VAM firmware, PKI tooling,
station-link Python tools, the V2X2MAP bridge) stays out of this repository
and gitignored; nothing is pushed to their repository. NOTES.md, docs/06,
TODO.md and the pcap verifier's usage line point at the new location.
2026-09-24 10:56:05 +02:00

55 lines
1.4 KiB
C++

#ifndef DATA_RATES_802DOT11P_HPP_SL3RZPZO
#define DATA_RATES_802DOT11P_HPP_SL3RZPZO
#include <cstddef>
namespace vanetza
{
namespace access
{
class DataRateG5
{
public:
/**
* Create data rate for ITS-G5 band
* \param kbps kilo-bits per second transfer rate
* \param cbits number of coded bits per symbol
*/
constexpr DataRateG5(unsigned kbps, unsigned cbits) :
m_bytes_per_second(kbps * 1000 / 8),
m_coded_bits_per_symbol(cbits) {}
/**
* Get tranfer rate as number of bytes per second
* \return transfer rate
*/
unsigned bytes_per_second() const { return m_bytes_per_second; }
/**
* Calculate length of PHY data length
* \param psdu size of PSDU, i.e. MPDU (MAC header + payload)
* \return length in bytes
*/
std::size_t data_length(std::size_t psdu) const;
private:
unsigned m_bytes_per_second;
unsigned m_coded_bits_per_symbol;
};
static const DataRateG5 G5_3Mbps { 3000, 48 };
static const DataRateG5 G5_4dot5Mbps { 4500, 48 };
static const DataRateG5 G5_6Mbps { 6000, 96 };
static const DataRateG5 G5_9Mbps { 9000, 96 };
static const DataRateG5 G5_12Mbps { 12000, 192 };
static const DataRateG5 G5_18bps { 18000, 192 };
static const DataRateG5 G5_24Mbps { 24000, 288 };
static const DataRateG5 G5_27Mbps { 27000, 288 };
} // namespace access
} // namespace vanetza
#endif /* DATA_RATES_802DOT11P_HPP_SL3RZPZO */