Doloscmd: Integrate cable programming utility into Doloscmd
Migrates the cable programming into `doloscmd program-cable` so
it can be coupled with other Dolos device tools.
Adds the ability to detect the model name from the HWID giving
requiring fewer arguments to program.
Adds support for defaults other than '0' for the battery index.
Some HWID maps use 0 as null. Instead it uses the lowest index
as the default.
Fixes a bug in the model detection using prefixes only. This
created problems with models that had the same prefix.
Removes a duplicate read when programming the cable.
BUG=b:402853505
TEST=pytest
TEST=doloscmd program-cable examples from README.md
Change-Id: I40f90a62e82db3c403086b49d495877d59d7b959
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dolos/+/6355084
Tested-by: Brian Nemec <bnemec@google.com>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Commit-Queue: Keith Haddow <haddowk@chromium.org>
Auto-Submit: Brian Nemec <bnemec@google.com>
23 files changed