|
25 | 25 | @click.argument("radio", type=click.Choice(list(RADIO_TO_PACKAGE.keys())))
|
26 | 26 | @click.argument("port", type=str)
|
27 | 27 | @click.option("--baudrate", type=int, default=None)
|
| 28 | +@click.option("--flow-control", type=click.Choice(["software", "xonoff", "hardware", "rtscts", "none"]), default=None) |
28 | 29 | @click.option("--database", type=str, default=None)
|
29 | 30 | @click_coroutine
|
30 |
| -async def radio(ctx, radio, port, baudrate=None, database=None): |
| 31 | +async def radio(ctx, radio, port, baudrate=None, flow_control=None, database=None): |
31 | 32 | # Setup logging for the radio
|
32 | 33 | verbose = ctx.parent.params["verbose"]
|
33 | 34 | logging_configs = RADIO_LOGGING_CONFIGS[radio]
|
@@ -60,6 +61,12 @@ async def radio(ctx, radio, port, baudrate=None, database=None):
|
60 | 61 | if baudrate is not None:
|
61 | 62 | config["device"]["baudrate"] = baudrate
|
62 | 63 |
|
| 64 | + if flow_control == "hardware" or flow_control == "rtscts": |
| 65 | + config["device"]["flow_control"] = "hardware" |
| 66 | + |
| 67 | + if flow_control == "software" or flow_control == "xonoff": |
| 68 | + config["device"]["flow_control"] = "software" |
| 69 | + |
63 | 70 | app = radio_module.ControllerApplication(config)
|
64 | 71 |
|
65 | 72 | ctx.obj = app
|
|
0 commit comments