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 
23 // Service interface that exposes primitives for controlling the WiFi
24 // subsystems of a device.
25 interface IWificond {
26 
27     // Create a network interface suitable for use as an AP.
createApInterface(@tf8InCpp String iface_name)28     @nullable IApInterface createApInterface(@utf8InCpp String iface_name);
29 
30     // Create a network interface suitable for use as a WiFi client.
createClientInterface(@tf8InCpp String iface_name)31     @nullable IClientInterface createClientInterface(@utf8InCpp String iface_name);
32 
33     // Remove a previously created AP network interface.
tearDownApInterface(@tf8InCpp String iface_name)34     boolean tearDownApInterface(@utf8InCpp String iface_name);
35 
36     // Remove a previously created STA network interface.
tearDownClientInterface(@tf8InCpp String iface_name)37     boolean tearDownClientInterface(@utf8InCpp String iface_name);
38 
39     // Tear down all existing interfaces.  This should enable clients to create
40     // future interfaces immediately after this method returns.
tearDownInterfaces()41     void tearDownInterfaces();
42 
43     // @return list of the currently configured IClientInterface instances.
GetClientInterfaces()44     List<IBinder> GetClientInterfaces();
45 
46     // @return list of the currently configured IApInterface instances.
GetApInterfaces()47     List<IBinder> GetApInterfaces();
48 
49     // Returns an array of available frequencies for 2.4GHz channels.
50     // Returrns null on failure.
getAvailable2gChannels()51     @nullable int[] getAvailable2gChannels();
52 
53     // Returns an array of available frequencies for 5GHz non-DFS channels.
54     // Returrns null on failure.
getAvailable5gNonDFSChannels()55     @nullable int[] getAvailable5gNonDFSChannels();
56 
57     // Returns an array of available frequencies for DFS channels.
58     // This also includes passive only frequecies which are not for DFS channels.
59     // Returrns null on failure.
getAvailableDFSChannels()60     @nullable int[] getAvailableDFSChannels();
61 
62     // Register a callback to receive interface status updates.
63     //
64     // Multiple callbacks can be registered simultaneously.
65     // Duplicate registrations of the same callback will be ignored.
66     //
67     // @param callback object to add to the set of registered callbacks.
RegisterCallback(IInterfaceEventCallback callback)68     oneway void RegisterCallback(IInterfaceEventCallback callback);
69 
70     // Remove a callback from the set of registered callbacks.
71     //
72     // This must be the same instance as previously registered.
73     // Requests to remove unknown callbacks will be ignored.
74     //
75     // @param callback object to remove from the set of registered callbacks.
UnregisterCallback(IInterfaceEventCallback callback)76     oneway void UnregisterCallback(IInterfaceEventCallback callback);
77 }
78