From 4b4fa200b36e027b14b13fc15b91a81863716150 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 17 Dec 2015 18:08:50 +0100 Subject: [PATCH] Resume command mode after dialing, always 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 | 2 +- src/measure_ring_distance.py | 2 +- src/savemysugar/Modem.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/measure_call_setup_time.py b/src/measure_call_setup_time.py index 6268145..4de937c 100755 --- a/src/measure_call_setup_time.py +++ b/src/measure_call_setup_time.py @@ -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 diff --git a/src/measure_ring_distance.py b/src/measure_ring_distance.py index 87f6da3..c5c34fd 100755 --- a/src/measure_ring_distance.py +++ b/src/measure_ring_distance.py @@ -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() diff --git a/src/savemysugar/Modem.py b/src/savemysugar/Modem.py index 073b742..5bdc411 100755 --- a/src/savemysugar/Modem.py +++ b/src/savemysugar/Modem.py @@ -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 -- 2.1.4