OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluetooth_low_energy_win.h" | 5 #include "device/bluetooth/bluetooth_low_energy_win.h" |
6 | 6 |
7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "base/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 } | 590 } |
591 | 591 |
592 DevicePropertyValue::DevicePropertyValue(DEVPROPTYPE property_type, | 592 DevicePropertyValue::DevicePropertyValue(DEVPROPTYPE property_type, |
593 scoped_ptr<uint8_t[]> value, | 593 scoped_ptr<uint8_t[]> value, |
594 size_t value_size) | 594 size_t value_size) |
595 : property_type_(property_type), | 595 : property_type_(property_type), |
596 value_(value.Pass()), | 596 value_(value.Pass()), |
597 value_size_(value_size) { | 597 value_size_(value_size) { |
598 } | 598 } |
599 | 599 |
| 600 DevicePropertyValue::~DevicePropertyValue() { |
| 601 } |
| 602 |
600 uint32_t DevicePropertyValue::AsUint32() const { | 603 uint32_t DevicePropertyValue::AsUint32() const { |
601 CHECK_EQ(property_type_, static_cast<DEVPROPTYPE>(DEVPROP_TYPE_UINT32)); | 604 CHECK_EQ(property_type_, static_cast<DEVPROPTYPE>(DEVPROP_TYPE_UINT32)); |
602 CHECK_EQ(value_size_, sizeof(uint32_t)); | 605 CHECK_EQ(value_size_, sizeof(uint32_t)); |
603 return *reinterpret_cast<uint32_t*>(value_.get()); | 606 return *reinterpret_cast<uint32_t*>(value_.get()); |
604 } | 607 } |
605 | 608 |
606 BluetoothLowEnergyServiceInfo::BluetoothLowEnergyServiceInfo() { | 609 BluetoothLowEnergyServiceInfo::BluetoothLowEnergyServiceInfo() { |
607 } | 610 } |
608 | 611 |
609 BluetoothLowEnergyServiceInfo::~BluetoothLowEnergyServiceInfo() { | 612 BluetoothLowEnergyServiceInfo::~BluetoothLowEnergyServiceInfo() { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 668 |
666 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( | 669 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( |
667 const std::string& instance_id, | 670 const std::string& instance_id, |
668 BLUETOOTH_ADDRESS* btha, | 671 BLUETOOTH_ADDRESS* btha, |
669 std::string* error) { | 672 std::string* error) { |
670 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); | 673 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); |
671 } | 674 } |
672 | 675 |
673 } // namespace win | 676 } // namespace win |
674 } // namespace device | 677 } // namespace device |
OLD | NEW |