diff options
Diffstat (limited to 'device')
-rw-r--r-- | device/bluetooth/bluetooth_adapter_win.cc | 79 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_adapter_win.h | 46 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_device_win.cc | 121 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_device_win.h | 63 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_socket_win.cc | 24 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_socket_win.h | 24 | ||||
-rw-r--r-- | device/device.gyp | 6 |
7 files changed, 363 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_adapter_win.cc b/device/bluetooth/bluetooth_adapter_win.cc new file mode 100644 index 0000000..c248c9a --- /dev/null +++ b/device/bluetooth/bluetooth_adapter_win.cc @@ -0,0 +1,79 @@ +// 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. +// +// TODO(youngki): Implement this file. + +#include "device/bluetooth/bluetooth_adapter_win.h" + +#include <string> +#include "base/logging.h" + +namespace device { + +BluetoothAdapterWin::BluetoothAdapterWin() : BluetoothAdapter() { +} + +BluetoothAdapterWin::~BluetoothAdapterWin() { +} + +void BluetoothAdapterWin::AddObserver(BluetoothAdapter::Observer* observer) { + NOTIMPLEMENTED(); +} + +void BluetoothAdapterWin::RemoveObserver(BluetoothAdapter::Observer* observer) { + NOTIMPLEMENTED(); +} + +bool BluetoothAdapterWin::IsPresent() const { + NOTIMPLEMENTED(); + return false; +} + +bool BluetoothAdapterWin::IsPowered() const { + NOTIMPLEMENTED(); + return false; +} + +void BluetoothAdapterWin::SetPowered( + bool powered, + const base::Closure& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +bool BluetoothAdapterWin::IsDiscovering() const { + NOTIMPLEMENTED(); + return false; +} + +void BluetoothAdapterWin::SetDiscovering( + bool discovering, + const base::Closure& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +BluetoothAdapter::ConstDeviceList BluetoothAdapterWin::GetDevices() const { + NOTIMPLEMENTED(); + return BluetoothAdapter::ConstDeviceList(); +} + +BluetoothDevice* BluetoothAdapterWin::GetDevice(const std::string& address) { + NOTIMPLEMENTED(); + return NULL; +} + +const BluetoothDevice* BluetoothAdapterWin::GetDevice( + const std::string& address) const { + NOTIMPLEMENTED(); + return NULL; +} + +void BluetoothAdapterWin::ReadLocalOutOfBandPairingData( + const BluetoothOutOfBandPairingDataCallback& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +} // namespace device diff --git a/device/bluetooth/bluetooth_adapter_win.h b/device/bluetooth/bluetooth_adapter_win.h new file mode 100644 index 0000000..8df27a2 --- /dev/null +++ b/device/bluetooth/bluetooth_adapter_win.h @@ -0,0 +1,46 @@ +// 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_ADAPTER_WIN_H_ +#define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ + +#include <string> + +#include "device/bluetooth/bluetooth_adapter.h" + +namespace device { + +class BluetoothDevice; + +class BluetoothAdapterWin : public BluetoothAdapter { + // BluetoothAdapter override + virtual void AddObserver(BluetoothAdapter::Observer* observer) OVERRIDE; + virtual void RemoveObserver(BluetoothAdapter::Observer* observer) OVERRIDE; + virtual bool IsPresent() const OVERRIDE; + virtual bool IsPowered() const OVERRIDE; + virtual void SetPowered( + bool powered, + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; + virtual bool IsDiscovering() const OVERRIDE; + virtual void SetDiscovering( + bool discovering, + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; + virtual ConstDeviceList GetDevices() const OVERRIDE; + virtual BluetoothDevice* GetDevice(const std::string& address) OVERRIDE; + virtual const BluetoothDevice* GetDevice( + const std::string& address) const OVERRIDE; + virtual void ReadLocalOutOfBandPairingData( + const BluetoothOutOfBandPairingDataCallback& callback, + const ErrorCallback& error_callback) OVERRIDE; + + private: + BluetoothAdapterWin(); + virtual ~BluetoothAdapterWin(); +}; + +} // namespace device + +#endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc new file mode 100644 index 0000000..5b6cd9c --- /dev/null +++ b/device/bluetooth/bluetooth_device_win.cc @@ -0,0 +1,121 @@ +// 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. +// +// TODO(youngki): Implement this file. + +#include "device/bluetooth/bluetooth_device_win.h" + +#include <string> +#include "base/basictypes.h" +#include "base/logging.h" +#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h" + +namespace device { + +BluetoothDeviceWin::BluetoothDeviceWin() : BluetoothDevice() { +} + +BluetoothDeviceWin::~BluetoothDeviceWin() { +} + +bool BluetoothDeviceWin::IsPaired() const { + NOTIMPLEMENTED(); + return false; +} + +const BluetoothDevice::ServiceList& BluetoothDeviceWin::GetServices() const { + NOTIMPLEMENTED(); + return service_uuids_; +} + +void BluetoothDeviceWin::GetServiceRecords( + const ServiceRecordsCallback& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +bool BluetoothDeviceWin::ProvidesServiceWithUUID( + const std::string& uuid) const { + NOTIMPLEMENTED(); + return false; +} + +void BluetoothDeviceWin::ProvidesServiceWithName( + const std::string& name, + const ProvidesServiceCallback& callback) { + NOTIMPLEMENTED(); +} + +bool BluetoothDeviceWin::ExpectingPinCode() const { + NOTIMPLEMENTED(); + return false; +} + +bool BluetoothDeviceWin::ExpectingPasskey() const { + NOTIMPLEMENTED(); + return false; +} + +bool BluetoothDeviceWin::ExpectingConfirmation() const { + NOTIMPLEMENTED(); + return false; +} + +void BluetoothDeviceWin::Connect( + PairingDelegate* pairing_delegate, + const base::Closure& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::SetPinCode(const std::string& pincode) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::SetPasskey(uint32 passkey) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::ConfirmPairing() { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::RejectPairing() { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::CancelPairing() { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::Disconnect( + const base::Closure& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::Forget(const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::ConnectToService( + const std::string& service_uuid, + const SocketCallback& callback) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::SetOutOfBandPairingData( + const BluetoothOutOfBandPairingData& data, + const base::Closure& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +void BluetoothDeviceWin::ClearOutOfBandPairingData( + const base::Closure& callback, + const ErrorCallback& error_callback) { + NOTIMPLEMENTED(); +} + +} // namespace device diff --git a/device/bluetooth/bluetooth_device_win.h b/device/bluetooth/bluetooth_device_win.h new file mode 100644 index 0000000..ee2048b --- /dev/null +++ b/device/bluetooth/bluetooth_device_win.h @@ -0,0 +1,63 @@ +// 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_DEVICE_WIN_H_ +#define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ + +#include <string> + +#include "base/basictypes.h" +#include "device/bluetooth/bluetooth_device.h" + +namespace device { + +class BluetoothDeviceWin : public BluetoothDevice { + public: + BluetoothDeviceWin(); + virtual ~BluetoothDeviceWin(); + + virtual bool IsPaired() const OVERRIDE; + virtual const ServiceList& GetServices() const OVERRIDE; + virtual void GetServiceRecords( + const ServiceRecordsCallback& callback, + const ErrorCallback& error_callback) OVERRIDE; + virtual bool ProvidesServiceWithUUID(const std::string& uuid) const OVERRIDE; + virtual void ProvidesServiceWithName( + const std::string& name, + const ProvidesServiceCallback& callback) OVERRIDE; + virtual bool ExpectingPinCode() const OVERRIDE; + virtual bool ExpectingPasskey() const OVERRIDE; + virtual bool ExpectingConfirmation() const OVERRIDE; + virtual void Connect( + PairingDelegate* pairing_delegate, + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; + virtual void SetPinCode(const std::string& pincode) OVERRIDE; + virtual void SetPasskey(uint32 passkey) OVERRIDE; + virtual void ConfirmPairing() OVERRIDE; + virtual void RejectPairing() OVERRIDE; + virtual void CancelPairing() OVERRIDE; + virtual void Disconnect( + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; + virtual void Forget(const ErrorCallback& error_callback) OVERRIDE; + virtual void ConnectToService( + const std::string& service_uuid, + const SocketCallback& callback) OVERRIDE; + virtual void SetOutOfBandPairingData( + const BluetoothOutOfBandPairingData& data, + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; + virtual void ClearOutOfBandPairingData( + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; + + private: + // The services (identified by UUIDs) that this device provides. + std::vector<std::string> service_uuids_; +}; + +} // namespace device + +#endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ diff --git a/device/bluetooth/bluetooth_socket_win.cc b/device/bluetooth/bluetooth_socket_win.cc new file mode 100644 index 0000000..ab83a1f --- /dev/null +++ b/device/bluetooth/bluetooth_socket_win.cc @@ -0,0 +1,24 @@ +// 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. +// +// TODO(youngki): Implement this file. + +#include "device/bluetooth/bluetooth_socket_win.h" + +#include "base/logging.h" + +namespace device { + +BluetoothSocketWin::BluetoothSocketWin() { +} + +BluetoothSocketWin::~BluetoothSocketWin() { +} + +int BluetoothSocketWin::fd() const { + NOTIMPLEMENTED(); + return -1; +} + +} // namespace device diff --git a/device/bluetooth/bluetooth_socket_win.h b/device/bluetooth/bluetooth_socket_win.h new file mode 100644 index 0000000..e9fe120 --- /dev/null +++ b/device/bluetooth/bluetooth_socket_win.h @@ -0,0 +1,24 @@ +// 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_SOCKET_WIN_H_ +#define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_WIN_H_ + +#include "device/bluetooth/bluetooth_socket.h" + +namespace device { + +class BluetoothSocketWin : public BluetoothSocket { + public: + // BluetoothSocket override + virtual int fd() const OVERRIDE; + + private: + BluetoothSocketWin(); + virtual ~BluetoothSocketWin(); +}; + +} // namespace device + +#endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_WIN_H_ diff --git a/device/device.gyp b/device/device.gyp index e75cfd5..675b8a0 100644 --- a/device/device.gyp +++ b/device/device.gyp @@ -21,16 +21,22 @@ 'bluetooth/bluetooth_adapter_chromeos.h', 'bluetooth/bluetooth_adapter_factory.cc', 'bluetooth/bluetooth_adapter_factory.h', + 'bluetooth/bluetooth_adapter_win.cc', + 'bluetooth/bluetooth_adapter_win.h', 'bluetooth/bluetooth_device.cc', 'bluetooth/bluetooth_device.h', 'bluetooth/bluetooth_device_chromeos.cc', 'bluetooth/bluetooth_device_chromeos.h', + 'bluetooth/bluetooth_device_win.cc', + 'bluetooth/bluetooth_device_win.h', 'bluetooth/bluetooth_out_of_band_pairing_data.h', 'bluetooth/bluetooth_service_record.cc', 'bluetooth/bluetooth_service_record.h', 'bluetooth/bluetooth_socket.h', 'bluetooth/bluetooth_socket_chromeos.cc', 'bluetooth/bluetooth_socket_chromeos.h', + 'bluetooth/bluetooth_socket_win.cc', + 'bluetooth/bluetooth_socket_win.h', 'bluetooth/bluetooth_utils.cc', 'bluetooth/bluetooth_utils.h', ], |