Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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.hardware.wifi@1.0; |
| 18 | |
| 19 | interface IWifiChipEventCallback { |
| 20 | /** |
| 21 | * Callback indicating that the chip has been reconfigured successfully. At |
| 22 | * this point the interfaces available in the mode must be able to be |
Roshan Pius | 2c06a3f | 2016-12-15 17:51:40 -0800 | [diff] [blame] | 23 | * configured. When this is called any previous iface objects must be |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 24 | * considered invalid. |
| 25 | * |
| 26 | * @param modeId The mode that the chip switched to, corresponding to the id |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 27 | * property of the target ChipMode. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 28 | */ |
| 29 | oneway onChipReconfigured(ChipModeId modeId); |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
Roshan Pius | 2c06a3f | 2016-12-15 17:51:40 -0800 | [diff] [blame] | 32 | * Callback indicating that a chip reconfiguration failed. This is a fatal |
| 33 | * error and any iface objects available previously must be considered |
| 34 | * invalid. The client can attempt to recover by trying to reconfigure the |
| 35 | * chip again using |IWifiChip.configureChip|. |
| 36 | * |
| 37 | * @param status Failure reason code. |
| 38 | */ |
| 39 | oneway onChipReconfigureFailure(WifiStatus status); |
| 40 | |
| 41 | /** |
| 42 | * Callback indicating that a new iface has been added to the chip. |
| 43 | * |
| 44 | * @param type Type of iface added. |
| 45 | * @param name Name of iface added. |
| 46 | */ |
| 47 | oneway onIfaceAdded(IfaceType type, string name); |
| 48 | |
| 49 | /** |
| 50 | * Callback indicating that an existing iface has been removed from the chip. |
| 51 | * |
| 52 | * @param type Type of iface removed. |
| 53 | * @param name Name of iface removed. |
| 54 | */ |
| 55 | oneway onIfaceRemoved(IfaceType type, string name); |
| 56 | |
| 57 | /** |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 58 | * Callbacks for reporting debug ring buffer data. |
| 59 | * |
| 60 | * The ring buffer data collection is event based: |
| 61 | * - Driver calls this callback when new records are available, the |
| 62 | * |WifiDebugRingBufferStatus| passed up to framework in the callback |
| 63 | * indicates to framework if more data is available in the ring buffer. |
| 64 | * It is not expected that driver will necessarily always empty the ring |
| 65 | * immediately as data is available, instead driver will report data |
| 66 | * every X seconds or if N bytes are available based on the parameters |
| 67 | * set via |startLoggingToDebugRingBuffer|. |
| 68 | * - In the case where a bug report has to be captured, framework will |
| 69 | * require driver to upload all data immediately. This is indicated to |
| 70 | * driver when framework calls |forceDumpToDebugRingBuffer|. The driver |
| 71 | * will start sending all available data in the indicated ring by repeatedly |
| 72 | * invoking this callback. |
| 73 | * |
| 74 | * @return status Status of the corresponding ring buffer. This should |
| 75 | * contain the name of the ring buffer on which the data is |
| 76 | * available. |
Roshan Pius | 48185b2 | 2016-12-15 19:10:30 -0800 | [diff] [blame] | 77 | * @return data Raw bytes of data sent by the driver. Must be dumped |
| 78 | * out to a bugreport and post processed. |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 79 | */ |
Roshan Pius | 48185b2 | 2016-12-15 19:10:30 -0800 | [diff] [blame] | 80 | oneway onDebugRingBufferDataAvailable( |
| 81 | WifiDebugRingBufferStatus status, vec<uint8_t> data); |
Roshan Pius | 203cb03 | 2016-12-14 17:41:20 -0800 | [diff] [blame] | 82 | |
| 83 | /** |
| 84 | * Callback indicating that the chip has encountered a fatal error. |
| 85 | * Client must not attempt to parse either the errorCode or debugData. |
| 86 | * Must only be captured in a bugreport. |
| 87 | * |
| 88 | * @param errorCode Vendor defined error code. |
| 89 | * @param debugData Vendor defined data used for debugging. |
| 90 | */ |
| 91 | oneway onDebugErrorAlert(int32_t errorCode, vec<uint8_t> debugData); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 92 | }; |