Files
MicrOBU/microbu-esp32c5/external/vanetza-idf/vanetza/net/proxy_header.hpp
T
Ashin Walpola 0e9525162d Keep the colleague's microbu-esp32c5 tree in this repository
obu-firmware builds against vanetza-idf from microbu-esp32c5/external, but
that tree was gitignored, so a clone of this repository could not build the
firmware it ships. It is now committed here as ordinary files in its own
folder, microbu-esp32c5/: the colleague's commit cf4b99f plus the V2X2MAP
bridge's signature verification (--trust) used on the bench. Nothing is
fetched from or pushed to the colleague's repository; this repository and
its remotes carry everything. The folder's own .gitignore keeps build output,
downloaded components and private key material out, as it did there; the
committed file set is identical to that repository's tracked files.

The ESP32-C5 is still flashed from obu-firmware/, which only takes
vanetza-idf from microbu-esp32c5/, so the two stay separate folders.
FLASHING.md says how to take a newer version of the colleague's tree (copy
it over the folder, rebuild, test, commit).
2026-09-23 17:46:40 +02:00

49 lines
1.3 KiB
C++

#ifndef PROXY_HEADER_HPP_JWTV3BDT
#define PROXY_HEADER_HPP_JWTV3BDT
#include <boost/range/iterator_range.hpp>
#include <vanetza/access/access_category.hpp>
#include <cstdint>
namespace vanetza
{
#ifndef _MSC_VER
// GCC and Clang support packed attribute
#define PACKED_STRUCT(name, block) struct name { block } __attribute__((__packed__));
#else
// MSVC variant
#define PACKED_STRUCT(name, block) \
__pragma(pack(push, 1)) \
struct name { block }; \
__pragma(pack(pop))
#endif
PACKED_STRUCT(ProxyHeader,
/** offset in bytes to payload's first byte, counting from packet start */
uint16_t payload_offset;
/** length of payload in bytes */
uint32_t payload_size;
/** signal power in dBm, fixed point format 8.8 = trunc(double * 256) */
int16_t signal_power;
/** access category (transmission only) */
uint8_t access_category;
)
static_assert(sizeof(ProxyHeader) == 9, "ProxyHeader has invalid size");
double get_signal_power(const ProxyHeader&);
void set_signal_power(ProxyHeader&, double dbm);
access::AccessCategory get_access_category(const ProxyHeader&);
void set_access_category(ProxyHeader&, access::AccessCategory);
boost::iterator_range<const uint8_t*> get_payload(const ProxyHeader&, std::size_t);
void set_payload(ProxyHeader&, std::size_t);
} // namespace vanetza
#endif /* PROXY_HEADER_HPP_JWTV3BDT */