Go to the documentation of this file.
3 int main(
int argc,
char** argv) {
5 bool usage =
false, read =
true, clear =
false;
8 std::string op = argv[1];
11 }
else if(op ==
"flash") {
16 }
else if(op ==
"clear") {
19 }
else if(op ==
"clear") {
29 std::cout <<
"Usage: " << argv[0] <<
" [read/flash/clear] [flash: path/to/config/json]" << std::endl;
39 std::cout <<
"Found device with name: " <<
info.name << std::endl;
44 std::cout <<
"Current flashed configuration\n" << bl.
readConfigData().dump(4) << std::endl;
46 std::cout <<
"Warning! Flashing bootloader config can potentially soft brick your device and should be done with caution." << std::endl;
47 std::cout <<
"Do not unplug your device while the bootloader config is flashing." << std::endl;
48 std::cout <<
"Type 'y' and press enter to proceed, otherwise exits: ";
50 if(std::cin.
get() !=
'y') {
51 std::cout <<
"Prompt declined, exiting..." << std::endl;
67 std::cout <<
"Successfully flashed bootloader configuration\n";
69 std::cout <<
"Error flashing bootloader configuration: " <<
error;
72 }
catch(
const std::exception& ex) {
73 std::cout <<
"Error accessing config: " << ex.what() << std::endl;
77 std::cout <<
"No devices found" << std::endl;
constexpr auto get(span< E, S > s) -> decltype(s[N])
void info(const FormatString &fmt, Args &&...args)
std::tuple< bool, std::string > flashConfigClear(Memory memory=Memory::AUTO, Type type=Type::AUTO)
std::tuple< bool, std::string > flashConfigFile(const dai::Path &configPath, Memory memory=Memory::AUTO, Type type=Type::AUTO)
int main(int argc, char **argv)
void error(const FormatString &fmt, Args &&...args)
nlohmann::json readConfigData(Memory memory=Memory::AUTO, Type type=Type::AUTO)
static std::tuple< bool, DeviceInfo > getFirstAvailableDevice()
std::tuple< bool, std::string > flashConfig(const Config &config, Memory memory=Memory::AUTO, Type type=Type::AUTO)
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:18