From b4d7195722ccb6983aea9eb2a163c9b18a877f7f Mon Sep 17 00:00:00 2001 From: ohadmeir Date: Sun, 1 Oct 2023 14:50:00 +0300 Subject: [PATCH] Add support to update multiple MIPI devices in rs-fw-update tool --- tools/fw-update/rs-fw-update.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/fw-update/rs-fw-update.cpp b/tools/fw-update/rs-fw-update.cpp index 5839cceca7..f5a56ee940 100644 --- a/tools/fw-update/rs-fw-update.cpp +++ b/tools/fw-update/rs-fw-update.cpp @@ -138,11 +138,11 @@ void list_devices(rs2::context ctx) } } -int write_fw_to_mipi_device( const std::vector< uint8_t > & fw_image) +int write_fw_to_mipi_device( const rs2::device & dev, const std::vector< uint8_t > & fw_image ) { // Write firmware to appropriate file descritptor std::cout << std::endl << "Update can take up to 2 minutes" << std::endl; - std::ofstream fw_path_in_device( "/dev/d4xx-dfu504", std::ios::binary ); + std::ofstream fw_path_in_device( dev.get_info( RS2_CAMERA_INFO_DFU_DEVICE_PATH ), std::ios::binary ); auto file_deleter = std::unique_ptr< std::ofstream, void ( * )( std::ofstream * ) >( &fw_path_in_device, []( std::ofstream * file ) { @@ -452,7 +452,7 @@ try return EXIT_FAILURE; } - return write_fw_to_mipi_device( fw_image ); + return write_fw_to_mipi_device( d, fw_image ); } if (unsigned_arg.isSet())