Resume command mode after dialing, always
authorAntonio Ospite <ao2@ao2.it>
Thu, 17 Dec 2015 17:08:50 +0000 (18:08 +0100)
committerAntonio Ospite <ao2@ao2.it>
Thu, 17 Dec 2015 17:08:50 +0000 (18:08 +0100)
Put a semicolon after the AT command when dialing the destination
number. Without this, some modems won't accept the ATH command and won't
be able to terminate a call before the receiver has answered.

src/measure_call_setup_time.py
src/measure_ring_distance.py
src/savemysugar/Modem.py

index 6268145..4de937c 100755 (executable)
@@ -49,7 +49,7 @@ def measure_call_setup_time(ingoing_port, outgoing_port, destination_number):
     for i in range(5):
         print()
         print("Attempt: %s" % (i + 1))
-        outgoing_modem.send_command("ATDT" + destination_number)
+        outgoing_modem.send_command("ATDT" + destination_number + ";")
         dial_time = time.time()
 
         # Wait for the receiver to get a ring before terminating the call
index 87f6da3..c5c34fd 100755 (executable)
@@ -59,7 +59,7 @@ def measure_ring_distance(ingoing_port, outgoing_port, destination_number):
     ingoing_modem.register_callback("RING", on_ring)
     outgoing_modem = Modem(outgoing_port)
 
-    outgoing_modem.send_command("ATDT" + destination_number)
+    outgoing_modem.send_command("ATDT" + destination_number + ";")
 
     try:
         ingoing_modem.get_response_loop()
index 073b742..5bdc411 100755 (executable)
@@ -153,7 +153,7 @@ def test(port, number):
             time_difference = time2 - time1
             print("time difference: %.2f" % time_difference)
             time1 = time.time()
-            modem.send_command("ATDT" + number)
+            modem.send_command("ATDT" + number + ";")
 
             call_setup_time = 9
             inter_call_sleep = 5