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

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

Issue 2785383002: Update unit tests for BluetoothDevice::GetPrimaryServicesByUUID() etc. (Closed)
Patch Set: added TODO 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 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;
35 class BluetoothRemoteGattDescriptor;
36 class BluetoothSocket; 34 class BluetoothSocket;
37 class BluetoothUUID; 35 class BluetoothUUID;
38 36
39 // BluetoothDevice represents a remote Bluetooth device, both its properties and 37 // BluetoothDevice represents a remote Bluetooth device, both its properties and
40 // capabilities as discovered by a local adapter and actions that may be 38 // capabilities as discovered by a local adapter and actions that may be
41 // performed on the remove device such as pairing, connection and disconnection. 39 // performed on the remove device such as pairing, connection and disconnection.
42 // 40 //
43 // The class is instantiated and managed by the BluetoothAdapter class 41 // The class is instantiated and managed by the BluetoothAdapter class
44 // and pointers should only be obtained from that class and not cached, 42 // 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. 43 // instead use the GetAddress() method as a unique key for a device.
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 void ClearAdvertisementData(); 538 void ClearAdvertisementData();
541 539
542 // Return associated BluetoothAdapter. 540 // Return associated BluetoothAdapter.
543 BluetoothAdapter* GetAdapter() { return adapter_; } 541 BluetoothAdapter* GetAdapter() { return adapter_; }
544 542
545 std::vector<BluetoothRemoteGattService*> GetPrimaryServices(); 543 std::vector<BluetoothRemoteGattService*> GetPrimaryServices();
546 544
547 std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID( 545 std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID(
548 const BluetoothUUID& service_uuid); 546 const BluetoothUUID& service_uuid);
549 547
550 std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristicsByUUID(
551 const std::string& service_instance_id,
552 const BluetoothUUID& characteristic_uuid);
553
554 std::vector<device::BluetoothRemoteGattDescriptor*> GetDescriptorsByUUID(
555 device::BluetoothRemoteGattCharacteristic* characteristic,
556 const BluetoothUUID& descriptor_uuid);
557
558 protected: 548 protected:
559 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection. 549 // BluetoothGattConnection is a friend to call Add/RemoveGattConnection.
560 friend BluetoothGattConnection; 550 friend BluetoothGattConnection;
561 FRIEND_TEST_ALL_PREFIXES( 551 FRIEND_TEST_ALL_PREFIXES(
562 BluetoothTest, 552 BluetoothTest,
563 BluetoothGattConnection_DisconnectGatt_SimulateConnect); 553 BluetoothGattConnection_DisconnectGatt_SimulateConnect);
564 FRIEND_TEST_ALL_PREFIXES( 554 FRIEND_TEST_ALL_PREFIXES(
565 BluetoothTest, 555 BluetoothTest,
566 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect); 556 BluetoothGattConnection_DisconnectGatt_SimulateDisconnect);
567 FRIEND_TEST_ALL_PREFIXES(BluetoothTest, 557 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 666 // Returns a localized string containing the device's bluetooth address and
677 // a device type for display when |name_| is empty. 667 // a device type for display when |name_| is empty.
678 base::string16 GetAddressWithLocalizedDeviceTypeName() const; 668 base::string16 GetAddressWithLocalizedDeviceTypeName() const;
679 669
680 DISALLOW_COPY_AND_ASSIGN(BluetoothDevice); 670 DISALLOW_COPY_AND_ASSIGN(BluetoothDevice);
681 }; 671 };
682 672
683 } // namespace device 673 } // namespace device
684 674
685 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ 675 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698