Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: device/bluetooth/adapter.cc

Issue 2388533003: bluetooth: Add AdapterInfo in Bluetooth adapter service. (Closed)
Patch Set: Update mojom comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/adapter.cc
diff --git a/device/bluetooth/adapter.cc b/device/bluetooth/adapter.cc
index 89a2d126b566b4015718703bfcca4062b6aeb0b2..1d0a25aaa3e9c025fbe734d88e760ba4c073152e 100644
--- a/device/bluetooth/adapter.cc
+++ b/device/bluetooth/adapter.cc
@@ -24,6 +24,18 @@ Adapter::~Adapter() {
adapter_ = nullptr;
}
+void Adapter::GetInfo(const GetInfoCallback& callback) {
+ mojom::AdapterInfoPtr adapter_info = mojom::AdapterInfo::New();
+ adapter_info->address = adapter_->GetAddress();
+ adapter_info->name = adapter_->GetName();
+ adapter_info->initialized = adapter_->IsInitialized();
+ adapter_info->present = adapter_->IsPresent();
+ adapter_info->powered = adapter_->IsPowered();
+ adapter_info->discoverable = adapter_->IsDiscoverable();
+ adapter_info->discovering = adapter_->IsDiscovering();
+ callback.Run(std::move(adapter_info));
+}
+
void Adapter::GetDevices(const GetDevicesCallback& callback) {
std::vector<mojom::DeviceInfoPtr> devices;

Powered by Google App Engine
This is Rietveld 408576698