2016-08-18 20:44:58 +02:00
|
|
|
/*
|
|
|
|
* 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
|
2016-10-05 00:08:05 +02:00
|
|
|
* events. |IWifiEventCallback| object registration must be independent of the
|
|
|
|
* state of the rest of the HAL and must persist though stops/starts. These
|
|
|
|
* objects must be deleted when the corresponding client process is dead.
|
|
|
|
*
|
|
|
|
* @param callback An instance of the |IWifiEventCallback| HIDL interface
|
|
|
|
* object.
|
2016-10-27 00:56:17 +02:00
|
|
|
* @return status WifiStatus of the operation.
|
|
|
|
* Possible status codes:
|
|
|
|
* |WifiStatusCode.SUCCESS|,
|
|
|
|
* |WifiStatusCode.UNKNOWN|
|
2016-08-18 20:44:58 +02:00
|
|
|
*/
|
|
|
|
@entry
|
|
|
|
@callflow(next={"*"})
|
2016-10-27 00:56:17 +02:00
|
|
|
registerEventCallback(IWifiEventCallback callback)
|
|
|
|
generates (WifiStatus status);
|
2016-08-18 20:44:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current state of the HAL.
|
2016-10-05 00:08:05 +02:00
|
|
|
*
|
|
|
|
* @return started true if started, false otherwise.
|
2016-08-18 20:44:58 +02:00
|
|
|
*/
|
|
|
|
isStarted() generates (bool started);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Perform any setup that is required to make use of the module. If the module
|
2016-10-10 20:53:07 +02:00
|
|
|
* is already started then this must be a noop.
|
|
|
|
* Must trigger |IWifiEventCallback.onStart| on success.
|
|
|
|
*
|
|
|
|
* @return status WifiStatus of the operation.
|
|
|
|
* Possible status codes:
|
|
|
|
* |WifiStatusCode.SUCCESS|,
|
|
|
|
* |WifiStatusCode.NOT_AVAILABLE|,
|
|
|
|
* |WifiStatusCode.UNKNOWN|
|
2016-08-18 20:44:58 +02:00
|
|
|
*/
|
|
|
|
@entry
|
|
|
|
@callflow(next={"registerEventCallback", "start", "stop", "getChip"})
|
2016-10-10 20:53:07 +02:00
|
|
|
start() generates (WifiStatus status);
|
2016-08-18 20:44:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
2016-10-10 20:53:07 +02:00
|
|
|
* succeeds then onStop must be called. After calling this all IWifiChip
|
|
|
|
* objects will be considered invalid.
|
|
|
|
* Must trigger |IWifiEventCallback.onStop| on success.
|
|
|
|
* Must trigger |IWifiEventCallback.onFailure| on failure.
|
2016-08-18 20:44:58 +02:00
|
|
|
*
|
|
|
|
* Calling stop then start is a valid way of resetting state in the HAL,
|
|
|
|
* driver, firmware.
|
2016-10-10 20:53:07 +02:00
|
|
|
*
|
|
|
|
* @return status WifiStatus of the operation.
|
|
|
|
* Possible status codes:
|
|
|
|
* |WifiStatusCode.SUCCESS|,
|
2016-10-27 00:56:17 +02:00
|
|
|
* |WifiStatusCode.NOT_STARTED|,
|
2016-10-10 20:53:07 +02:00
|
|
|
* |WifiStatusCode.UNKNOWN|
|
2016-08-18 20:44:58 +02:00
|
|
|
*/
|
|
|
|
@exit
|
|
|
|
@callflow(next={"registerEventCallback", "start", "stop"})
|
2016-10-10 20:53:07 +02:00
|
|
|
stop() generates (WifiStatus status);
|
2016-08-18 20:44:58 +02:00
|
|
|
|
|
|
|
/**
|
2016-10-05 19:19:06 +02:00
|
|
|
* Retrieve the list of all chip Id's on the device.
|
|
|
|
* The corresponding |IWifiChip| object for any chip can be
|
|
|
|
* retrieved using |getChip| method.
|
|
|
|
*
|
2016-10-27 00:56:17 +02:00
|
|
|
* @return status WifiStatus of the operation.
|
|
|
|
* Possible status codes:
|
|
|
|
* |WifiStatusCode.SUCCESS|,
|
|
|
|
* |WifiStatusCode.NOT_STARTED|,
|
|
|
|
* |WifiStatusCode.UNKNOWN|
|
2016-10-05 19:19:06 +02:00
|
|
|
* @return chipIds List of all chip Id's on the device.
|
|
|
|
*/
|
|
|
|
@callflow(next={"*"})
|
2016-10-27 00:56:17 +02:00
|
|
|
getChipIds() generates (WifiStatus status, vec<ChipId> chipIds);
|
2016-10-05 19:19:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a HIDL interface object for the chip corresponding to the
|
|
|
|
* provided chipId.
|
|
|
|
*
|
2016-10-27 00:56:17 +02:00
|
|
|
* @return status WifiStatus of the operation.
|
|
|
|
* Possible status codes:
|
|
|
|
* |WifiStatusCode.SUCCESS|,
|
|
|
|
* |WifiStatusCode.NOT_STARTED|,
|
|
|
|
* |WifiStatusCode.UNKNOWN|
|
2016-10-05 19:19:06 +02:00
|
|
|
* @return chip HIDL interface object representing the chip.
|
2016-08-18 20:44:58 +02:00
|
|
|
*/
|
|
|
|
@callflow(next={"*"})
|
2016-10-27 00:56:17 +02:00
|
|
|
getChip(ChipId chipId) generates (WifiStatus status, IWifiChip chip);
|
2016-08-18 20:44:58 +02:00
|
|
|
};
|