diff options
author | Andrew Scull <ascull@google.com> | 2018-02-21 15:13:39 +0000 |
---|---|---|
committer | Andrew Scull <ascull@google.com> | 2018-03-06 00:16:07 +0000 |
commit | e73bd6013d8077b098ace969eede790d420f8247 (patch) | |
tree | 68a77d8df4205ad5195ef08bb0f9982e9bc9fbaf /citadel | |
parent | eb197886b7a754d39405789383e8ab71654068a1 (diff) | |
download | android-e73bd6013d8077b098ace969eede790d420f8247.tar.gz |
Citadeld: expose hard reset to clients
Change-Id: I5c7d5992bb4e12744ced1920e3c3f4da716f5f93
Diffstat (limited to 'citadel')
-rw-r--r-- | citadel/citadeld/aidl/android/hardware/citadel/ICitadeld.aidl | 3 | ||||
-rw-r--r-- | citadel/citadeld/main.cpp | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/citadel/citadeld/aidl/android/hardware/citadel/ICitadeld.aidl b/citadel/citadeld/aidl/android/hardware/citadel/ICitadeld.aidl index 2ca6884..199d916 100644 --- a/citadel/citadeld/aidl/android/hardware/citadel/ICitadeld.aidl +++ b/citadel/citadeld/aidl/android/hardware/citadel/ICitadeld.aidl @@ -28,6 +28,9 @@ interface ICitadeld { */ int callApp(int appId, int arg, in byte[] request, out byte[] response); + /** Reset Citadel by pulling the reset line. */ + boolean reset(); + /** Runs a series of checks to ensure the devices is present, connected and responsive. */ boolean checkDevice(); } diff --git a/citadel/citadeld/main.cpp b/citadel/citadeld/main.cpp index 375a66f..41b2e88 100644 --- a/citadel/citadeld/main.cpp +++ b/citadel/citadeld/main.cpp @@ -66,6 +66,12 @@ struct CitadelProxy : public BnCitadeld { return Status::ok(); } + Status reset(bool* const _aidl_return) override { + const nos_device& device = *_client.Device(); + *_aidl_return = (device.ops.reset(device.ctx) == 0); + return Status::ok(); + } + Status checkDevice(bool* const _aidl_return) override { LOG(INFO) << "Running citadel device checks..."; *_aidl_return = android::citadeld::CheckDevice(_client.Device()); |