diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn index ba19401a9323c5..56b36d78949098 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn @@ -240,6 +240,8 @@ component("bluetooth") { sources += [ "bluetooth_adapter_winrt.cc", "bluetooth_adapter_winrt.h", + "bluetooth_device_winrt.cc", + "bluetooth_device_winrt.h", ] libs = [ diff --git a/device/bluetooth/bluetooth_device_winrt.cc b/device/bluetooth/bluetooth_device_winrt.cc new file mode 100644 index 00000000000000..932f48c65ef294 --- /dev/null +++ b/device/bluetooth/bluetooth_device_winrt.cc @@ -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 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 diff --git a/device/bluetooth/bluetooth_device_winrt.h b/device/bluetooth/bluetooth_device_winrt.h new file mode 100644 index 00000000000000..df656cbd7e4f4d --- /dev/null +++ b/device/bluetooth/bluetooth_device_winrt.h @@ -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 + +#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 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_