Index: tests/peter/set_RTCs.py =================================================================== diff -u -r5e7404aa3f3a630e3d831643a4c7e91769d387ea -r3a70bfb451b74106348c064c34f19934aadd9119 --- tests/peter/set_RTCs.py (.../set_RTCs.py) (revision 5e7404aa3f3a630e3d831643a4c7e91769d387ea) +++ tests/peter/set_RTCs.py (.../set_RTCs.py) (revision 3a70bfb451b74106348c064c34f19934aadd9119) @@ -1,16 +1,16 @@ ########################################################################### # -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# Copyright (c) 2021-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 set_RTCs.py +# @file set_RTCs.py # -# @author (last) Sean Nash -# @date (last) 14-Aug-2020 -# @author (original) Sean Nash -# @date (original) 05-Aug-2020 +# @author (last) Quang Nguyen +# @date (last) 13-May-2021 +# @author (original) Peter Lucia +# @date (original) 29-Apr-2021 # ############################################################################ @@ -24,17 +24,26 @@ if __name__ == "__main__": # create an HD object called hd hd = HD(log_level="DEBUG") + dg = DG(log_level="DEBUG") - if hd.cmd_log_in_to_hd(): - current_time_stamp = time() - current_time = localtime(current_time_stamp) - print(current_time) + current_time_stamp = time() + current_time = localtime(current_time_stamp) + print(current_time) + if hd.cmd_log_in_to_hd(): hd.rtc.cmd_set_rtc_time_and_date(current_time.tm_sec, current_time.tm_min, current_time.tm_hour, current_time.tm_mday, current_time.tm_mon, current_time.tm_year) print("Successfully set HD rtc") - #TODO - set DG clock when supported + + if dg.cmd_log_in_to_dg(): + dg.rtc.cmd_set_rtc_time_and_date(current_time.tm_sec, + current_time.tm_min, + current_time.tm_hour, + current_time.tm_mday, + current_time.tm_mon, + current_time.tm_year) + print("Successfully set DG rtc")