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_RECORD_H_ 18 #define CHRE_WIFI_OFFLOAD_SCAN_RECORD_H_ 19 20 #include "chre/apps/wifi_offload/wifi_offload.h" 21 22 #include "chre/apps/wifi_offload/generated/flatbuffers_types_generated.h" 23 24 namespace wifi_offload { 25 26 class ScanRecord { 27 public: 28 /* Corresponding flatbuffers-generated data-type used to serialize and 29 * deserialize instances of this class */ 30 using FbsType = fbs::ScanRecord; 31 32 ScanRecord(); 33 ~ScanRecord() = default; 34 35 bool operator==(const ScanRecord &other) const; 36 37 flatbuffers::Offset<ScanRecord::FbsType> Serialize( 38 flatbuffers::FlatBufferBuilder *builder) const; 39 40 bool Deserialize(const ScanRecord::FbsType &fbs_record); 41 42 uint32_t time_spent_scanning_ms_; 43 uint32_t num_channels_scanned_; 44 /* Number of ScanRecords aggregated into this record. Multiple ScanRecords 45 * may be combined together into a single ScanRecord by adding up values to 46 * save space if needed */ 47 uint32_t num_entries_aggregated_; 48 }; 49 50 } // namespace wifi_offload 51 52 #endif // CHRE_WIFI_OFFLOAD_SCAN_RECORD_H_ 53