projects
/
SaveMySugar
/
python3-savemysugar.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
922df45
)
CallDistanceTransceiver.py: use the modulator member in test_send_receive()
author
Antonio Ospite <ao2@ao2.it>
Sat, 2 Jan 2016 15:19:16 +0000
(16:19 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Sun, 3 Jan 2016 18:59:49 +0000
(19:59 +0100)
src/savemysugar/CallDistanceTransceiver.py
patch
|
blob
|
history
diff --git
a/src/savemysugar/CallDistanceTransceiver.py
b/src/savemysugar/CallDistanceTransceiver.py
index
4a7e139
..
588c985
100755
(executable)
--- 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
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