mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
updated cli tools cq and ping
This commit is contained in:
parent
242b4adc5f
commit
e069be45ba
|
@ -17,6 +17,8 @@ parser.add_argument('--port', dest="socket_port", default=3000, help="Set socket
|
||||||
parser.add_argument('--host', dest="socket_host", default='localhost', help="Set the host, the socket is listening on.", type=str)
|
parser.add_argument('--host', dest="socket_host", default='localhost', help="Set the host, the socket is listening on.", type=str)
|
||||||
parser.add_argument('--dxcallsign', dest="dxcallsign", default='AA0AA', help="Select the destination callsign", type=str)
|
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)
|
parser.add_argument('--mycallsign', dest="mycallsign", default='AA0AA', help="Select the own callsign", type=str)
|
||||||
|
parser.add_argument('--ping', dest="ping", action="store_true", help="Send PING", type=str)
|
||||||
|
parser.add_argument('--cq', dest="cq", action="store_true", help="Send CQ", type=str)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
@ -25,12 +27,17 @@ dxcallsign = args.dxcallsign
|
||||||
mycallsign = args.mycallsign
|
mycallsign = args.mycallsign
|
||||||
|
|
||||||
# our command we are going to send
|
# our command we are going to send
|
||||||
command = {"type": "ping",
|
if args.ping:
|
||||||
"command": "ping",
|
command = {"type": "ping",
|
||||||
"dxcallsign": dxcallsign,
|
"command": "ping",
|
||||||
"mycallsign": mycallsign,
|
"dxcallsign": dxcallsign,
|
||||||
|
"mycallsign": mycallsign,
|
||||||
}
|
}
|
||||||
|
if args.cq:
|
||||||
|
command = {"type": "broadcast",
|
||||||
|
"command": "cqcqcq",
|
||||||
|
"mycallsign": mycallsign,
|
||||||
|
}
|
||||||
command = json.dumps(command)
|
command = json.dumps(command)
|
||||||
command = bytes(command + "\n", 'utf-8')
|
command = bytes(command + "\n", 'utf-8')
|
||||||
# Create a socket (SOCK_STREAM means a TCP socket)
|
# Create a socket (SOCK_STREAM means a TCP socket)
|
Loading…
Reference in a new issue