1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright 2016 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport IWifiIface; 20*4d7e907cSAndroid Build Coastguard Workerimport IWifiRttControllerEventCallback; 21*4d7e907cSAndroid Build Coastguard Worker 22*4d7e907cSAndroid Build Coastguard Worker/** 23*4d7e907cSAndroid Build Coastguard Worker * Interface used to perform RTT(Round trip time) operations. 24*4d7e907cSAndroid Build Coastguard Worker */ 25*4d7e907cSAndroid Build Coastguard Workerinterface IWifiRttController { 26*4d7e907cSAndroid Build Coastguard Worker /** 27*4d7e907cSAndroid Build Coastguard Worker * Get the iface on which the RTT operations must be performed. 28*4d7e907cSAndroid Build Coastguard Worker * 29*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 30*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 31*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 32*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID| 33*4d7e907cSAndroid Build Coastguard Worker * @return boundIface HIDL interface object representing the iface if bound 34*4d7e907cSAndroid Build Coastguard Worker * to a specific iface, null otherwise 35*4d7e907cSAndroid Build Coastguard Worker */ 36*4d7e907cSAndroid Build Coastguard Worker getBoundIface() generates (WifiStatus status, IWifiIface boundIface); 37*4d7e907cSAndroid Build Coastguard Worker 38*4d7e907cSAndroid Build Coastguard Worker /** 39*4d7e907cSAndroid Build Coastguard Worker * Requests notifications of significant events on this rtt controller. 40*4d7e907cSAndroid Build Coastguard Worker * Multiple calls to this must register multiple callbacks each of which must 41*4d7e907cSAndroid Build Coastguard Worker * receive all events. 42*4d7e907cSAndroid Build Coastguard Worker * 43*4d7e907cSAndroid Build Coastguard Worker * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL 44*4d7e907cSAndroid Build Coastguard Worker * interface object. 45*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 46*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 47*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 48*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| 49*4d7e907cSAndroid Build Coastguard Worker */ 50*4d7e907cSAndroid Build Coastguard Worker registerEventCallback(IWifiRttControllerEventCallback callback) 51*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status); 52*4d7e907cSAndroid Build Coastguard Worker 53*4d7e907cSAndroid Build Coastguard Worker /** 54*4d7e907cSAndroid Build Coastguard Worker * API to request RTT measurement. 55*4d7e907cSAndroid Build Coastguard Worker * 56*4d7e907cSAndroid Build Coastguard Worker * @param cmdId command Id to use for this invocation. 57*4d7e907cSAndroid Build Coastguard Worker * @param rttConfigs Vector of |RttConfig| parameters. 58*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 59*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 60*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 61*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 62*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 63*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 64*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 65*4d7e907cSAndroid Build Coastguard Worker */ 66*4d7e907cSAndroid Build Coastguard Worker rangeRequest(CommandId cmdId, vec<RttConfig> rttConfigs) 67*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status); 68*4d7e907cSAndroid Build Coastguard Worker 69*4d7e907cSAndroid Build Coastguard Worker /** 70*4d7e907cSAndroid Build Coastguard Worker * API to cancel RTT measurements. 71*4d7e907cSAndroid Build Coastguard Worker * 72*4d7e907cSAndroid Build Coastguard Worker * @param cmdId command Id corresponding to the original request. 73*4d7e907cSAndroid Build Coastguard Worker * @param addrs Vector of addresses for which to cancel. 74*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 75*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 76*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 77*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 78*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 79*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 80*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 81*4d7e907cSAndroid Build Coastguard Worker */ 82*4d7e907cSAndroid Build Coastguard Worker rangeCancel(CommandId cmdId, vec<MacAddress> addrs) 83*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status); 84*4d7e907cSAndroid Build Coastguard Worker 85*4d7e907cSAndroid Build Coastguard Worker /** 86*4d7e907cSAndroid Build Coastguard Worker * RTT capabilities of the device. 87*4d7e907cSAndroid Build Coastguard Worker * 88*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 89*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 90*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 91*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 92*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 93*4d7e907cSAndroid Build Coastguard Worker * @return capabilities Instance of |RttCapabilities|. 94*4d7e907cSAndroid Build Coastguard Worker */ 95*4d7e907cSAndroid Build Coastguard Worker getCapabilities() generates (WifiStatus status, RttCapabilities capabilities); 96*4d7e907cSAndroid Build Coastguard Worker 97*4d7e907cSAndroid Build Coastguard Worker /** 98*4d7e907cSAndroid Build Coastguard Worker * API to configure the LCI(Location civic information). 99*4d7e907cSAndroid Build Coastguard Worker * Used in RTT Responder mode only. 100*4d7e907cSAndroid Build Coastguard Worker * 101*4d7e907cSAndroid Build Coastguard Worker * @param cmdId command Id to use for this invocation. 102*4d7e907cSAndroid Build Coastguard Worker * @param lci Instance of |RttLciInformation|. 103*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 104*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 105*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 106*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 107*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 108*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 109*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 110*4d7e907cSAndroid Build Coastguard Worker */ 111*4d7e907cSAndroid Build Coastguard Worker setLci(CommandId cmdId, RttLciInformation lci) generates (WifiStatus status); 112*4d7e907cSAndroid Build Coastguard Worker 113*4d7e907cSAndroid Build Coastguard Worker /** 114*4d7e907cSAndroid Build Coastguard Worker * API to configure the LCR(Location civic records). 115*4d7e907cSAndroid Build Coastguard Worker * Used in RTT Responder mode only. 116*4d7e907cSAndroid Build Coastguard Worker * 117*4d7e907cSAndroid Build Coastguard Worker * @param cmdId command Id to use for this invocation. 118*4d7e907cSAndroid Build Coastguard Worker * @param lcr Instance of |RttLcrInformation|. 119*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 120*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 121*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 122*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 123*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 124*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 125*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 126*4d7e907cSAndroid Build Coastguard Worker */ 127*4d7e907cSAndroid Build Coastguard Worker setLcr(CommandId cmdId, RttLcrInformation lcr) generates (WifiStatus status); 128*4d7e907cSAndroid Build Coastguard Worker 129*4d7e907cSAndroid Build Coastguard Worker /** 130*4d7e907cSAndroid Build Coastguard Worker * Get RTT responder information e.g. WiFi channel to enable responder on. 131*4d7e907cSAndroid Build Coastguard Worker * 132*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 133*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 134*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 135*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 136*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 137*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 138*4d7e907cSAndroid Build Coastguard Worker * @return info Instance of |RttResponderInfo|. 139*4d7e907cSAndroid Build Coastguard Worker */ 140*4d7e907cSAndroid Build Coastguard Worker getResponderInfo() generates (WifiStatus status, RttResponder info); 141*4d7e907cSAndroid Build Coastguard Worker 142*4d7e907cSAndroid Build Coastguard Worker /** 143*4d7e907cSAndroid Build Coastguard Worker * Enable RTT responder mode. 144*4d7e907cSAndroid Build Coastguard Worker * 145*4d7e907cSAndroid Build Coastguard Worker * @param cmdId command Id to use for this invocation. 146*4d7e907cSAndroid Build Coastguard Worker * @parm channelHint Hint of the channel information where RTT responder must 147*4d7e907cSAndroid Build Coastguard Worker * be enabled on. 148*4d7e907cSAndroid Build Coastguard Worker * @param maxDurationInSeconds Timeout of responder mode. 149*4d7e907cSAndroid Build Coastguard Worker * @param info Instance of |RttResponderInfo|. 150*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 151*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 152*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 153*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 154*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 155*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 156*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 157*4d7e907cSAndroid Build Coastguard Worker */ 158*4d7e907cSAndroid Build Coastguard Worker enableResponder(CommandId cmdId, 159*4d7e907cSAndroid Build Coastguard Worker WifiChannelInfo channelHint, 160*4d7e907cSAndroid Build Coastguard Worker uint32_t maxDurationSeconds, 161*4d7e907cSAndroid Build Coastguard Worker RttResponder info) 162*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status); 163*4d7e907cSAndroid Build Coastguard Worker 164*4d7e907cSAndroid Build Coastguard Worker /** 165*4d7e907cSAndroid Build Coastguard Worker * Disable RTT responder mode. 166*4d7e907cSAndroid Build Coastguard Worker * 167*4d7e907cSAndroid Build Coastguard Worker * @param cmdId command Id corresponding to the original request. 168*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 169*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 170*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 171*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, 172*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 173*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 174*4d7e907cSAndroid Build Coastguard Worker */ 175*4d7e907cSAndroid Build Coastguard Worker disableResponder(CommandId cmdId) generates (WifiStatus status); 176*4d7e907cSAndroid Build Coastguard Worker}; 177