# -*- coding: utf-8 -*- ## # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # copyright # 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 tst_post # date 2020/12/27 # author Behrouz NematiPour # # NOTE: # This test is a demo and is intended to be used as an example on how to call the dialin API within SquishQt. import names # from time import sleep from dialin.ui import utils from dialin.ui import unittests from dialin.ui.hd_simulator import HDSimulator # from dialin.ui.dg_simulator import DGSimulator # from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator ITEM_INDICES = [5, 10, 2, 15, 8, 19, 11, 20] def main(): utils.tstStart("demo") startApplication("denaliSquish") hd = HDSimulator() #dg = DGSimulator() hd.cmd_send_power_on_self_test_version_request() hd.cmd_send_hd_operation_mode(0, 0) def post_a_message_and_verify_progress_and_completion(): for index in ITEM_INDICES: hd.cmd_send_hd_post(index, False, True) def verify_progress_and_completion_upon_sending_the_message(final_msg=None, done=None) -> None: # for i in range(20): # hd.cmd_send_hd_post(i, True, False) # snooze(0.1) # hd.cmd_send_hd_post(0, True, True) # # # unittests.test_python_version() # unittests.test_crc8() # unittests.test_can0() utils.tstDone()