1 /*
2  * Copyright (C) 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.net.wifi;
18 
19 import android.net.wifi.IApInterface;
20 import android.net.wifi.IClientInterface;
21 import android.net.wifi.IInterfaceEventCallback;
22 import android.net.wifi.IRttClient;
23 import android.net.wifi.IRttController;
24 
25 // Service interface that exposes primitives for controlling the WiFi
26 // subsystems of a device.
27 interface IWificond {
28 
29     // Create a network interface suitable for use as an AP.
createApInterface()30     @nullable IApInterface createApInterface();
31 
32     // Create a network interface suitable for use as a WiFi client.
createClientInterface()33     @nullable IClientInterface createClientInterface();
34 
35     // Tear down all existing interfaces.  This should enable clients to create
36     // future interfaces immediately after this method returns.
tearDownInterfaces()37     void tearDownInterfaces();
38 
39     // @return list of the currently configured IClientInterface instances.
GetClientInterfaces()40     List<IBinder> GetClientInterfaces();
41 
42     // @return list of the currently configured IApInterface instances.
GetApInterfaces()43     List<IBinder> GetApInterfaces();
44 
45     // Register a callback to receive interface status updates.
46     //
47     // Multiple callbacks can be registered simultaneously.
48     // Duplicate registrations of the same callback will be ignored.
49     //
50     // @param callback object to add to the set of registered callbacks.
RegisterCallback(IInterfaceEventCallback callback)51     oneway void RegisterCallback(IInterfaceEventCallback callback);
52 
53     // Remove a callback from the set of registered callbacks.
54     //
55     // This must be the same instance as previously registered.
56     // Requests to remove unknown callbacks will be ignored.
57     //
58     // @param callback object to remove from the set of registered callbacks.
UnregisterCallback(IInterfaceEventCallback callback)59     oneway void UnregisterCallback(IInterfaceEventCallback callback);
60 
61     // Obtain a reference to a IRttController that can be used to
62     // request ranging information.
63     // Results will be returned via the registered IRttClient.
registerRttClient(IRttClient rttClient)64     IRttController registerRttClient(IRttClient rttClient);
65 
66     // Remove an IRttClient from the set of registered IRttClient callbacks.
67     // @param rttClient object to remove from the set of registered
68     // IRttClient callbacks.
unregisterRttClient(IRttClient rttClient)69     void unregisterRttClient(IRttClient rttClient);
70 }
71