Call ConnectToProfile synchronously.

This commit is contained in:
Vibhav Pant
2023-09-09 12:55:27 +05:30
parent 498e77e026
commit 0aee88a9ca
2 changed files with 1 additions and 10 deletions
@@ -103,14 +103,6 @@ std::string BluetoothDevice::GetMacAddress() const {
}
}
void BluetoothDevice::onConnectProfileReply(const sdbus::Error *error) {
if (error != nullptr && error->getName() != "org.bluez.Error.InProgress") {
NEARBY_LOGS(ERROR) << __func__ << ": Got error '" << error->getName()
<< "' with message '" << error->getMessage()
<< " while connecting to profile.";
}
}
bool BluetoothDevice::ConnectToProfile(absl::string_view service_uuid) {
NEARBY_LOGS(VERBOSE) << __func__ << ": " << getObjectPath()
<< ": Attempting to connect to profile " << service_uuid;
@@ -120,7 +112,7 @@ bool BluetoothDevice::ConnectToProfile(absl::string_view service_uuid) {
} catch (const sdbus::Error &e) {
NEARBY_LOGS(ERROR) << __func__ << ": Got error '" << e.getName()
<< "' with message '" << e.getMessage()
<< "' while trying to asynchronously connect to profile "
<< "' while trying to connect to profile "
<< service_uuid << " on device " << getObjectPath();
return false;
}
@@ -76,7 +76,6 @@ class BluetoothDevice
bool Lost() const { return lost_; }
protected:
void onConnectProfileReply(const sdbus::Error *error) override;
void onPairReply(const sdbus::Error *error) override {
absl::ReaderMutexLock l(&pair_callback_lock_);
on_pair_reply_cb_(error);