Skip to content
Snippets Groups Projects
Commit 4e1bcf3b authored by chrissi^'s avatar chrissi^
Browse files

Add --hold-tx to test PTT


Signed-off-by: default avatarChris Fiege <chris@tinyhost.de>
parent 2f0d4ad8
No related branches found
No related tags found
No related merge requests found
import argparse
import serial
import logging
import time
class SA868(object):
......@@ -89,6 +90,14 @@ class SA868(object):
0 if highpass else 1),
"+DMOSETFILTER:")
def set_tx(self, state):
if state:
self._serial.rts = True
self._logger.info("Activating TX")
else:
self._logger.info("Deactivatig TX")
self._serial.rts = False
def main():
parser = argparse.ArgumentParser()
......@@ -98,6 +107,7 @@ def main():
parser.add_argument("--set-filter", help="Sets the pre-/de-emphasis, highpass- and lowpass-filter. Use {off, on}", nargs=3, metavar=("pre_de_emphasis", "lowpass", "highpass"))
parser.add_argument("--get-rssi", help="Prints the current RSSI to STDOUT", action="store_true")
parser.add_argument("--no-ping", help="Disables the initial ping of the device", action="store_true")
parser.add_argument("--hold-tx", help="Asserts tx for N seconds", nargs=1, type=float)
parser.add_argument("-v", help="Be more verbose", action="store_true")
args = parser.parse_args()
......@@ -123,5 +133,10 @@ def main():
if args.get_rssi:
print(s.get_rssi())
if args.hold_tx:
s.set_tx(True)
time.sleep(args.hold_tx[0])
s.set_tx(False)
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment