From c5aadbdfb76777263bea21394c0dd37d628fda41 Mon Sep 17 00:00:00 2001 From: mmirbach Date: Sun, 22 Aug 2021 11:23:44 +0300 Subject: [PATCH] capitalization --- tools/fw-update/rs-fw-update.cpp | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tools/fw-update/rs-fw-update.cpp b/tools/fw-update/rs-fw-update.cpp index a91e636b68..3bac83ef2b 100644 --- a/tools/fw-update/rs-fw-update.cpp +++ b/tools/fw-update/rs-fw-update.cpp @@ -68,14 +68,14 @@ std::vector read_firmware_data(bool is_set, const std::string& file_pat { if (!is_set) { - throw rs2::error("firmware file must be selected"); + throw rs2::error("Firmware file must be selected"); } std::vector fw_image = read_fw_file(file_path); if (fw_image.size() == 0) { - throw rs2::error("failed to read firmware file"); + throw rs2::error("Failed to read firmware file"); } return fw_image; @@ -84,19 +84,19 @@ std::vector read_firmware_data(bool is_set, const std::string& file_pat void update(rs2::update_device fwu_dev, std::vector fw_image) { - std::cout << std::endl << "firmware update started"<< std::endl << std::endl; + std::cout << std::endl << "Firmware update started"<< std::endl << std::endl; if (ISATTY(FILENO(stdout))) { fwu_dev.update(fw_image, [&](const float progress) { - printf("\rfirmware update progress: %d[%%]", (int)(progress * 100)); + printf("\rFirmware update progress: %d[%%]", (int)(progress * 100)); }); } else fwu_dev.update(fw_image, [&](const float progress){}); - std::cout << std::endl << std::endl << "firmware update done" << std::endl; + std::cout << std::endl << std::endl << "Firmware update done" << std::endl; } void list_devices(rs2::context ctx) @@ -104,11 +104,11 @@ void list_devices(rs2::context ctx) auto devs = ctx.query_devices(); if (devs.size() == 0) { - std::cout << std::endl << "there are no connected devices" << std::endl; + std::cout << std::endl << "There are no connected devices" << std::endl; return; } - std::cout << std::endl << "connected devices:" << std::endl; + std::cout << std::endl << "Connected devices:" << std::endl; int counter = 0; @@ -157,7 +157,7 @@ int main(int argc, char** argv) try if (!list_devices_arg.isSet() && !recover_arg.isSet() && !unsigned_arg.isSet() && !backup_arg.isSet() && !file_arg.isSet() && !serial_number_arg.isSet()) { - std::cout << std::endl << "nothing to do, run again with -h for help" << std::endl; + std::cout << std::endl << "Nothing to do, run again with -h for help" << std::endl; list_devices(ctx); return EXIT_SUCCESS; } @@ -172,14 +172,14 @@ int main(int argc, char** argv) try if (!file_arg.isSet() && !backup_arg.isSet()) { - std::cout << std::endl << "nothing to do, run again with -h for help" << std::endl; + std::cout << std::endl << "Nothing to do, run again with -h for help" << std::endl; return EXIT_FAILURE; } if (serial_number_arg.isSet()) { selected_serial_number = serial_number_arg.getValue(); - std::cout << std::endl << "search for device with serial number: " << selected_serial_number << std::endl; + std::cout << std::endl << "Search for device with serial number: " << selected_serial_number << std::endl; } std::string update_serial_number; @@ -189,7 +189,7 @@ int main(int argc, char** argv) try { std::vector fw_image = read_firmware_data(file_arg.isSet(), file_arg.getValue()); - std::cout << std::endl << "update to FW: " << file_arg.getValue() << std::endl; + std::cout << std::endl << "Update to FW: " << file_arg.getValue() << std::endl; auto devs = ctx.query_devices(RS2_PRODUCT_LINE_DEPTH); rs2::device recovery_device; @@ -230,10 +230,10 @@ int main(int argc, char** argv) try } } } ); - std::cout << std::endl << "recovering device: " << std::endl; + std::cout << std::endl << "Recovering device: " << std::endl; print_device_info( recovery_device ); update( recovery_device, fw_image ); - std::cout << "waiting for new device..." << std::endl; + std::cout << "Waiting for new device..." << std::endl; { std::unique_lock< std::mutex > lk( mutex ); if( cv.wait_for( lk, std::chrono::seconds( 5 ) ) == std::cv_status::timeout ) @@ -242,12 +242,12 @@ int main(int argc, char** argv) try return EXIT_FAILURE; } } - std::cout << std::endl << "recovery done" << std::endl; + std::cout << std::endl << "Recovery done" << std::endl; return EXIT_SUCCESS; } catch (...) { - std::cout << std::endl << "failed to recover device" << std::endl; + std::cout << std::endl << "Failed to recover device" << std::endl; return EXIT_FAILURE; } } @@ -276,19 +276,19 @@ int main(int argc, char** argv) try if (!serial_number_arg.isSet() && devs.size() > 1) { - std::cout << std::endl << "more than one device is connected, serial number must be selected" << std::endl << std::endl; + std::cout << std::endl << "More than one device is connected, serial number must be selected" << std::endl << std::endl; return EXIT_FAILURE; } if ( devs.size() == 1 && devs[0].is() ) { - std::cout << std::endl << "device is in recovery mode, use -r to recover" << std::endl << std::endl; + std::cout << std::endl << "Device is in recovery mode, use -r to recover" << std::endl << std::endl; return EXIT_FAILURE; } if (devs.size() == 0) { - std::cout << std::endl << "no devices were found" << std::endl << std::endl; + std::cout << std::endl << "No devices were found" << std::endl << std::endl; return EXIT_FAILURE; } @@ -317,13 +317,13 @@ int main(int argc, char** argv) try if (backup_arg.isSet()) { - std::cout << std::endl << "backing-up device flash: " << std::endl; + std::cout << std::endl << "Backing-up device flash: " << std::endl; std::vector< uint8_t > flash; if( ISATTY( FILENO( stdout ))) { flash = d.as< rs2::updatable >().create_flash_backup( [&]( const float progress ) { - printf( "\rflash backup progress: %d[%%]", (int)( progress * 100 ) ); + printf( "\rFlash backup progress: %d[%%]", (int)( progress * 100 ) ); } ); } else @@ -339,24 +339,24 @@ int main(int argc, char** argv) try std::vector fw_image = read_firmware_data(file_arg.isSet(), file_arg.getValue()); - std::cout << std::endl << "updating device: " << std::endl; + std::cout << std::endl << "Updating device: " << std::endl; print_device_info(d); if (unsigned_arg.isSet()) { - std::cout << std::endl << "firmware update started" << std::endl << std::endl; + std::cout << std::endl << "Firmware update started" << std::endl << std::endl; if (ISATTY(FILENO(stdout))) { d.as().update_unsigned(fw_image, [&](const float progress) { - printf("\rfirmware update progress: %d[%%]", (int)(progress * 100)); + printf("\rFirmware update progress: %d[%%]", (int)(progress * 100)); }); } else d.as().update_unsigned(fw_image, [&](const float progress){}); - std::cout << std::endl << std::endl << "firmware update done" << std::endl; + std::cout << std::endl << std::endl << "Firmware update done" << std::endl; } else { @@ -376,7 +376,7 @@ int main(int argc, char** argv) try std::unique_lock lk(mutex); if (!cv.wait_for(lk, std::chrono::seconds(WAIT_FOR_DEVICE_TIMEOUT), [&] { return new_fw_update_device; })) { - std::cout << std::endl << "failed to locate a device in FW update mode" << std::endl; + std::cout << std::endl << "Failed to locate a device in FW update mode" << std::endl; return EXIT_FAILURE; } @@ -389,10 +389,10 @@ int main(int argc, char** argv) try if (!device_found) { if(serial_number_arg.isSet()) - std::cout << std::endl << "couldn't find the requested serial number" << std::endl; + std::cout << std::endl << "Couldn't find the requested serial number" << std::endl; else if (devs.size() == 1) { - std::cout << std::endl << "nothing to do, run again with -h for help" << std::endl; + std::cout << std::endl << "Nothing to do, run again with -h for help" << std::endl; } return EXIT_FAILURE; } @@ -410,7 +410,7 @@ int main(int argc, char** argv) try continue; auto fw = d.supports(RS2_CAMERA_INFO_FIRMWARE_VERSION) ? d.get_info(RS2_CAMERA_INFO_FIRMWARE_VERSION) : "unknown"; - std::cout << std::endl << "device " << sn << " successfully updated to FW: " << fw << std::endl; + std::cout << std::endl << "Device " << sn << " successfully updated to FW: " << fw << std::endl; } }