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

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

Issue 2785383002: Update unit tests for BluetoothDevice::GetPrimaryServicesByUUID() etc. (Closed)
Patch Set: address comments Created 3 years, 8 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 14 matching lines...) Expand all
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 BluetoothRemoteGattCharacteristic;
35 class BluetoothRemoteGattDescriptor;
36 class BluetoothSocket; 35 class BluetoothSocket;
37 class BluetoothUUID; 36 class BluetoothUUID;
38 37
39 // BluetoothDevice represents a remote Bluetooth device, both its properties and 38 // BluetoothDevice represents a remote Bluetooth device, both its properties and
40 // 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
41 // performed on the remove device such as pairing, connection and disconnection. 40 // performed on the remove device such as pairing, connection and disconnection.
42 // 41 //
43 // The class is instantiated and managed by the BluetoothAdapter class 42 // The class is instantiated and managed by the BluetoothAdapter class
44 // 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,
45 // 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 543
545 std::vector<BluetoothRemoteGattService*> GetPrimaryServices(); 544 std::vector<BluetoothRemoteGattService*> GetPrimaryServices();
546 545
547 std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID( 546 std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID(
548 const BluetoothUUID& service_uuid); 547 const BluetoothUUID& service_uuid);
549 548
550 std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristicsByUUID( 549 std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristicsByUUID(
551 const std::string& service_instance_id, 550 const std::string& service_instance_id,
552 const BluetoothUUID& characteristic_uuid); 551 const BluetoothUUID& characteristic_uuid);
553 552
554 std::vector<device::BluetoothRemoteGattDescriptor*> GetDescriptorsByUUID(
555 device::BluetoothRemoteGattCharacteristic* characteristic,
556 const BluetoothUUID& descriptor_uuid);
557
558 protected: 553 protected:
559 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection. 554 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection.
560 friend BluetoothGattConnection; 555 friend BluetoothGattConnection;
561 FRIEND_TEST_ALL_PREFIXES( 556 FRIEND_TEST_ALL_PREFIXES(
562 BluetoothTest, 557 BluetoothTest,
563 BluetoothGattConnection_DisconnectGatt_SimulateConnect); 558 BluetoothGattConnection_DisconnectGatt_SimulateConnect);
564 FRIEND_TEST_ALL_PREFIXES( 559 FRIEND_TEST_ALL_PREFIXES(
565 BluetoothTest, 560 BluetoothTest,
566 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect); 561 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect);
567 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, 562 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 671 // Returns a localized string containing the device's bluetooth address and
677 // a device type for display when |name_| is empty. 672 // a device type for display when |name_| is empty.
678 base::string16 GetAddressWithLocalizedDeviceTypeName() const; 673 base::string16 GetAddressWithLocalizedDeviceTypeName() const;
679 674
680 DISALLOW_COPY_AND_ASSIGN(BluetoothDevice); 675 DISALLOW_COPY_AND_ASSIGN(BluetoothDevice);
681 }; 676 };
682 677
683 } // namespace device 678 } // namespace device
684 679
685 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 680 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698