Home | History | Annotate | Download | only in 1.0
      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 IWifiIface;
     20 import IWifiRttControllerEventCallback;
     21 
     22 /**
     23  * Interface used to perform RTT(Round trip time) operations.
     24  */
     25 interface IWifiRttController {
     26   /**
     27    * Get the iface on which the RTT operations must be performed.
     28    *
     29    * @return status WifiStatus of the operation.
     30    *         Possible status codes:
     31    *         |WifiStatusCode.SUCCESS|,
     32    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|
     33    * @return boundIface HIDL interface object representing the iface if bound
     34    *         to a specific iface, null otherwise
     35    */
     36   getBoundIface() generates (WifiStatus status, IWifiIface boundIface);
     37 
     38   /**
     39    * Requests notifications of significant events on this rtt controller.
     40    * Multiple calls to this must register multiple callbacks each of which must
     41    * receive all events.
     42    *
     43    * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL
     44    *        interface object.
     45    * @return status WifiStatus of the operation.
     46    *         Possible status codes:
     47    *         |WifiStatusCode.SUCCESS|,
     48    *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|
     49    */
     50   registerEventCallback(IWifiRttControllerEventCallback callback)
     51       generates (WifiStatus status);
     52 
     53   /**
     54    * API to request RTT measurement.
     55    *
     56    * @param cmdId command Id to use for this invocation.
     57    * @param rttConfigs Vector of |RttConfig| parameters.
     58    * @return status WifiStatus of the operation.
     59    *         Possible status codes:
     60    *         |WifiStatusCode.SUCCESS|,
     61    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     62    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
     63    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
     64    *         |WifiStatusCode.ERROR_UNKNOWN|
     65    */
     66   rangeRequest(CommandId cmdId, vec<RttConfig> rttConfigs)
     67       generates (WifiStatus status);
     68 
     69   /**
     70    * API to cancel RTT measurements.
     71    *
     72    * @param cmdId command Id corresponding to the original request.
     73    * @param addrs Vector of addresses for which to cancel.
     74    * @return status WifiStatus of the operation.
     75    *         Possible status codes:
     76    *         |WifiStatusCode.SUCCESS|,
     77    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     78    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
     79    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
     80    *         |WifiStatusCode.ERROR_UNKNOWN|
     81    */
     82   rangeCancel(CommandId cmdId, vec<MacAddress> addrs)
     83       generates (WifiStatus status);
     84 
     85   /**
     86    * RTT capabilities of the device.
     87    *
     88    * @return status WifiStatus of the operation.
     89    *         Possible status codes:
     90    *         |WifiStatusCode.SUCCESS|,
     91    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     92    *         |WifiStatusCode.ERROR_UNKNOWN|
     93    * @return capabilities Instance of |RttCapabilities|.
     94    */
     95   getCapabilities() generates (WifiStatus status, RttCapabilities capabilities);
     96 
     97   /**
     98    * API to configure the LCI(Location civic information).
     99    * Used in RTT Responder mode only.
    100    *
    101    * @param cmdId command Id to use for this invocation.
    102    * @param lci Instance of |RttLciInformation|.
    103    * @return status WifiStatus of the operation.
    104    *         Possible status codes:
    105    *         |WifiStatusCode.SUCCESS|,
    106    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
    107    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    108    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
    109    *         |WifiStatusCode.ERROR_UNKNOWN|
    110    */
    111   setLci(CommandId cmdId, RttLciInformation lci) generates (WifiStatus status);
    112 
    113   /**
    114    * API to configure the LCR(Location civic records).
    115    * Used in RTT Responder mode only.
    116    *
    117    * @param cmdId command Id to use for this invocation.
    118    * @param lcr Instance of |RttLcrInformation|.
    119    * @return status WifiStatus of the operation.
    120    *         Possible status codes:
    121    *         |WifiStatusCode.SUCCESS|,
    122    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
    123    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    124    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
    125    *         |WifiStatusCode.ERROR_UNKNOWN|
    126    */
    127   setLcr(CommandId cmdId, RttLcrInformation lcr) generates (WifiStatus status);
    128 
    129   /**
    130    * Get RTT responder information e.g. WiFi channel to enable responder on.
    131    *
    132    * @return status WifiStatus of the operation.
    133    *         Possible status codes:
    134    *         |WifiStatusCode.SUCCESS|,
    135    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
    136    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
    137    *         |WifiStatusCode.ERROR_UNKNOWN|
    138    * @return info Instance of |RttResponderInfo|.
    139    */
    140   getResponderInfo() generates (WifiStatus status, RttResponder info);
    141 
    142   /**
    143    * Enable RTT responder mode.
    144    *
    145    * @param cmdId command Id to use for this invocation.
    146    * @parm channelHint Hint of the channel information where RTT responder must
    147    *       be enabled on.
    148    * @param maxDurationInSeconds Timeout of responder mode.
    149    * @param info Instance of |RttResponderInfo|.
    150    * @return status WifiStatus of the operation.
    151    *         Possible status codes:
    152    *         |WifiStatusCode.SUCCESS|,
    153    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
    154    *         |WifiStatusCode.ERROR_INVALID_ARGS|,
    155    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
    156    *         |WifiStatusCode.ERROR_UNKNOWN|
    157    */
    158   enableResponder(CommandId cmdId,
    159                   WifiChannelInfo channelHint,
    160                   uint32_t maxDurationSeconds,
    161                   RttResponder info)
    162       generates (WifiStatus status);
    163 
    164   /**
    165    * Disable RTT responder mode.
    166    *
    167    * @param cmdId command Id corresponding to the original request.
    168    * @return status WifiStatus of the operation.
    169    *         Possible status codes:
    170    *         |WifiStatusCode.SUCCESS|,
    171    *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
    172    *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
    173    *         |WifiStatusCode.ERROR_UNKNOWN|
    174    */
    175   disableResponder(CommandId cmdId) generates (WifiStatus status);
    176 };
    177