Index: CN0_Python_Scripts/commands_rev_b.py =================================================================== diff -u -r2b4e5017c953ae23dfbedf1776eec9e492647aa9 -r855524c483c89b2cabf1b0fdb91227d5614b1639 --- CN0_Python_Scripts/commands_rev_b.py (.../commands_rev_b.py) (revision 2b4e5017c953ae23dfbedf1776eec9e492647aa9) +++ CN0_Python_Scripts/commands_rev_b.py (.../commands_rev_b.py) (revision 855524c483c89b2cabf1b0fdb91227d5614b1639) @@ -2,6 +2,11 @@ import struct import time from datetime import datetime + +exp_coeff = [3.1, 0.006, 0.6, -1.0, 3.1, 0.03, 2.0, 999.0, 1.5, 7.1, 100.11, 100.12] +exp_fw_ver = "v0.1.0" +exp_hw_ver = "EFGH" +exp_sn = "IJKL" ######################################################################################################################## # This function reads the sensor data and settings # {"poll", cmd_poll}, @@ -136,7 +141,7 @@ data = cond1.ser.read(7) data_count = data_count + 1 # print(data) - # parser.parse_autopoll(data) + parser.parse_autopoll(data) print(data_count) ######################################################################################################################## @@ -208,8 +213,7 @@ ######################################################################################################################## # This function updates the hardware version number in the flash. # {"sethw", cmd_set_hardware_ver}, -def cmd_set_hardware_ver(cond1): - value = "EFGH" +def cmd_set_hardware_ver(cond1, value): cmd = f"sethw {value}\n" cond1.ser.reset_input_buffer() cond1.ser.write(cmd.encode("ascii")) @@ -225,8 +229,7 @@ ######################################################################################################################## # This function updates the serial number in the flash. # {"setsn", cmd_set_serial_num}, -def cmd_set_serial_num(cond1): - value = "IJKL" +def cmd_set_serial_num(cond1, value): cmd = f"setsn {value}\n" cond1.ser.reset_input_buffer() cond1.ser.write(cmd.encode("ascii")) @@ -248,7 +251,9 @@ print("Sent command cmd_get_cal_ver_bin") data = cond1.ser.read(80) print(data) - parser.parse_coeff_and_version(data) + # parser.parse_coeff_and_version(data) + status = parser.verify_coeffs_and_versions(data, exp_coeff, exp_fw_ver,exp_hw_ver,exp_sn,1e-5) + parser.print_verification_results(status) ######################################################################################################################## # This function prints the current data and time