| /* |
| * Copyright 2016 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package android.hardware.wifi@1.0; |
| |
| import IWifiChip; |
| import IWifiEventCallback; |
| |
| /** |
| * This is the root of the HAL module and is the interface returned when |
| * loading an implementation of the Wi-Fi HAL. There must be at most one |
| * module loaded in the system. |
| */ |
| interface IWifi { |
| /** |
| * Requests notifications of significant events for the HAL. Multiple calls to |
| * this must register multiple callbacks each of which must receive all |
| * events. IWifiEventCallback registration must be independent of the state |
| * of the rest of the HAL and must persist though stops/starts. |
| */ |
| @entry |
| @callflow(next={"*"}) |
| oneway registerEventCallback(IWifiEventCallback callback); |
| |
| /** |
| * Get the current state of the HAL. |
| */ |
| isStarted() generates (bool started); |
| |
| /** |
| * Perform any setup that is required to make use of the module. If the module |
| * is already started then this must be a noop. The onStart callback must be |
| * called when the setup completes or if the HAL is already started. If the |
| * setup fails then onStartFailure must be called. |
| */ |
| @entry |
| @callflow(next={"registerEventCallback", "start", "stop", "getChip"}) |
| oneway start(); |
| |
| /** |
| * Tear down any state, ongoing commands, etc. If the module is already |
| * stopped then this must be a noop. If the HAL is already stopped or it |
| * succeeds then onStop must be called. If the teardown fails onFailure must |
| * be called. After calling this all IWifiChip objects will be considered |
| * invalid. |
| * |
| * Calling stop then start is a valid way of resetting state in the HAL, |
| * driver, firmware. |
| */ |
| @exit |
| @callflow(next={"registerEventCallback", "start", "stop"}) |
| oneway stop(); |
| |
| // TODO(b/30570663) return vec<IWifiChip> instead |
| /** |
| * Get the configurable chip on the device. |
| */ |
| @callflow(next={"*"}) |
| getChip() generates (IWifiChip chip); |
| }; |