diff --git a/tools/freedata_cli_tools.py b/tools/freedata_cli_tools.py old mode 100644 new mode 100755 diff --git a/tools/freedata_network_listener.py b/tools/freedata_network_listener.py old mode 100644 new mode 100755 diff --git a/tools/send_file.py b/tools/send_file.py old mode 100644 new mode 100755 diff --git a/tools/enable_disable_beacon.py b/tools/send_ping.py similarity index 58% rename from tools/enable_disable_beacon.py rename to tools/send_ping.py index b585cee4..04333cd3 100644 --- a/tools/enable_disable_beacon.py +++ b/tools/send_ping.py @@ -1,39 +1,36 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -enable --- python3.9 enable_disable_beacon.py --host 192.168.178.42 --interval 120 --enable -disable -- python3.9 enable_disable_beacon.py + @author: DJ2LS +python3 send_file.py --file cleanup.sh --dxcallsign DN2LS-0 --mycallsign DN2LS-2 --attempts 3 """ import argparse import socket -import base64 import json # --------------------------------------------GET PARAMETER INPUTS parser = argparse.ArgumentParser(description='Simons TEST TNC') parser.add_argument('--port', dest="socket_port", default=3000, help="Set socket listening port.", type=int) parser.add_argument('--host', dest="socket_host", default='localhost', help="Set the host, the socket is listening on.", type=str) -parser.add_argument('--interval', dest="interval", default=120, help="Interval in seconds", type=int) -parser.add_argument("--enable",dest="enable",action="store_true",help="Enable beacon",) - +parser.add_argument('--dxcallsign', dest="dxcallsign", default='AA0AA', help="Select the destination callsign", type=str) +parser.add_argument('--mycallsign', dest="mycallsign", default='AA0AA', help="Select the own callsign", type=str) args = parser.parse_args() - HOST, PORT = args.socket_host, args.socket_port -interval = args.interval -enable = args.enable - -if enable: - # our command we are going to send - command = {"type": "broadcast", "command": "start_beacon", "parameter": str(interval)} -else: - command = {"type": "broadcast", "command": "stop_beacon"} +dxcallsign = args.dxcallsign +mycallsign = args.mycallsign +# our command we are going to send +command = {"type": "ping", + "command": "ping", + "dxcallsign": dxcallsign, + "mycallsign": mycallsign, + } command = json.dumps(command) command = bytes(command + "\n", 'utf-8') # Create a socket (SOCK_STREAM means a TCP socket)