| Index: device/bluetooth/bluetooth_discovery_filter.cc
|
| diff --git a/device/bluetooth/bluetooth_discovery_filter.cc b/device/bluetooth/bluetooth_discovery_filter.cc
|
| index 8b96a18984732be45231169111091cb32b214f5d..19e7dbec131b94500ac76880f9e5af5b1b71c086 100644
|
| --- a/device/bluetooth/bluetooth_discovery_filter.cc
|
| +++ b/device/bluetooth/bluetooth_discovery_filter.cc
|
| @@ -6,9 +6,12 @@
|
|
|
| #include <memory>
|
|
|
| +#include "device/bluetooth/bluetooth_common.h"
|
| +
|
| namespace device {
|
|
|
| -BluetoothDiscoveryFilter::BluetoothDiscoveryFilter(TransportMask transport) {
|
| +BluetoothDiscoveryFilter::BluetoothDiscoveryFilter(
|
| + BluetoothTransport transport) {
|
| SetTransport(transport);
|
| }
|
|
|
| @@ -47,13 +50,12 @@ void BluetoothDiscoveryFilter::SetPathloss(uint16_t pathloss) {
|
| *pathloss_ = pathloss;
|
| }
|
|
|
| -BluetoothDiscoveryFilter::TransportMask BluetoothDiscoveryFilter::GetTransport()
|
| - const {
|
| +BluetoothTransport BluetoothDiscoveryFilter::GetTransport() const {
|
| return transport_;
|
| }
|
|
|
| -void BluetoothDiscoveryFilter::SetTransport(TransportMask transport) {
|
| - DCHECK(transport > 0 && transport < 4);
|
| +void BluetoothDiscoveryFilter::SetTransport(BluetoothTransport transport) {
|
| + DCHECK(transport != BLUETOOTH_TRANSPORT_INVALID);
|
| transport_ = transport;
|
| }
|
|
|
| @@ -106,7 +108,7 @@ BluetoothDiscoveryFilter::Merge(
|
| return result;
|
| }
|
|
|
| - result.reset(new BluetoothDiscoveryFilter(Transport::TRANSPORT_DUAL));
|
| + result.reset(new BluetoothDiscoveryFilter(BLUETOOTH_TRANSPORT_DUAL));
|
|
|
| if (!filter_a || !filter_b || filter_a->IsDefault() ||
|
| filter_b->IsDefault()) {
|
| @@ -114,7 +116,8 @@ BluetoothDiscoveryFilter::Merge(
|
| }
|
|
|
| // both filters are not empty, so they must have transport set.
|
| - result->SetTransport(filter_a->transport_ | filter_b->transport_);
|
| + result->SetTransport(static_cast<BluetoothTransport>(filter_a->transport_ |
|
| + filter_b->transport_));
|
|
|
| // if both filters have uuids, them merge them. Otherwise uuids filter should
|
| // be left empty
|
| @@ -173,7 +176,7 @@ bool BluetoothDiscoveryFilter::Equals(
|
|
|
| bool BluetoothDiscoveryFilter::IsDefault() const {
|
| return !(rssi_.get() || pathloss_.get() || uuids_.size() ||
|
| - transport_ != Transport::TRANSPORT_DUAL);
|
| + transport_ != BLUETOOTH_TRANSPORT_DUAL);
|
| }
|
|
|
| } // namespace device
|
|
|