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
3 // found in the LICENSE file.
4 
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_
7 
8 #include <stdint.h>
9 
10 #include <string>
11 #include <vector>
12 
13 #include "base/macros.h"
14 #include "device/bluetooth/bluetooth_export.h"
15 #include "device/bluetooth/bluetooth_init_win.h"
16 #include "device/bluetooth/public/cpp/bluetooth_uuid.h"
17 
18 namespace device {
19 
20 class DEVICE_BLUETOOTH_EXPORT BluetoothServiceRecordWin {
21  public:
22   BluetoothServiceRecordWin(const std::string& device_address,
23                             const std::string& name,
24                             const std::vector<uint8_t>& sdp_bytes,
25                             const BluetoothUUID& gatt_uuid);
26 
27   bool IsEqual(const BluetoothServiceRecordWin& other);
28 
29   // The BTH_ADDR address of the BluetoothDevice providing this service.
device_bth_addr()30   BTH_ADDR device_bth_addr() const { return device_bth_addr_; }
31 
32   // The address of the BluetoothDevice providing this service.
device_address()33   const std::string& device_address() const { return device_address_; }
34 
35   // The human-readable name of this service.
name()36   const std::string& name() const { return name_; }
37 
38   // The UUID of the service.  This field may be empty if no UUID was
39   // specified in the service record.
uuid()40   const BluetoothUUID& uuid() const { return uuid_; }
41 
42   // Indicates if this service supports RFCOMM communication.
SupportsRfcomm()43   bool SupportsRfcomm() const { return supports_rfcomm_; }
44 
45   // The RFCOMM channel to use, if this service supports RFCOMM communication.
46   // The return value is undefined if SupportsRfcomm() returns false.
rfcomm_channel()47   uint8_t rfcomm_channel() const { return rfcomm_channel_; }
48 
49  private:
50   BTH_ADDR device_bth_addr_;
51   std::string device_address_;
52   std::string name_;
53   BluetoothUUID uuid_;
54 
55   bool supports_rfcomm_;
56   uint8_t rfcomm_channel_;
57 
58   DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecordWin);
59 };
60 
61 }  // namespace device
62 
63 #endif  // DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_WIN_H_
64