summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_profile.cc
blob: 73f1128346ac1d1a5dd997fae35b38145cc81712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) 2013 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_profile.h"

#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#include "device/bluetooth/bluetooth_profile_mac.h"
#endif

#include <string>

namespace device {

BluetoothProfile::Options::Options()
    : channel(0),
      psm(0),
      require_authentication(false),
      require_authorization(false),
      auto_connect(false),
      version(0),
      features(0) {
}

BluetoothProfile::Options::~Options() {

}


BluetoothProfile::BluetoothProfile() {

}

BluetoothProfile::~BluetoothProfile() {

}


// static
void BluetoothProfile::Register(const std::string& uuid,
                                const Options& options,
                                const ProfileCallback& callback) {
  BluetoothProfile* profile = NULL;

#if defined(OS_MACOSX)
  if (base::mac::IsOSLionOrLater())
    profile = new BluetoothProfileMac(uuid, options.name);
#endif

  callback.Run(profile);
}

}  // namespace device