Log error and return if no devices

This commit is contained in:
John Zhao
2018-05-15 22:01:15 +08:00
parent 276406dd1e
commit de0f0d0639
26 changed files with 92 additions and 4 deletions

View File

@@ -29,6 +29,8 @@ int main(int argc, char *argv[]) {
glog_init _(argc, argv);
auto &&device = device::select();
if (!device)
return 1;
/*
{ // auto-exposure
device->SetOptionValue(Option::EXPOSURE_MODE, 0);

View File

@@ -32,6 +32,8 @@ int main(int argc, char *argv[]) {
}
auto &&device = device::select();
if (!device)
return 1;
tools::DeviceWriter writer(device);
writer.WriteDeviceInfo(filepath);

View File

@@ -32,6 +32,8 @@ int main(int argc, char *argv[]) {
}
auto &&device = device::select();
if (!device)
return 1;
tools::DeviceWriter writer(device);
writer.WriteImgParams(filepath);

View File

@@ -32,6 +32,8 @@ int main(int argc, char *argv[]) {
}
auto &&device = device::select();
if (!device)
return 1;
tools::DeviceWriter writer(device);
writer.WriteImuParams(filepath);

View File

@@ -29,6 +29,8 @@ int main(int argc, char *argv[]) {
}
auto &&device = device::select();
if (!device)
return 1;
dir.append(OS_SEP "SN").append(device->GetInfo()->serial_number);