Skip to content

Commit

Permalink
decode-reg: support serial interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericonr committed Dec 15, 2023
1 parent af2d07b commit d0fac7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/decode-reg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ int main(int argc, char *argv[])
argparse::ArgumentParser parent_args("decode-reg", "1.0", argparse::default_arguments::none);
parent_args.add_argument("--slot").help("device slot");
parent_args.add_argument("--address").help("device address");
parent_args.add_argument("--serial").help("device serial port");
parent_args.add_argument("-a").help("enumerated position of device").required().scan<'u', unsigned>().default_value((unsigned)0);
parent_args.add_argument("-v").help("verbose output").default_value(false).implicit_value(true);

Expand Down Expand Up @@ -139,8 +140,9 @@ int main(int argc, char *argv[])
struct pcie_bars bars;
if (auto v = args.present<std::string>("--slot")) dev_open_slot(bars, v->c_str());
else if (auto v = args.present<std::string>("--address")) dev_open(bars, v->c_str());
else if (auto v = args.present<std::string>("--serial")) dev_open_serial(bars, v->c_str());
else {
fputs("no device specified (--slot, --address)\n", stderr);
fputs("no device specified (--slot, --address, --serial)\n", stderr);
return 1;
}

Expand Down

0 comments on commit d0fac7c

Please sign in to comment.