From 78fd1e817fd08b35b4e04d3315374c9c9bc0d898 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 2 Jan 2016 16:19:16 +0100 Subject: [PATCH] CallDistanceTransceiver.py: use the modulator member in test_send_receive() --- src/savemysugar/CallDistanceTransceiver.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/savemysugar/CallDistanceTransceiver.py b/src/savemysugar/CallDistanceTransceiver.py index 4a7e139..588c985 100755 --- a/src/savemysugar/CallDistanceTransceiver.py +++ b/src/savemysugar/CallDistanceTransceiver.py @@ -427,21 +427,24 @@ def test_send_receive(): def get_response(self, response): # 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 -- 2.1.4