Commit 5cf2ef69 authored by keybuk@chromium.org's avatar keybuk@chromium.org

Remove BluetoothServiceRecord base class.

Since only a Windows implementation remains, move the methods that
platform uses into BluetoothServiceRecordWin and delete the base
class.

BUG=None

Review URL: https://codereview.chromium.org/328483004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276915 0039d316-1c4b-4281-b951-d872f2087c98
parent e178a3cc
......@@ -61,8 +61,6 @@
'bluetooth_remote_gatt_service_chromeos.h',
'bluetooth_rfcomm_channel_mac.mm',
'bluetooth_rfcomm_channel_mac.h',
'bluetooth_service_record.cc',
'bluetooth_service_record.h',
'bluetooth_service_record_win.cc',
'bluetooth_service_record_win.h',
'bluetooth_socket.cc',
......
......@@ -10,7 +10,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/test/test_simple_task_runner.h"
#include "device/bluetooth/bluetooth_device_win.h"
#include "device/bluetooth/bluetooth_service_record.h"
#include "device/bluetooth/bluetooth_service_record_win.h"
#include "device/bluetooth/bluetooth_socket_thread.h"
#include "device/bluetooth/bluetooth_task_manager_win.h"
#include "device/bluetooth/bluetooth_uuid.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/bluetooth/bluetooth_service_record.h"
namespace device {
BluetoothServiceRecord::BluetoothServiceRecord() {
}
BluetoothServiceRecord::~BluetoothServiceRecord() {
}
} // namespace device
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_H_
#define DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_H_
#include <string>
#include "base/basictypes.h"
#include "device/bluetooth/bluetooth_uuid.h"
namespace device {
// BluetoothServiceRecord represents an SDP service record.
//
// This implementation is currently incomplete: it only supports those fields
// that have been necessary so far.
class BluetoothServiceRecord {
public:
virtual ~BluetoothServiceRecord();
// The human-readable name of this service.
const std::string& name() const { return name_; }
// The address of the BluetoothDevice providing this service.
const std::string& address() const { return address_; }
// The UUID of the service. This field may be empty if no UUID was
// specified in the service record.
const BluetoothUUID& uuid() const { return uuid_; }
// Indicates if this service supports HID.
bool SupportsHid() const { return supports_hid_; }
// For HID services, returns the HIDReconnectInitiate attribute. For non-HID
// or unknown services defaults to true.
bool hid_reconnect_initiate() const { return hid_reconnect_initiate_; }
// For HID services, returns the HIDNormallyConnectable attribute. For non-HID
// or unknown services defaults to true.
bool hid_normally_connectable() const { return hid_normally_connectable_; }
// Indicates if this service supports RFCOMM communication.
bool SupportsRfcomm() const { return supports_rfcomm_; }
// The RFCOMM channel to use, if this service supports RFCOMM communication.
// The return value is undefined if SupportsRfcomm() returns false.
uint8 rfcomm_channel() const { return rfcomm_channel_; }
protected:
BluetoothServiceRecord();
std::string address_;
std::string name_;
BluetoothUUID uuid_;
bool supports_hid_;
bool hid_reconnect_initiate_;
bool hid_normally_connectable_;
bool supports_rfcomm_;
uint8 rfcomm_channel_;
private:
DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecord);
};
} // namespace device
#endif // DEVICE_BLUETOOTH_BLUETOOTH_SERVICE_RECORD_H_
......@@ -9,23 +9,44 @@
#include "base/basictypes.h"
#include "device/bluetooth/bluetooth_init_win.h"
#include "device/bluetooth/bluetooth_service_record.h"
#include "device/bluetooth/bluetooth_uuid.h"
namespace device {
class BluetoothServiceRecordWin : public BluetoothServiceRecord {
class BluetoothServiceRecordWin {
public:
BluetoothServiceRecordWin(const std::string& name,
const std::string& address,
uint64 blob_size,
uint8* blob_data);
BTH_ADDR bth_addr() const {
return bth_addr_;
}
BTH_ADDR bth_addr() const { return bth_addr_; }
// The human-readable name of this service.
const std::string& name() const { return name_; }
// The address of the BluetoothDevice providing this service.
const std::string& address() const { return address_; }
// The UUID of the service. This field may be empty if no UUID was
// specified in the service record.
const BluetoothUUID& uuid() const { return uuid_; }
// Indicates if this service supports RFCOMM communication.
bool SupportsRfcomm() const { return supports_rfcomm_; }
// The RFCOMM channel to use, if this service supports RFCOMM communication.
// The return value is undefined if SupportsRfcomm() returns false.
uint8 rfcomm_channel() const { return rfcomm_channel_; }
private:
BTH_ADDR bth_addr_;
std::string address_;
std::string name_;
BluetoothUUID uuid_;
bool supports_rfcomm_;
uint8 rfcomm_channel_;
DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecordWin);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment