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

Side by Side Diff: device/bluetooth/bluetooth_device.h

Issue 2615323002: Move some functions from web_bluetooth_service_impl.cc to BluetoothDevice class (Closed)
Patch Set: merge master Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "base/time/time.h" 24 #include "base/time/time.h"
25 #include "device/bluetooth/bluetooth_common.h" 25 #include "device/bluetooth/bluetooth_common.h"
26 #include "device/bluetooth/bluetooth_export.h" 26 #include "device/bluetooth/bluetooth_export.h"
27 #include "device/bluetooth/bluetooth_remote_gatt_service.h" 27 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
28 #include "device/bluetooth/bluetooth_uuid.h" 28 #include "device/bluetooth/bluetooth_uuid.h"
29 29
30 namespace device { 30 namespace device {
31 31
32 class BluetoothAdapter; 32 class BluetoothAdapter;
33 class BluetoothGattConnection; 33 class BluetoothGattConnection;
34 class BluetoothRemoteGattCharacteristic;
34 class BluetoothSocket; 35 class BluetoothSocket;
35 class BluetoothUUID; 36 class BluetoothUUID;
36 37
37 // BluetoothDevice represents a remote Bluetooth device, both its properties and 38 // BluetoothDevice represents a remote Bluetooth device, both its properties and
38 // capabilities as discovered by a local adapter and actions that may be 39 // capabilities as discovered by a local adapter and actions that may be
39 // performed on the remove device such as pairing, connection and disconnection. 40 // performed on the remove device such as pairing, connection and disconnection.
40 // 41 //
41 // The class is instantiated and managed by the BluetoothAdapter class 42 // The class is instantiated and managed by the BluetoothAdapter class
42 // and pointers should only be obtained from that class and not cached, 43 // and pointers should only be obtained from that class and not cached,
43 // instead use the GetAddress() method as a unique key for a device. 44 // instead use the GetAddress() method as a unique key for a device.
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 UUIDList advertised_uuids, 549 UUIDList advertised_uuids,
549 ServiceDataMap service_data, 550 ServiceDataMap service_data,
550 const int8_t* tx_power); 551 const int8_t* tx_power);
551 552
552 // Called by BluetoothAdapter when it stops discoverying. 553 // Called by BluetoothAdapter when it stops discoverying.
553 void ClearAdvertisementData(); 554 void ClearAdvertisementData();
554 555
555 // Return associated BluetoothAdapter. 556 // Return associated BluetoothAdapter.
556 BluetoothAdapter* GetAdapter() { return adapter_; } 557 BluetoothAdapter* GetAdapter() { return adapter_; }
557 558
559 std::vector<BluetoothRemoteGattService*> GetPrimaryServices();
560
561 std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID(
562 const BluetoothUUID& service_uuid);
563
564 std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristicsByUUID(
565 const std::string& service_instance_id,
566 const BluetoothUUID& characteristic_uuid);
567
558 protected: 568 protected:
559 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection. 569 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection.
560 friend BluetoothGattConnection; 570 friend BluetoothGattConnection;
561 FRIEND_TEST_ALL_PREFIXES( 571 FRIEND_TEST_ALL_PREFIXES(
562 BluetoothTest, 572 BluetoothTest,
563 BluetoothGattConnection_DisconnectGatt_SimulateConnect); 573 BluetoothGattConnection_DisconnectGatt_SimulateConnect);
564 FRIEND_TEST_ALL_PREFIXES( 574 FRIEND_TEST_ALL_PREFIXES(
565 BluetoothTest, 575 BluetoothTest,
566 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect); 576 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect);
567 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, 577 FRIEND_TEST_ALL_PREFIXES(BluetoothTest,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 // Returns a localized string containing the device's bluetooth address and 686 // Returns a localized string containing the device's bluetooth address and
677 // a device type for display when |name_| is empty. 687 // a device type for display when |name_| is empty.
678 base::string16 GetAddressWithLocalizedDeviceTypeName() const; 688 base::string16 GetAddressWithLocalizedDeviceTypeName() const;
679 689
680 DISALLOW_COPY_AND_ASSIGN(BluetoothDevice); 690 DISALLOW_COPY_AND_ASSIGN(BluetoothDevice);
681 }; 691 };
682 692
683 } // namespace device 693 } // namespace device
684 694
685 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 695 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW
« no previous file with comments | « content/browser/bluetooth/web_bluetooth_service_impl.cc ('k') | device/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698