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).
61 lines
1.6 KiB
C++
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 */
|
|
|