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).
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#ifndef PARSER_HPP_IBDRMPKB
|
|
#define PARSER_HPP_IBDRMPKB
|
|
|
|
#include <vanetza/common/byte_buffer.hpp>
|
|
#include <vanetza/common/byte_buffer_source.hpp>
|
|
#include <vanetza/geonet/header_type.hpp>
|
|
#include <vanetza/geonet/header_variant.hpp>
|
|
#include <vanetza/security/secured_message.hpp>
|
|
#include <boost/iostreams/stream.hpp>
|
|
#include <boost/range/iterator_range.hpp>
|
|
#include <cstdint>
|
|
|
|
namespace vanetza
|
|
{
|
|
namespace geonet
|
|
{
|
|
|
|
// forward declarations
|
|
struct BasicHeader;
|
|
struct CommonHeader;
|
|
|
|
class Parser
|
|
{
|
|
public:
|
|
Parser(ByteBuffer::const_iterator begin, ByteBuffer::const_iterator end);
|
|
Parser(boost::iterator_range<ByteBuffer::const_iterator> range);
|
|
|
|
std::size_t parse_basic(BasicHeader&);
|
|
std::size_t parse_common(CommonHeader&);
|
|
std::size_t parse_secured(security::SecuredMessage&);
|
|
std::size_t parse_extended(HeaderVariant&, HeaderType);
|
|
std::size_t parsed_bytes() const;
|
|
|
|
private:
|
|
byte_buffer_source m_byte_buffer_source;
|
|
boost::iostreams::stream_buffer<byte_buffer_source> m_stream;
|
|
InputArchive m_archive;
|
|
std::size_t m_read_bytes;
|
|
};
|
|
|
|
} // namespace geonet
|
|
} // namespace vanetza
|
|
|
|
#endif /* PARSER_HPP_IBDRMPKB */
|
|
|