1/*
2 * Copyright 2022 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
17package android.hardware.wifi@1.6;
18
19import @1.0::WifiStatus;
20import @1.0::CommandIdShort;
21import @1.4::NanConfigRequest;
22import @1.4::NanEnableRequest;
23import @1.5::IWifiNanIface;
24import IWifiNanIfaceEventCallback;
25import NanConfigRequestSupplemental;
26import NanInitiateDataPathRequest;
27import NanPublishRequest;
28import NanRespondToDataPathIndicationRequest;
29
30/**
31 * Interface used to represent a single NAN (Neighbour Aware Network) iface.
32 *
33 * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
34 * Networking (NAN) Technical Specification".
35 */
36interface IWifiNanIface extends @1.5::IWifiNanIface {
37    /**
38     * Requests notifications of significant events on this iface. Multiple calls
39     * to this must register multiple callbacks each of which must receive all
40     * events.
41     *
42     * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface
43     *        object.
44     * @return status WifiStatus of the operation.
45     *         Possible status codes:
46     *         |WifiStatusCode.SUCCESS|,
47     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|
48     */
49    registerEventCallback_1_6(IWifiNanIfaceEventCallback callback) generates (WifiStatus status);
50
51    /**
52     * Initiate a data-path (NDP) setup operation: Initiator.
53     * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyInitiateDataPathResponse|.
54     *
55     * Note: supersedes the @1.0::IWifiNanIface.respondToDataPathIndicationRequest() method which is
56     * deprecated as of HAL version 1.6.
57     *
58     * @param cmdId command Id to use for this invocation.
59     * @param msg Instance of |NanInitiateDataPathRequest|.
60     * @return status WifiStatus of the operation.
61     *         Possible status codes:
62     *         |WifiStatusCode.SUCCESS|,
63     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
64     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
65     *         |WifiStatusCode.ERROR_UNKNOWN|
66     */
67    initiateDataPathRequest_1_6(CommandIdShort cmdId, NanInitiateDataPathRequest msg)
68        generates (WifiStatus status);
69
70    /**
71     * Respond to a received data indication as part of a data-path (NDP) setup operation. An
72     * indication is received by the Responder from the Initiator.
73     * Asynchronous response is with
74     * |IWifiNanIfaceEventCallback.notifyRespondToDataPathIndicationResponse|.
75     *
76     * Note: supersedes the @1.0::IWifiNanIface.respondToDataPathIndicationRequest() method which is
77     * deprecated as of HAL version 1.6.
78     *
79     * @param cmdId command Id to use for this invocation.
80     * @param msg Instance of |NanRespondToDataPathIndicationRequest|.
81     * @return status WifiStatus of the operation.
82     *         Possible status codes:
83     *         |WifiStatusCode.SUCCESS|,
84     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
85     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
86     *         |WifiStatusCode.ERROR_UNKNOWN|
87     */
88    respondToDataPathIndicationRequest_1_6(CommandIdShort cmdId,
89        NanRespondToDataPathIndicationRequest msg) generates (WifiStatus status);
90
91    /**
92     * Enable NAN: configures and activates NAN clustering (does not start
93     * a discovery session or set up data-interfaces or data-paths). Use the
94     * |IWifiNanIface.configureRequest| method to change the configuration of an already enabled
95     * NAN interface.
96     * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyEnableResponse|.
97     *
98     * Note: supersedes the @1.5::IWifiNanIface.enableRequest() method which is deprecated as of
99     * HAL version 1.6.
100     *
101     * @param cmdId command Id to use for this invocation.
102     * @param msg1 Instance of |NanEnableRequest|.
103     * @param msg2 Instance of |NanConfigRequestSupplemental|.
104     * @return status WifiStatus of the operation.
105     *         Possible status codes:
106     *         |WifiStatusCode.SUCCESS|,
107     *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
108     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
109     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
110     *         |WifiStatusCode.ERROR_UNKNOWN|
111     */
112    enableRequest_1_6(CommandIdShort cmdId, NanEnableRequest msg1,
113        NanConfigRequestSupplemental msg2) generates (WifiStatus status);
114
115    /**
116     * Configure NAN: configures an existing NAN functionality (i.e. assumes
117     * |IWifiNanIface.enableRequest| already submitted and succeeded).
118     * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyConfigResponse|.
119     *
120     * Note: supersedes the @1.5::IWifiNanIface.configRequest() method which is deprecated as of
121     * HAL version 1.6.
122     *
123     * @param cmdId command Id to use for this invocation.
124     * @param msg1 Instance of |NanConfigRequest|.
125     * @param msg2 Instance of |NanConfigRequestSupplemental|.
126     * @return status WifiStatus of the operation.
127     *         Possible status codes:
128     *         |WifiStatusCode.SUCCESS|,
129     *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
130     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
131     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
132     *         |WifiStatusCode.ERROR_UNKNOWN|
133     */
134    configRequest_1_6(CommandIdShort cmdId, NanConfigRequest msg1,
135        NanConfigRequestSupplemental msg2) generates (WifiStatus status);
136
137    /**
138     * Publish request to start advertising a discovery service.
139     * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartPublishResponse|.
140     *
141     * Note: supersedes the @1.0::IWifiNanIface.startPublishRequest() method which is deprecated as
142     * of HAL version 1.6.
143     *
144     * @param cmdId command Id to use for this invocation.
145     * @param msg Instance of |NanPublishRequest|.
146     * @return status WifiStatus of the operation.
147     *         Possible status codes:
148     *         |WifiStatusCode.SUCCESS|,
149     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
150     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
151     *         |WifiStatusCode.ERROR_UNKNOWN|
152     */
153    startPublishRequest_1_6(CommandIdShort cmdId, NanPublishRequest msg)
154        generates (WifiStatus status);
155};
156