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 | import IWifiChip; |
| 20 | import IWifiEventCallback; |
| 21 | |
| 22 | /** |
| 23 | * This is the root of the HAL module and is the interface returned when |
| 24 | * loading an implementation of the Wi-Fi HAL. There must be at most one |
| 25 | * module loaded in the system. |
| 26 | */ |
| 27 | interface IWifi { |
| 28 | /** |
| 29 | * Requests notifications of significant events for the HAL. Multiple calls to |
| 30 | * this must register multiple callbacks each of which must receive all |
| 31 | * events. IWifiEventCallback registration must be independent of the state |
| 32 | * of the rest of the HAL and must persist though stops/starts. |
| 33 | */ |
| 34 | @entry |
| 35 | @callflow(next={"*"}) |
| 36 | oneway registerEventCallback(IWifiEventCallback callback); |
| 37 | |
| 38 | /** |
| 39 | * Get the current state of the HAL. |
| 40 | */ |
| 41 | isStarted() generates (bool started); |
| 42 | |
| 43 | /** |
| 44 | * Perform any setup that is required to make use of the module. If the module |
| 45 | * is already started then this must be a noop. The onStart callback must be |
| 46 | * called when the setup completes or if the HAL is already started. If the |
| 47 | * setup fails then onStartFailure must be called. |
| 48 | */ |
| 49 | @entry |
| 50 | @callflow(next={"registerEventCallback", "start", "stop", "getChip"}) |
| 51 | oneway start(); |
| 52 | |
| 53 | /** |
| 54 | * Tear down any state, ongoing commands, etc. If the module is already |
| 55 | * stopped then this must be a noop. If the HAL is already stopped or it |
| 56 | * succeeds then onStop must be called. If the teardown fails onFailure must |
| 57 | * be called. After calling this all IWifiChip objects will be considered |
| 58 | * invalid. |
| 59 | * |
| 60 | * Calling stop then start is a valid way of resetting state in the HAL, |
| 61 | * driver, firmware. |
| 62 | */ |
| 63 | @exit |
| 64 | @callflow(next={"registerEventCallback", "start", "stop"}) |
| 65 | oneway stop(); |
| 66 | |
| 67 | // TODO(b/30570663) return vec<IWifiChip> instead |
| 68 | /** |
| 69 | * Get the configurable chip on the device. |
| 70 | */ |
| 71 | @callflow(next={"*"}) |
| 72 | getChip() generates (IWifiChip chip); |
| 73 | }; |