Revert 269361 "Fix WebURLLoaderImpl::Context leak if a pending r..."
[chromium-blink-merge.git] / device / bluetooth / bluetooth_service_record.h
blobe4859b11b9dd7a51afa1dff823632cdd44ef2b94
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
3 // found in the LICENSE file.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "device/bluetooth/bluetooth_uuid.h"
13 namespace device {
15 // BluetoothServiceRecord represents an SDP service record.
17 // This implementation is currently incomplete: it only supports those fields
18 // that have been necessary so far.
19 class BluetoothServiceRecord {
20 public:
21 virtual ~BluetoothServiceRecord();
23 // The human-readable name of this service.
24 const std::string& name() const { return name_; }
26 // The address of the BluetoothDevice providing this service.
27 const std::string& address() const { return address_; }
29 // The UUID of the service. This field may be empty if no UUID was
30 // specified in the service record.
31 const BluetoothUUID& uuid() const { return uuid_; }
33 // Indicates if this service supports HID.
34 bool SupportsHid() const { return supports_hid_; }
36 // For HID services, returns the HIDReconnectInitiate attribute. For non-HID
37 // or unknown services defaults to true.
38 bool hid_reconnect_initiate() const { return hid_reconnect_initiate_; }
40 // For HID services, returns the HIDNormallyConnectable attribute. For non-HID
41 // or unknown services defaults to true.
42 bool hid_normally_connectable() const { return hid_normally_connectable_; }
44 // Indicates if this service supports RFCOMM communication.
45 bool SupportsRfcomm() const { return supports_rfcomm_; }
47 // The RFCOMM channel to use, if this service supports RFCOMM communication.
48 // The return value is undefined if SupportsRfcomm() returns false.
49 uint8 rfcomm_channel() const { return rfcomm_channel_; }
51 protected:
52 BluetoothServiceRecord();
54 std::string address_;
55 std::string name_;
56 BluetoothUUID uuid_;
58 bool supports_hid_;
59 bool hid_reconnect_initiate_;
60 bool hid_normally_connectable_;
62 bool supports_rfcomm_;
63 uint8 rfcomm_channel_;
65 private:
66 DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecord);
69 } // namespace device
71 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_H_