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).
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#ifndef BASIC_HEADER_HPP_8QS7WLG3
|
|
#define BASIC_HEADER_HPP_8QS7WLG3
|
|
|
|
#include <vanetza/common/bit_number.hpp>
|
|
#include <vanetza/geonet/lifetime.hpp>
|
|
#include <vanetza/geonet/mib.hpp>
|
|
#include <vanetza/geonet/serialization.hpp>
|
|
|
|
namespace vanetza
|
|
{
|
|
namespace geonet
|
|
{
|
|
|
|
struct DataRequest;
|
|
struct ShbDataRequest;
|
|
|
|
/// NextHeaderBasic specified in ETSI EN 302 636-4-1 v1.2.1, section 8.6.3
|
|
enum class NextHeaderBasic : uint8_t
|
|
{
|
|
Any = 0,
|
|
Common = 1,
|
|
Secured = 2,
|
|
};
|
|
|
|
/// BasicHeader specified in ETSI EN 302 636-4-1 v1.2.1, section 8.6
|
|
struct BasicHeader
|
|
{
|
|
BasicHeader();
|
|
BasicHeader(const MIB&);
|
|
BasicHeader(const DataRequest&, const MIB&);
|
|
BasicHeader(const ShbDataRequest&, const MIB&);
|
|
|
|
static constexpr std::size_t length_bytes = 3 + sizeof(Lifetime);
|
|
|
|
BitNumber<unsigned, 4> version;
|
|
NextHeaderBasic next_header; // 4 bit
|
|
uint8_t reserved;
|
|
Lifetime lifetime;
|
|
uint8_t hop_limit;
|
|
};
|
|
|
|
/**
|
|
* \brief Serializes a BasicHeader into a binary archive
|
|
* \param basic to serialize
|
|
* \param ar to serialize in
|
|
*/
|
|
void serialize(const BasicHeader&, OutputArchive&);
|
|
|
|
/**
|
|
* \brief Deserializes a BasicHeader from a binary archive
|
|
* \param basic to deserialize
|
|
* \param ar with a serialized BasicHeader at the beginning
|
|
*/
|
|
void deserialize(BasicHeader&, InputArchive&);
|
|
|
|
} // namespace geonet
|
|
} // namespace vanetza
|
|
|
|
#endif /* BASIC_HEADER_HPP_8QS7WLG3 */
|