Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UAVCAN UAVCAN_Subscriber
test_system_utils.cpp
00001 /* 00002 * Copyright (C) 2015 Pavel Kirienko <pavel.kirienko@gmail.com> 00003 */ 00004 00005 #include <uavcan_linux/uavcan_linux.hpp> 00006 #include <iostream> 00007 #include <iomanip> 00008 #include "debug.hpp" 00009 00010 int main(int argc, const char** argv) 00011 { 00012 try 00013 { 00014 const std::vector<std::string> iface_names(argv + 1, argv + argc); 00015 00016 const auto res = uavcan_linux::MachineIDReader(iface_names).readAndGetLocation(); 00017 00018 const auto original_flags = std::cout.flags(); 00019 00020 for (auto x : res.first) 00021 { 00022 std::cout << std::hex << std::setw(2) << std::setfill('0') << int(x); 00023 } 00024 00025 std::cout.width(0); 00026 std::cout.flags(original_flags); 00027 00028 std::cout << std::endl; 00029 00030 std::cout << res.second << std::endl; 00031 00032 return 0; 00033 } 00034 catch (const std::exception& ex) 00035 { 00036 std::cerr << "Exception: " << ex.what() << std::endl; 00037 return 1; 00038 } 00039 }
Generated on Tue Jul 12 2022 17:17:35 by
