From 9bf562c43f1890642d1d58b4acbfed43deb0805c Mon Sep 17 00:00:00 2001 From: "keybuk@chromium.org" Date: Thu, 20 Mar 2014 19:11:57 +0000 Subject: Bluetooth: replace "profiles" with "uuids" The set of UUIDs for a given device will, in future, consist of not just the traditional Profiles found via SDP but also GATT Services found via primary service discovery as well as profile, protocol and service class UUIDs advertised in EIR data (classic) or AD (Low Energy). It therefore makes sense to just refer to these as "uuids" everywhere, especially since the specific UUID identifies exactly what is meant to the application developer. Since EIR and AD are passively received, rather than actively fetched, make this a property of a device rather than a polled function Specific changes to the C++ API: - Renamed BluetoothDevice::GetServices() to GetUUIDs() - Removed BluetoothDevice::GetServiceRecords() - Removed BluetoothDevice::ProvicesServiceWithName() - Removed BluetoothDevice::ProvidesServiceWithUUID() Specific changes to the JavaScript API: - Manifest entry changed from "profiles" to "uuids". - New "uuids" array added to Device object. - Removed chrome.bluetooth.getProfiles() and getServices(). BUG=339217 TEST=Updated tests included TBR=mkearney@chromium.org Review URL: https://codereview.chromium.org/196383033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258368 0039d316-1c4b-4281-b951-d872f2087c98 --- device/bluetooth/bluetooth_device_win.cc | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'device/bluetooth/bluetooth_device_win.cc') diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc index 3f95efd..da016f7 100644 --- a/device/bluetooth/bluetooth_device_win.cc +++ b/device/bluetooth/bluetooth_device_win.cc @@ -48,7 +48,7 @@ BluetoothDeviceWin::BluetoothDeviceWin( (*iter)->sdp_bytes.size(), sdp_bytes_buffer); service_record_list_.push_back(service_record); - service_uuids_.push_back(service_record->uuid()); + uuids_.push_back(service_record->uuid()); } } @@ -104,28 +104,8 @@ bool BluetoothDeviceWin::IsConnecting() const { return false; } -BluetoothDevice::ServiceList BluetoothDeviceWin::GetServices() const { - return service_uuids_; -} - -void BluetoothDeviceWin::GetServiceRecords( - const ServiceRecordsCallback& callback, - const ErrorCallback& error_callback) { - callback.Run(service_record_list_); -} - -void BluetoothDeviceWin::ProvidesServiceWithName( - const std::string& name, - const ProvidesServiceCallback& callback) { - for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); - iter != service_record_list_.end(); - ++iter) { - if ((*iter)->name() == name) { - callback.Run(true); - return; - } - } - callback.Run(false); +BluetoothDevice::UUIDList BluetoothDeviceWin::GetUUIDs() const { + return uuids_; } bool BluetoothDeviceWin::ExpectingPinCode() const { -- cgit v1.1