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