Skip to content

Commit

Permalink
python: default to dronin vid:pid for usb telemetry (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
tracernz authored and mlyle committed Jul 3, 2019
1 parent 3b6e3ca commit 8844e73
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/dronin/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ def get_telemetry_by_args(desc="Process telemetry", service_in_iter=True,
dest = "log_level",
help = "use usb hid to communicate with FC")

parser.add_argument("source",
parser.add_argument("source", default=None, nargs='?',
help = "file, host:port, vid:pid, command, or serial port")

# Parse the command-line.
Expand All @@ -1156,8 +1156,16 @@ def get_telemetry_by_args(desc="Process telemetry", service_in_iter=True,
else:
args = parser.parse_args(arguments)

setup_logging(args.log_level)
if args.source is None:
if args.hid:
# firmware vid:pid for all dR boards
args.source = '20a0:4250'
else:
print('source must be provided', file=sys.stderr)
parser.print_usage()
sys.exit(1)

setup_logging(args.log_level)
ret = _finish_telemetry_args(parser, args, service_in_iter, iter_blocks)

if arg_parser is None:
Expand Down

0 comments on commit 8844e73

Please sign in to comment.