1 //
2 //  Copyright (C) 2015 Google, Inc.
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 #include "service/common/bluetooth/scan_settings.h"
18 
19 namespace bluetooth {
20 
ScanSettings()21 ScanSettings::ScanSettings()
22     : mode_(MODE_LOW_POWER),
23       callback_type_(CALLBACK_TYPE_ALL_MATCHES),
24       result_type_(RESULT_TYPE_FULL),
25       match_count_per_filter_(MATCH_COUNT_MAX_ADVERTISEMENTS) {
26 }
27 
ScanSettings(Mode mode,CallbackTypeBitField callback_type,ResultType result_type,base::TimeDelta report_delay_ms,MatchMode match_mode,MatchCount match_count_per_filter)28 ScanSettings::ScanSettings(
29     Mode mode,
30     CallbackTypeBitField callback_type,
31     ResultType result_type,
32     base::TimeDelta report_delay_ms,
33     MatchMode match_mode,
34     MatchCount match_count_per_filter)
35     : mode_(mode),
36       callback_type_(callback_type),
37       result_type_(result_type),
38       report_delay_ms_(report_delay_ms),
39       match_mode_(match_mode),
40       match_count_per_filter_(match_count_per_filter) {
41 }
42 
operator ==(const ScanSettings & rhs) const43 bool ScanSettings::operator==(const ScanSettings& rhs) const {
44   if (mode_ != rhs.mode_)
45     return false;
46 
47   if (callback_type_ != rhs.callback_type_)
48     return false;
49 
50   if (result_type_ != rhs.result_type_)
51     return false;
52 
53   if (report_delay_ms_ != rhs.report_delay_ms_)
54     return false;
55 
56   if (match_mode_ != rhs.match_mode_)
57     return false;
58 
59   if (match_count_per_filter_ != rhs.match_count_per_filter_)
60     return false;
61 
62   return true;
63 }
64 
65 }  // namespace bluetooth
66