Resolve conflics from previous commit.

This commit is contained in:
hai007
2020-10-09 17:34:34 -07:00
parent 5dc9b74a07
commit 5fd30491bc
30 changed files with 0 additions and 831 deletions
-4
View File
@@ -65,13 +65,9 @@ bool BleMedium::StartScanning(
&context.peripheral, &peripheral,
peripheral.GetName().c_str());
discovered_peripheral_callback_.peripheral_discovered_cb(
<<<<<<< HEAD
context.peripheral, service_id, fast_advertisement);
=======
context.peripheral, service_id,
context.peripheral.GetAdvertisementBytes(service_id),
fast_advertisement);
>>>>>>> release
}
},
.peripheral_lost_cb =
-8
View File
@@ -85,20 +85,12 @@ class BleMedium final {
public:
using Platform = api::ImplementationPlatform;
struct DiscoveredPeripheralCallback {
<<<<<<< HEAD
std::function<void(BlePeripheral& peripheral,
const std::string& service_id,
bool fast_advertisement)>
peripheral_discovered_cb =
DefaultCallback<BlePeripheral&, const std::string&, bool>();
=======
std::function<void(BlePeripheral& peripheral, const std::string& service_id,
const ByteArray& advertisement_bytes,
bool fast_advertisement)>
peripheral_discovered_cb =
DefaultCallback<BlePeripheral&, const std::string&,
const ByteArray&, bool>();
>>>>>>> release
std::function<void(BlePeripheral& peripheral,
const std::string& service_id)>
peripheral_lost_cb =
-32
View File
@@ -72,20 +72,12 @@ TEST_F(BleMediumTest, CanStartAdvertising) {
fast_advertisement_service_uuid);
EXPECT_TRUE(ble_b.StartScanning(
<<<<<<< HEAD
service_id,
fast_advertisement_service_uuid,
=======
service_id, fast_advertisement_service_uuid,
>>>>>>> release
DiscoveredPeripheralCallback{
.peripheral_discovered_cb =
[&found_latch](
BlePeripheral& peripheral, const std::string& service_id,
<<<<<<< HEAD
=======
const ByteArray& advertisement_bytes,
>>>>>>> release
bool fast_advertisement) { found_latch.CountDown(); },
}));
EXPECT_TRUE(found_latch.Await(kWaitDuration).result());
@@ -107,20 +99,12 @@ TEST_F(BleMediumTest, CanStartScanning) {
CountDownLatch lost_latch(1);
ble_a.StartScanning(
<<<<<<< HEAD
service_id,
fast_advertisement_service_uuid,
=======
service_id, fast_advertisement_service_uuid,
>>>>>>> release
DiscoveredPeripheralCallback{
.peripheral_discovered_cb =
[&found_latch](
BlePeripheral& peripheral, const std::string& service_id,
<<<<<<< HEAD
=======
const ByteArray& advertisement_bytes,
>>>>>>> release
bool fast_advertisement) { found_latch.CountDown(); },
.peripheral_lost_cb =
[&lost_latch](BlePeripheral& peripheral,
@@ -150,20 +134,12 @@ TEST_F(BleMediumTest, CanStopDiscovery) {
CountDownLatch lost_latch(1);
ble_a.StartScanning(
<<<<<<< HEAD
service_id,
fast_advertisement_service_uuid,
=======
service_id, fast_advertisement_service_uuid,
>>>>>>> release
DiscoveredPeripheralCallback{
.peripheral_discovered_cb =
[&found_latch](
BlePeripheral& peripheral, const std::string& service_id,
<<<<<<< HEAD
=======
const ByteArray& advertisement_bytes,
>>>>>>> release
bool fast_advertisement) { found_latch.CountDown(); },
.peripheral_lost_cb =
[&lost_latch](BlePeripheral& peripheral,
@@ -194,20 +170,12 @@ TEST_F(BleMediumTest, CanStartAcceptingConnectionsAndConnect) {
BlePeripheral* discovered_peripheral = nullptr;
ble_a.StartScanning(
<<<<<<< HEAD
service_id,
fast_advertisement_service_uuid,
=======
service_id, fast_advertisement_service_uuid,
>>>>>>> release
DiscoveredPeripheralCallback{
.peripheral_discovered_cb =
[&found_latch, &discovered_peripheral](
BlePeripheral& peripheral, const std::string& service_id,
<<<<<<< HEAD
=======
const ByteArray& advertisement_bytes,
>>>>>>> release
bool fast_advertisement) {
NEARBY_LOG(
INFO,
-3
View File
@@ -34,12 +34,9 @@ class Future final {
void AddListener(Runnable runnable, api::Executor* executor) {
impl_->AddListener(std::move(runnable), executor);
}
<<<<<<< HEAD
=======
bool IsSet() const {
return impl_->IsSet();
}
>>>>>>> release
private:
// Instance of future implementation is wrapped in shared_ptr<> to make
-12
View File
@@ -39,14 +39,9 @@ class SettableFuture : public api::SettableFuture<T> {
exception_ = {Exception::kSuccess};
completed_.Notify();
InvokeAllLocked();
<<<<<<< HEAD
}
return true;
=======
return true;
}
return false;
>>>>>>> release
}
void AddListener(Runnable runnable, api::Executor* executor) override {
@@ -58,14 +53,11 @@ class SettableFuture : public api::SettableFuture<T> {
}
}
<<<<<<< HEAD
=======
bool IsSet() const {
MutexLock lock(&mutex_);
return done_;
}
>>>>>>> release
bool SetException(Exception exception) override {
MutexLock lock(&mutex_);
return SetExceptionLocked(exception);
@@ -122,11 +114,7 @@ class SettableFuture : public api::SettableFuture<T> {
listeners_.clear();
}
<<<<<<< HEAD
Mutex mutex_;
=======
mutable Mutex mutex_;
>>>>>>> release
ConditionVariable completed_{&mutex_};
std::vector<std::pair<api::Executor*, std::function<void()>>> listeners_;
bool done_{false};