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).
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
#include "cases/security/signing.hpp"
|
||||
#include "cases/security/validation.hpp"
|
||||
#include "options.hpp"
|
||||
#include <boost/program_options.hpp>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
std::unique_ptr<Case> parse_options(int argc, const char *argv[])
|
||||
{
|
||||
po::options_description global("Global options");
|
||||
global.add_options()
|
||||
("case", po::value<std::string>(), "Case to execute.")
|
||||
("subargs", po::value<std::vector<std::string>>(), "Arguments for case.");
|
||||
|
||||
po::positional_options_description pos;
|
||||
pos.add("case", 1);
|
||||
pos.add("subargs", -1);
|
||||
|
||||
po::variables_map vm;
|
||||
|
||||
po::parsed_options parsed = po::command_line_parser(argc, argv)
|
||||
.options(global)
|
||||
.positional(pos)
|
||||
.allow_unregistered()
|
||||
.run();
|
||||
|
||||
po::store(parsed, vm);
|
||||
po::notify(vm);
|
||||
|
||||
std::string available_commands = "Available cases: security-validation, security-signing";
|
||||
|
||||
if (!vm.count("case")) {
|
||||
std::cerr << global << std::endl;
|
||||
std::cerr << available_commands << std::endl;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string name = vm["case"].as<std::string>();
|
||||
std::unique_ptr<Case> instance;
|
||||
|
||||
if (name == "--help") {
|
||||
std::cerr << global << std::endl;
|
||||
std::cerr << available_commands << std::endl;
|
||||
} else if (name == "security-signing") {
|
||||
instance.reset(new SecuritySigningCase());
|
||||
} else if (name == "security-validation") {
|
||||
instance.reset(new SecurityValidationCase());
|
||||
} else {
|
||||
throw std::runtime_error("Unknown benchmark case.");
|
||||
}
|
||||
|
||||
std::vector<std::string> opts = po::collect_unrecognized(parsed.options, po::include_positional);
|
||||
opts.erase(opts.begin());
|
||||
|
||||
if (!instance->parse(opts)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
Reference in New Issue
Block a user