Files
MicrOBU/obu-firmware/external/vanetza-idf/vanetza/geonet/address.hpp
T
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

61 lines
1.6 KiB
C++

#ifndef GEONET_ADDRESS_HPP_MB8J1IVQ
#define GEONET_ADDRESS_HPP_MB8J1IVQ
#include <vanetza/common/bit_number.hpp>
#include <vanetza/net/mac_address.hpp>
#include <vanetza/geonet/serialization.hpp>
#include <vanetza/geonet/station_type.hpp>
#include <functional>
#include <type_traits>
namespace vanetza
{
namespace geonet
{
class Address
{
public:
static constexpr std::size_t length_bytes = 8;
Address();
explicit Address(const MacAddress&);
bool is_manually_configured() const { return m_manually_configured; }
void is_manually_configured(bool flag) { m_manually_configured = flag; }
StationType station_type() const { return m_station_type; }
void station_type(StationType type) { m_station_type = type; }
BitNumber<unsigned, 10> country_code() const { return m_country_code; }
void country_code(BitNumber<unsigned, 10> country) { m_country_code = country; }
const MacAddress& mid() const { return m_mid; }
void mid(const MacAddress& mid) { m_mid = mid; }
bool operator==(const Address& other) const;
bool operator!=(const Address& other) const;
private:
bool m_manually_configured; // 1 bit
StationType m_station_type; // 5 bit
BitNumber<unsigned, 10> m_country_code; // 10 bit (deprecated since 1.3.1)
MacAddress m_mid; // 48 bit
};
void serialize(const Address&, OutputArchive&);
void deserialize(Address&, InputArchive&);
} // namespace geonet
} // namespace vanetza
namespace std {
template<>
struct hash<vanetza::geonet::Address>
{
size_t operator()(const vanetza::geonet::Address& addr) const;
};
} // namespace std
#endif /* GEONET_ADDRESS_HPP_MB8J1IVQ */