- def transmit_symbol(self, symbol):
- if symbol == ".":
- sleep_time = self.dot_time
- elif symbol == "-":
- sleep_time = self.dash_time
- elif symbol == " ":
- sleep_time = self.signalspace_time
- elif symbol == "/":
- sleep_time = self.wordspace_time
- elif symbol == "EOM":
- sleep_time = self.eom_time
- elif symbol is None:
- # To terminate the transmission just call and hangup, with no extra
- # distance
- sleep_time = self.call_setup_time
-
- logging.info("Dial and wait %.2f seconds (transmitting '%s')",
- sleep_time, symbol)
-
- # Dial, then wait self.call_setup_time to make sure the receiver gets
- # at least one RING, and then hangup and sleep the remaining time
- self.modem.send_command("ATDT" + self.destination_number + ";")
- time.sleep(self.call_setup_time)
+ def transmit_symbol(self, destination_number, symbol, sleep_time):
+ logging.info("Dial and wait %.2f = %.2f + %.2f seconds "
+ "(transmitting '%s')",
+ self.call_setup_time_max + sleep_time,
+ self.call_setup_time_max,
+ sleep_time,
+ symbol)
+
+ # Dial, then wait self.call_setup_time_max to make sure the receiver
+ # gets at least one RING, and then hangup and sleep the time needed to
+ # transmit a symbol.
+ self.modem.send_command("ATDT" + destination_number + ";")
+ time.sleep(self.call_setup_time_max)