• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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 
17 #ifndef CHRE_PLATFORM_LINUX_PAL_WIFI_H_
18 #define CHRE_PLATFORM_LINUX_PAL_WIFI_H_
19 
20 #include <stdint.h>
21 
22 #include <chrono>
23 
24 enum class PalWifiAsyncRequestTypes : uint8_t {
25   SCAN,
26   SCAN_MONITORING,
27   RANGING,
28 
29   // Must be last
30   NUM_WIFI_REQUEST_TYPE,
31 };
32 
33 /**
34  * @return whether scan monitoring is active.
35  */
36 bool chrePalWifiIsScanMonitoringActive();
37 
38 /**
39  * Sets how long each async request should hold before replying the result
40  * to CHRE.
41  *
42  * @param requestType select one request type to modify its behavior.
43  * @param seconds delayed response time.
44  */
45 void chrePalWifiDelayResponse(PalWifiAsyncRequestTypes requestType,
46                               std::chrono::seconds seconds);
47 
48 /**
49  * Sets if PAL should send back async request result for each async request.
50  *
51  * This function is used to mimic the behavior of hardware failure in
52  * simulation test.
53  *
54  * @param requestType select one request type to modify its behavior.
55  * @param enableResponse true if allow pal to send back async result.
56  */
57 void chrePalWifiEnableResponse(PalWifiAsyncRequestTypes requestType,
58                                bool enableResponse);
59 
60 #endif  // CHRE_PLATFORM_LINUX_PAL_WIFI_H_