1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.car.diagnostic; 18 19 import android.car.diagnostic.CarDiagnosticEvent; 20 import android.car.diagnostic.ICarDiagnosticEventListener; 21 22 /** @hide */ 23 interface ICarDiagnostic { 24 /** 25 * Register a callback (or update registration) for diagnostic events. 26 */ registerOrUpdateDiagnosticListener(int frameType, int rate, in ICarDiagnosticEventListener listener)27 boolean registerOrUpdateDiagnosticListener(int frameType, int rate, 28 in ICarDiagnosticEventListener listener) = 1; 29 30 /** 31 * Get the value for the most recent live frame data available. 32 */ getLatestLiveFrame()33 CarDiagnosticEvent getLatestLiveFrame() = 2; 34 35 /** 36 * Get the list of timestamps for which there exist a freeze frame stored. 37 */ getFreezeFrameTimestamps()38 long[] getFreezeFrameTimestamps() = 3; 39 40 /** 41 * Get the value for the freeze frame stored given a timestamp. 42 */ getFreezeFrame(long timestamp)43 CarDiagnosticEvent getFreezeFrame(long timestamp) = 4; 44 45 /** 46 * Erase freeze frames given timestamps (or all, if no timestamps). 47 */ clearFreezeFrames(in long[] timestamps)48 boolean clearFreezeFrames(in long[] timestamps) = 5; 49 50 /** 51 * Stop receiving diagnostic events for a given callback. 52 */ unregisterDiagnosticListener(int frameType, in ICarDiagnosticEventListener callback)53 void unregisterDiagnosticListener(int frameType, 54 in ICarDiagnosticEventListener callback) = 6; 55 56 /** 57 * Returns whether the underlying HAL supports live frames. 58 */ isLiveFrameSupported()59 boolean isLiveFrameSupported() = 7; 60 61 /** 62 * Returns whether the underlying HAL supports sending notifications to 63 * registered listeners when new freeze frames happen. 64 */ isFreezeFrameNotificationSupported()65 boolean isFreezeFrameNotificationSupported() = 8; 66 67 /** 68 * Returns whether the underlying HAL supports retrieving freeze frames 69 * stored in vehicle memory using timestamp. 70 */ isGetFreezeFrameSupported()71 boolean isGetFreezeFrameSupported() = 9; 72 73 /** 74 * Returns whether the underlying HAL supports clearing freeze frames. 75 */ isClearFreezeFramesSupported()76 boolean isClearFreezeFramesSupported() = 10; 77 78 /** 79 * Returns whether the underlying HAL supports clearing specific freeze frames specified 80 * by means of their timestamps. 81 */ isSelectiveClearFreezeFramesSupported()82 boolean isSelectiveClearFreezeFramesSupported() = 11; 83 } 84