CallDistanceTransceiver.py: fix a print format in a debug message
[SaveMySugar/python3-savemysugar.git] / src / savemysugar / CallDistanceTransceiver.py
index fd60a1f..d29b302 100755 (executable)
@@ -143,10 +143,10 @@ class CallDistanceTransceiver(object):
             self.previous_call_time = current_ring_time
             self.log_symbol(0, "", "(The very first ring)")
             return
             self.previous_call_time = current_ring_time
             self.log_symbol(0, "", "(The very first ring)")
             return
-        else:
-            ring_distance = current_ring_time - self.previous_ring_time
-            logging.debug("RINGs distance: %.2f", ring_distance)
-            self.previous_ring_time = current_ring_time
+
+        ring_distance = current_ring_time - self.previous_ring_time
+        logging.debug("RINGs distance: %.2f", ring_distance)
+        self.previous_ring_time = current_ring_time
 
         # Ignore multiple rings in the same call
         if abs(ring_distance - self.rings_distance) < self.ring_uncertainty:
 
         # Ignore multiple rings in the same call
         if abs(ring_distance - self.rings_distance) < self.ring_uncertainty:
@@ -191,7 +191,7 @@ class CallDistanceTransceiver(object):
             return
 
         # if the code made it up to here, something fishy is going on
             return
 
         # if the code made it up to here, something fishy is going on
-        logging.error("Unexpected distance: %.2f", ring_distance)
+        logging.error("Unexpected distance: %.2f", call_distance)
         logging.error("Check the transmitter and receiver parameters")
 
     def receive_loop(self):
         logging.error("Check the transmitter and receiver parameters")
 
     def receive_loop(self):
@@ -228,7 +228,7 @@ class CallDistanceTransceiver(object):
 
         # 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
 
         # 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)
+        self.modem.send_command("ATDT" + self.destination_number + ";")
         time.sleep(self.call_setup_time)
         self.modem.send_command("ATH")
         self.modem.get_response()
         time.sleep(self.call_setup_time)
         self.modem.send_command("ATH")
         self.modem.get_response()
@@ -289,7 +289,7 @@ class CallDistanceTransceiver(object):
 
         transmitting_time += self.eom_time
 
 
         transmitting_time += self.eom_time
 
-        logging.debug("Estimated transmitting time: %d seconds",
+        logging.debug("Estimated transmitting time: %.2f seconds",
                       transmitting_time)
 
 
                       transmitting_time)