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

Unified Diff: device/bluetooth/adapter.cc

Issue 2388533003: bluetooth: Add AdapterInfo in Bluetooth adapter service. (Closed)
Patch Set: JS changes, remove const 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
« no previous file with comments | « device/bluetooth/adapter.h ('k') | device/bluetooth/public/interfaces/adapter.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/adapter.cc
diff --git a/device/bluetooth/adapter.cc b/device/bluetooth/adapter.cc
index 537e84c36c8d2f578a222ca5ed25e90052cfe86f..2352f23b38c9e38db2b432cbd680c092263804fd 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;
« no previous file with comments | « device/bluetooth/adapter.h ('k') | device/bluetooth/public/interfaces/adapter.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698