Add DBus API

To enable externally initiated firmware upgrades to be used
with e.g. autotest.

- Add DBus method for initiating firmware upgrade, as well as for
  enabling/disabling diagnostics.
- Add |force| flag to atrusctl::PerformUpgrade to allow for upgrading
  regardless of current FW on device
- Make sure diagnostics timer is always stopped when |diagnostics_| goes
  out of scope
- Remove unused command-line arguments from daemon
- Some refactoring in Atrusd class, moved functionality to AtrusController

BUG=None
TEST=ran:
"dbus-send --system --print-reply --type=method_call \
--dest=org.chromium.Atrusctl /org/chromium/Atrusctl \
org.chromium.Atrusctl.ForceFirmwareUpgrade \
string:'/lib/firmware/google/atrus-fw-bundle-latest.bin'" \
as root and confirmed that upgrade was performed successfully.
Also confirmed that enabling/disabling diagnostics with dbus-send works as
expected.
CQ-DEPEND=CL:677391

Change-Id: I940bb4963f56b56bc8a8f3b5564ee9d26ad85ff9
Reviewed-on: https://chromium-review.googlesource.com/677389
Commit-Ready: Karl Petersson <karlpeterson@chromium.org>
Tested-by: Karl Petersson <karlpeterson@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
19 files changed
tree: 5e9a35e1a4155c1d648f5111b0a04f3521a58b1e
  1. .gitignore
  2. COMMIT-QUEUE.ini
  3. LICENSE
  4. README.md
  5. atrusctl.gyp
  6. conf/
  7. dbus_bindings/
  8. dbus_permissions/
  9. init/
  10. src/
README.md

atrusctl

This tool is used to interact with Atrus speakerphones.