X-Git-Url: https://git.ao2.it/SaveMySugar/python3-savemysugar.git/blobdiff_plain/922df45b75d830d843ce92167a57c62f97c47762..4f0ba97096eb32ae9c8fca21a6e4fce597b674ee:/src/savemysugar/CallDistanceTransceiver.py diff --git a/src/savemysugar/CallDistanceTransceiver.py b/src/savemysugar/CallDistanceTransceiver.py index 4a7e139..3cc4a12 100755 --- a/src/savemysugar/CallDistanceTransceiver.py +++ b/src/savemysugar/CallDistanceTransceiver.py @@ -424,24 +424,27 @@ def test_send_receive(): def send_command(self, command): pass - def get_response(self, response): + def get_response(self, response=None): # pylint: disable=unused-argument - setup_time = random.uniform(self.transceiver.call_setup_time_min, - self.transceiver.call_setup_time_max) + setup_time = random.uniform(self.transceiver.modulator.period_min, + self.transceiver.modulator.period_max) if self.ring_count == 0: # dummy ring pass elif self.ring_count == 1: # received a '.' - time.sleep(setup_time + self.transceiver.dot_time.dist) + dot_time = self.transceiver.modulator.dot_time.dist + time.sleep(setup_time + dot_time) elif self.ring_count == 2: # received a '/' - time.sleep(setup_time + self.transceiver.wordspace_time.dist) + wordspace_time = self.transceiver.modulator.wordspace_time.dist + time.sleep(setup_time + wordspace_time) else: # received an 'EOM' - time.sleep(setup_time + self.transceiver.eom_time.dist) + eom_time = self.transceiver.modulator.eom_time.dist + time.sleep(setup_time + eom_time) self.ring_count += 1 self.ring_count %= 4 @@ -454,6 +457,8 @@ def test_send_receive(): modem.transceiver = xcv + xcv.transmit("CODEX PARIS", "0") + while True: xcv.receive_loop() modem.ring_count = 0