Skip to content

Commit

Permalink
[bluetooth] Introduce BluetoothDeviceWinrt
Browse files Browse the repository at this point in the history
This change introduces a skeleton for BluetoothDeviceWinrt. All of its
methods are NOTIMPLEMENTED, and no code creates an instance of it.
Further functionality will be added in future CLs.

Bug: 507419, 821766
Change-Id: Ieafdad50ff3404239c0c2bb71c00e625b8a433fc
Reviewed-on: https://chromium-review.googlesource.com/1046654
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556812}
  • Loading branch information
jdoerrie authored and Commit Bot committed May 8, 2018
1 parent df04b89 commit 73f3b63
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 0 deletions.
2 changes: 2 additions & 0 deletions device/bluetooth/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ component("bluetooth") {
sources += [
"bluetooth_adapter_winrt.cc",
"bluetooth_adapter_winrt.h",
"bluetooth_device_winrt.cc",
"bluetooth_device_winrt.h",
]

libs = [
Expand Down
168 changes: 168 additions & 0 deletions device/bluetooth/bluetooth_device_winrt.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
// Copyright 2018 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_device_winrt.h"

#include "base/logging.h"
#include "device/bluetooth/bluetooth_adapter_winrt.h"

namespace device {

BluetoothDeviceWinrt::BluetoothDeviceWinrt(BluetoothAdapterWinrt* adapter)
: BluetoothDevice(adapter) {}

BluetoothDeviceWinrt::~BluetoothDeviceWinrt() = default;

uint32_t BluetoothDeviceWinrt::GetBluetoothClass() const {
NOTIMPLEMENTED();
return 0;
}

std::string BluetoothDeviceWinrt::GetAddress() const {
NOTIMPLEMENTED();
return std::string();
}

BluetoothDevice::VendorIDSource BluetoothDeviceWinrt::GetVendorIDSource()
const {
NOTIMPLEMENTED();
return VendorIDSource();
}

uint16_t BluetoothDeviceWinrt::GetVendorID() const {
NOTIMPLEMENTED();
return 0;
}

uint16_t BluetoothDeviceWinrt::GetProductID() const {
NOTIMPLEMENTED();
return 0;
}

uint16_t BluetoothDeviceWinrt::GetDeviceID() const {
NOTIMPLEMENTED();
return 0;
}

uint16_t BluetoothDeviceWinrt::GetAppearance() const {
NOTIMPLEMENTED();
return 0;
}

base::Optional<std::string> BluetoothDeviceWinrt::GetName() const {
NOTIMPLEMENTED();
return base::nullopt;
}

bool BluetoothDeviceWinrt::IsPaired() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::IsConnected() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::IsGattConnected() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::IsConnectable() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::IsConnecting() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::ExpectingPinCode() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::ExpectingPasskey() const {
NOTIMPLEMENTED();
return false;
}

bool BluetoothDeviceWinrt::ExpectingConfirmation() const {
NOTIMPLEMENTED();
return false;
}

void BluetoothDeviceWinrt::GetConnectionInfo(
const ConnectionInfoCallback& callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::SetConnectionLatency(
ConnectionLatency connection_latency,
const base::Closure& callback,
const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::Connect(PairingDelegate* pairing_delegate,
const base::Closure& callback,
const ConnectErrorCallback& error_callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::SetPinCode(const std::string& pincode) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::SetPasskey(uint32_t passkey) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::ConfirmPairing() {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::RejectPairing() {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::CancelPairing() {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::Disconnect(const base::Closure& callback,
const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::Forget(const base::Closure& callback,
const ErrorCallback& error_callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::ConnectToService(
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::ConnectToServiceInsecurely(
const device::BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::CreateGattConnectionImpl() {
NOTIMPLEMENTED();
}

void BluetoothDeviceWinrt::DisconnectGatt() {
NOTIMPLEMENTED();
}

} // namespace device
77 changes: 77 additions & 0 deletions device/bluetooth/bluetooth_device_winrt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright 2018 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_DEVICE_WINRT_H_
#define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WINRT_H_

#include <string>

#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/optional.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_export.h"

namespace device {

class BluetoothAdapterWinrt;

class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceWinrt : public BluetoothDevice {
public:
explicit BluetoothDeviceWinrt(BluetoothAdapterWinrt* adapter);
~BluetoothDeviceWinrt() override;

// BluetoothDevice:
uint32_t GetBluetoothClass() const override;
std::string GetAddress() const override;
VendorIDSource GetVendorIDSource() const override;
uint16_t GetVendorID() const override;
uint16_t GetProductID() const override;
uint16_t GetDeviceID() const override;
uint16_t GetAppearance() const override;
base::Optional<std::string> GetName() const override;
bool IsPaired() const override;
bool IsConnected() const override;
bool IsGattConnected() const override;
bool IsConnectable() const override;
bool IsConnecting() const override;
bool ExpectingPinCode() const override;
bool ExpectingPasskey() const override;
bool ExpectingConfirmation() const override;
void GetConnectionInfo(const ConnectionInfoCallback& callback) override;
void SetConnectionLatency(ConnectionLatency connection_latency,
const base::Closure& callback,
const ErrorCallback& error_callback) override;
void Connect(PairingDelegate* pairing_delegate,
const base::Closure& callback,
const ConnectErrorCallback& error_callback) override;
void SetPinCode(const std::string& pincode) override;
void SetPasskey(uint32_t passkey) override;
void ConfirmPairing() override;
void RejectPairing() override;
void CancelPairing() override;
void Disconnect(const base::Closure& callback,
const ErrorCallback& error_callback) override;
void Forget(const base::Closure& callback,
const ErrorCallback& error_callback) override;
void ConnectToService(
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) override;
void ConnectToServiceInsecurely(
const device::BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) override;

protected:
// BluetoothDevice:
void CreateGattConnectionImpl() override;
void DisconnectGatt() override;

DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWinrt);
};

} // namespace device

#endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WINRT_H_

0 comments on commit 73f3b63

Please sign in to comment.