mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-14 12:22:20 -05:00
Fixed a problem with send-message command
This patch fixes a problem with the packets object not being initialized correctly for the send-message command from the command line. Also adds the --wait-response option for send-message, which by default is now False
This commit is contained in:
parent
0d5b7166b3
commit
49f3ea8339
@ -276,6 +276,14 @@ def sample_config():
|
|||||||
default=False,
|
default=False,
|
||||||
help="Don't wait for an ack, just sent it to APRS-IS and bail.",
|
help="Don't wait for an ack, just sent it to APRS-IS and bail.",
|
||||||
)
|
)
|
||||||
|
@click.option(
|
||||||
|
"--wait-response",
|
||||||
|
"-w",
|
||||||
|
is_flag=True,
|
||||||
|
show_default=True,
|
||||||
|
default=False,
|
||||||
|
help="Wait for a response to the message?",
|
||||||
|
)
|
||||||
@click.option("--raw", default=None, help="Send a raw message. Implies --no-ack")
|
@click.option("--raw", default=None, help="Send a raw message. Implies --no-ack")
|
||||||
@click.argument("tocallsign", required=False)
|
@click.argument("tocallsign", required=False)
|
||||||
@click.argument("command", nargs=-1, required=False)
|
@click.argument("command", nargs=-1, required=False)
|
||||||
@ -286,6 +294,7 @@ def send_message(
|
|||||||
aprs_login,
|
aprs_login,
|
||||||
aprs_password,
|
aprs_password,
|
||||||
no_ack,
|
no_ack,
|
||||||
|
wait_response,
|
||||||
raw,
|
raw,
|
||||||
tocallsign,
|
tocallsign,
|
||||||
command,
|
command,
|
||||||
@ -316,6 +325,9 @@ def send_message(
|
|||||||
else:
|
else:
|
||||||
LOG.info(f"L'{aprs_login}' To'{tocallsign}' C'{command}'")
|
LOG.info(f"L'{aprs_login}' To'{tocallsign}' C'{command}'")
|
||||||
|
|
||||||
|
packets.WatchList(config=config)
|
||||||
|
packets.SeenList(config=config)
|
||||||
|
|
||||||
got_ack = False
|
got_ack = False
|
||||||
got_response = False
|
got_response = False
|
||||||
|
|
||||||
@ -348,7 +360,11 @@ def send_message(
|
|||||||
)
|
)
|
||||||
ack.send_direct()
|
ack.send_direct()
|
||||||
|
|
||||||
if got_ack and got_response:
|
if got_ack:
|
||||||
|
if wait_response:
|
||||||
|
if got_response:
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user