CallDistanceTransceiver.py: use the modulator member in test_send_receive()
authorAntonio Ospite <ao2@ao2.it>
Sat, 2 Jan 2016 15:19:16 +0000 (16:19 +0100)
committerAntonio Ospite <ao2@ao2.it>
Sun, 3 Jan 2016 18:59:49 +0000 (19:59 +0100)
src/savemysugar/CallDistanceTransceiver.py

index 4a7e139..588c985 100755 (executable)
@@ -427,21 +427,24 @@ def test_send_receive():
         def get_response(self, response):
             # pylint: disable=unused-argument
 
         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 '.'
 
             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 '/'
             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'
             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
 
             self.ring_count += 1
             self.ring_count %= 4