OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SERVICE_RECORD_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "device/bluetooth/bluetooth_init_win.h" | 12 #include "device/bluetooth/bluetooth_init_win.h" |
12 #include "device/bluetooth/bluetooth_uuid.h" | 13 #include "device/bluetooth/bluetooth_uuid.h" |
13 | 14 |
14 namespace device { | 15 namespace device { |
15 | 16 |
16 class BluetoothServiceRecordWin { | 17 class BluetoothServiceRecordWin { |
17 public: | 18 public: |
18 BluetoothServiceRecordWin(const std::string& name, | 19 BluetoothServiceRecordWin(const std::string& device_address, |
19 const std::string& address, | 20 const std::string& name, |
20 uint64 blob_size, | 21 const std::vector<uint8>& sdp_bytes, |
21 uint8* blob_data); | 22 const BluetoothUUID& gatt_uuid); |
22 | 23 |
23 BTH_ADDR bth_addr() const { return bth_addr_; } | 24 // The BTH_ADDR address of the BluetoothDevice providing this service. |
| 25 BTH_ADDR device_bth_addr() const { return device_bth_addr_; } |
| 26 |
| 27 // The address of the BluetoothDevice providing this service. |
| 28 const std::string& device_address() const { return device_address_; } |
24 | 29 |
25 // The human-readable name of this service. | 30 // The human-readable name of this service. |
26 const std::string& name() const { return name_; } | 31 const std::string& name() const { return name_; } |
27 | 32 |
28 // The address of the BluetoothDevice providing this service. | |
29 const std::string& address() const { return address_; } | |
30 | |
31 // The UUID of the service. This field may be empty if no UUID was | 33 // The UUID of the service. This field may be empty if no UUID was |
32 // specified in the service record. | 34 // specified in the service record. |
33 const BluetoothUUID& uuid() const { return uuid_; } | 35 const BluetoothUUID& uuid() const { return uuid_; } |
34 | 36 |
35 // Indicates if this service supports RFCOMM communication. | 37 // Indicates if this service supports RFCOMM communication. |
36 bool SupportsRfcomm() const { return supports_rfcomm_; } | 38 bool SupportsRfcomm() const { return supports_rfcomm_; } |
37 | 39 |
38 // The RFCOMM channel to use, if this service supports RFCOMM communication. | 40 // The RFCOMM channel to use, if this service supports RFCOMM communication. |
39 // The return value is undefined if SupportsRfcomm() returns false. | 41 // The return value is undefined if SupportsRfcomm() returns false. |
40 uint8 rfcomm_channel() const { return rfcomm_channel_; } | 42 uint8 rfcomm_channel() const { return rfcomm_channel_; } |
41 | 43 |
42 private: | 44 private: |
43 BTH_ADDR bth_addr_; | 45 BTH_ADDR device_bth_addr_; |
44 std::string address_; | 46 std::string device_address_; |
45 std::string name_; | 47 std::string name_; |
46 BluetoothUUID uuid_; | 48 BluetoothUUID uuid_; |
47 | 49 |
48 bool supports_rfcomm_; | 50 bool supports_rfcomm_; |
49 uint8 rfcomm_channel_; | 51 uint8 rfcomm_channel_; |
50 | 52 |
51 DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecordWin); | 53 DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecordWin); |
52 }; | 54 }; |
53 | 55 |
54 } // namespace device | 56 } // namespace device |
55 | 57 |
56 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_ | 58 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_ |
OLD | NEW |