Index: tests/hd_nvm_scripts.py =================================================================== diff -u -rbe8a844a39195fc593bcf79b1c1b2b3add33436a -rf35942d721c76cd5db96dc7f088c0b31880bb56b --- tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision be8a844a39195fc593bcf79b1c1b2b3add33436a) +++ tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision f35942d721c76cd5db96dc7f088c0b31880bb56b) @@ -1,9 +1,23 @@ +########################################################################### +# +# Copyright (c) 2022-2022 Diality Inc. - All Rights Reserved. +# +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# @file hd_nvm_scripts.py +# +# @author (last) Dara Navaei +# @date (last) 26-Jul-2022 +# @author (original) Dara Navaei +# @date (original) 10-Feb-2022 +# +############################################################################ from dialin import HD +from time import sleep -if __name__ == "__main__": - hd = HD(log_level="DEBUG") - +def run_sw_configs_commands(): # NOTE: For further details, please refer to 'Instructions to Change the Software Configurations Dynamically' in # the development section of the DevOps OneNote file @@ -13,11 +27,67 @@ # This function gets an address to locate the report there (i.e. /home/fw/projects/) # It creates a folder called HD_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed - # in you computer. - hd.sw_configs.cmd_get_hd_sw_config_record() + # in your computer. + #hd.sw_configs.cmd_get_hd_sw_config_record() # Use cmd_update_hd_sw_config_record() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - hd.sw_configs.cmd_update_hd_sw_config_record('/home/fw/projects/HD_NV_Records/2022-02-08-HD-SW-CONFIGS-Record.xlsx') + hd.sw_configs.cmd_update_hd_sw_config_record('/home/fw/projects/HD_NV_Records/2022-09-19-HD-SW-CONFIGS-Record.xlsx') + # Use this function to reset the configuration records to all be 0 + #hd.sw_configs.cmd_reset_hd_sw_config_record() + + +def run_calibration_commands(): + # NOTE: For further details, please refer to 'Instructions to Calibrate a Device Using the Calibration Report' + # in the development section of the DevOps OneNote file + + # Comment and un-comment any of the functions that you would like to use or you can use your own scripts. + + # Use cmd_get_dg_calibration_record_report() to get the calibration record in an excel + # This function gets an address to locate the report there (i.e. /home/fw/projects/) + # It creates a folder called HD_NV_Records in the destination that is called + # If no address is provided, the default location is one folder above the dialin folder wherever it is installed + # in your computer. + hd.calibration_record.cmd_get_hd_calibration_record_report() + + # Use cmd_set_hd_calibration_excel_to_fw() set the changes back to firmware + # This function requires an address for the excel report. Use the absolute address of your excel report like the + # example below + #hd.calibration_record.cmd_set_hd_calibration_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-08-13-HD-Record.xlsx') + + # For resetting the calibration record to benign values, use the function below + #hd.calibration_record.cmd_reset_hd_calibration_record() + + +def run_system_commands(): + # Comment and un-comment any of the functions that you would like to use or you can use your own scripts. + + # Use cmd_get_dg_system_record_report() to get the system record in an excel + # This function gets an address to locate the report there (i.e. /home/fw/projects/) + # It creates a folder called DG_NV_Records in the destination that is called + # If no address is provided, the default location is one folder above the dialin folder wherever it is installed + # in you computer. + hd.system_record.cmd_get_hd_system_record_report() + + #hd.system_record.cmd_set_hd_system_record_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-09-26-HD-Record.xlsx') + + # For resetting the system record to benign values, use the function below + #hd.system_record.cmd_reset_hd_system_record() + + +if __name__ == "__main__": + + hd = HD(log_level="DEBUG") + + if hd.cmd_log_in_to_hd(): + + # Comment this function if not needed + run_sw_configs_commands() + + # Comment this function if not needed + #run_calibration_commands() + + #run_system_commands() +