1 /*
2  * Copyright (C) 2017 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_WIFI_OFFLOAD_SCAN_PARAMS_H_
18 #define CHRE_WIFI_OFFLOAD_SCAN_PARAMS_H_
19 
20 #include "chre/apps/wifi_offload/wifi_offload.h"
21 
22 #include "chre/apps/wifi_offload/flatbuffers_types_generated.h"
23 #include "chre/apps/wifi_offload/ssid.h"
24 
25 namespace wifi_offload {
26 
27 /**
28  * Parameters for performing offload scans
29  */
30 class ScanParams {
31  public:
32   /* Corresponding flatbuffers-generated data-type used to serialize and
33    * deserialize instances of this class */
34   using FbsType = fbs::ScanParams;
35 
36   ScanParams();
37 
38   ~ScanParams() = default;
39 
40   bool operator==(const ScanParams &other) const;
41 
42   flatbuffers::Offset<ScanParams::FbsType> Serialize(
43       flatbuffers::FlatBufferBuilder *builder) const;
44 
45   bool Deserialize(const ScanParams::FbsType &fbs_params);
46 
47   void Log() const;
48 
49   Vector<Ssid> ssids_to_scan_;
50   Vector<uint32_t> frequencies_to_scan_mhz_;
51   uint32_t disconnected_mode_scan_interval_ms_;  // 0 means disable
52 };
53 
54 }  // namespace wifi_offload
55 
56 #endif  // CHRE_WIFI_OFFLOAD_SCAN_PARAMS_H_
57