From: Antonio Ospite Date: Thu, 17 Dec 2015 17:08:50 +0000 (+0100) Subject: Resume command mode after dialing, always X-Git-Url: https://git.ao2.it/SaveMySugar/python3-savemysugar.git/commitdiff_plain/4b4fa200b36e027b14b13fc15b91a81863716150?ds=sidebyside;hp=b7aafba377812e53114f81efb89d8e7faa1b3445 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. --- 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