Index: tests/dg_nvm_scripts.py =================================================================== diff -u -ra7f6b7938acc3b1e5e8dd9b8d5f8237a3b298e6b -r79ed3e7d26065bb2f2155be984c4381175299cd7 --- tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision a7f6b7938acc3b1e5e8dd9b8d5f8237a3b298e6b) +++ tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision 79ed3e7d26065bb2f2155be984c4381175299cd7) @@ -1,28 +1,72 @@ +########################################################################### +# +# 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 dg_nvm_scripts.py +# +# @author (last) Dara Navaei +# @date (last) 31-Mar-2022 +# @author (original) Dara Navaei +# @date (original) 10-Feb-2022 +# +############################################################################ from dialin import DG -if __name__ == "__main__": - dg = DG(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 - if dg.cmd_log_in_to_dg(): + # Comment and un-comment any of the functions that you would like to use or you can use your own scripts. - # 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 + # Use cmd_get_dg_sw_config_record() to get the software configurations 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 your computer. + #dg.sw_configs.cmd_get_dg_sw_config_record() - # Comment and un-comment any of the functions that you would like to use or you can use your own scripts. + # Use cmd_set_dg_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 + dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2022-04-20-DG-SW-CONFIGS-Record.xlsx') - # 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 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. - dg.calibration_record.cmd_get_dg_calibration_record_report() + # Use this function to reset the configuration records to all be 0 + #dg.sw_configs.cmd_reset_dg_sw_config_record() - # Use cmd_set_dg_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 - #dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-02-14-DG-Record.xlsx') - # For resetting the calibration record to benign values, use the function below - #dg.calibration_record.cmd_reset_dg_calibration_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 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. + # dg.calibration_record.cmd_get_dg_calibration_record_report() + + # Use cmd_set_dg_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 + # dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-03-31-DG-Record.xlsx') + + # For resetting the calibration record to benign values, use the function below + dg.calibration_record.cmd_reset_dg_calibration_record() + + +if __name__ == "__main__": + + dg = DG(log_level="DEBUG") + + if dg.cmd_log_in_to_dg(): + + run_sw_configs_commands() + + #run_calibration_commands() +