forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bluetooth] Introduce BluetoothDeviceWinrt
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
Showing
3 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ |