diff --git a/aprsd/cmds/dev.py b/aprsd/cmds/dev.py index 5a910e5..a1d4e77 100644 --- a/aprsd/cmds/dev.py +++ b/aprsd/cmds/dev.py @@ -24,6 +24,12 @@ def dev(ctx): @dev.command() +@click.option( + "--aprs-login", + envvar="APRS_LOGIN", + show_envvar=True, + help="What callsign to send the message from.", +) @click.option( "-p", "--plugin", @@ -49,19 +55,19 @@ def dev(ctx): default=1, help="Number of times to call the plugin", ) -@click.argument("fromcall") @click.argument("message", nargs=-1, required=True) @click.pass_context def test_plugin( ctx, + aprs_login, plugin_path, load_all, number, - fromcall, message, ): """APRSD Plugin test app.""" config = ctx.obj["config"] + fromcall = aprs_login if not plugin_path: click.echo(ctx.get_help()) @@ -79,6 +85,12 @@ def test_plugin( else: pm._init() obj = pm._create_class(plugin_path, plugin.APRSDPluginBase, config=config) + if not obj: + click.echo(ctx.get_help()) + click.echo("") + ctx.fail(f"Failed to create object from plugin path '{plugin_path}'") + ctx.exit() + # Register the plugin they wanted tested. LOG.info( "Testing plugin {} Version {}".format( diff --git a/aprsd/cmds/listen.py b/aprsd/cmds/listen.py index 69f258d..f44e710 100644 --- a/aprsd/cmds/listen.py +++ b/aprsd/cmds/listen.py @@ -62,7 +62,12 @@ def listen( ): """Listen to packets on the APRS-IS Network based on FILTER. - FILTER is the APRS Filter to use. see http://www.aprs-is.net/javAPRSFilter.aspx + FILTER is the APRS Filter to use.\n + see http://www.aprs-is.net/javAPRSFilter.aspx\n + r/lat/lon/dist - Range Filter Pass posits and objects within dist km from lat/lon.\n + p/aa/bb/cc... - Prefix Filter Pass traffic with fromCall that start with aa or bb or cc.\n + b/call1/call2... - Budlist Filter Pass all traffic from exact call: call1, call2, ... (* wild card allowed) \n + o/obj1/obj2... - Object Filter Pass all objects with the exact name of obj1, obj2, ... (* wild card allowed)\n """ config = ctx.obj["config"] diff --git a/aprsd/cmds/send_message.py b/aprsd/cmds/send_message.py index 89f770c..d09869f 100644 --- a/aprsd/cmds/send_message.py +++ b/aprsd/cmds/send_message.py @@ -83,6 +83,10 @@ def send_message( else: LOG.info(f"L'{aprs_login}' To'{tocallsign}' C'{command}'") + packets.PacketList(config=config) + packets.WatchList(config=config) + packets.SeenList(config=config) + got_ack = False got_response = False @@ -128,8 +132,6 @@ def send_message( except LoginError: sys.exit(-1) - packets.PacketList(config=config) - packets.WatchList(config=config) # Send a message # then we setup a consumer to rx messages diff --git a/aprsd/cmds/server.py b/aprsd/cmds/server.py index 4b4d692..e818c6b 100644 --- a/aprsd/cmds/server.py +++ b/aprsd/cmds/server.py @@ -29,7 +29,7 @@ LOG = logging.getLogger("APRSD") ) @click.pass_context def server(ctx, flush): - """Start the aprsd server process.""" + """Start the aprsd server gateway process.""" ctx.obj["config_file"] loglevel = ctx.obj["loglevel"] quiet = ctx.obj["quiet"]