Skip to content

Commit

Permalink
checking fw compatibility in rs-fw-update tool
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed May 4, 2021
1 parent a06f574 commit 9e80864
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tools/fw-update/rs-fw-update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,18 @@ int main(int argc, char** argv) try
}
else
{
d.as<rs2::updatable>().enter_update_state();
auto upd = d.as<rs2::updatable>();
// checking compatibility bewtween firmware and device
if (!upd.check_firmware_compatibility(fw_image))
{
std::stringstream ss;
ss << "This firmware version is not compatible with ";
ss << d.get_info(RS2_CAMERA_INFO_NAME) << std::endl;
std::cout << std::endl << ss.str() << std::endl;
return EXIT_FAILURE;
}

upd.enter_update_state();

std::unique_lock<std::mutex> lk(mutex);
if (!cv.wait_for(lk, std::chrono::seconds(WAIT_FOR_DEVICE_TIMEOUT), [&] { return new_fw_update_device; }))
Expand Down

0 comments on commit 9e80864

Please sign in to comment.