Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
|
ortuno
2016/02/19 17:33:06
2016
gogerald1
2016/02/19 22:45:02
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ | |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "base/sequenced_task_runner.h" | |
| 10 #include "device/bluetooth/bluetooth_gatt_characteristic.h" | |
| 11 #include "device/bluetooth/bluetooth_low_energy_defs_win.h" | |
| 12 | |
| 13 namespace device { | |
| 14 | |
| 15 class BluetoothAdapterWin; | |
| 16 class BluetoothRemoteGattServiceWin; | |
| 17 class BluetoothTaskManagerWin; | |
| 18 | |
| 19 // The BluetoothRemoteGattCharacteristicWin class implements | |
| 20 // BluetoothGattCharacteristic for remote GATT services on Windows 8 and later. | |
| 21 class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicWin | |
| 22 : public BluetoothGattCharacteristic { | |
| 23 public: | |
| 24 BluetoothRemoteGattCharacteristicWin( | |
| 25 BluetoothRemoteGattServiceWin* parent_service, | |
| 26 BTH_LE_GATT_CHARACTERISTIC* characteristic_info, | |
| 27 scoped_refptr<base::SequencedTaskRunner>& ui_task_runner); | |
| 28 ~BluetoothRemoteGattCharacteristicWin() override; | |
| 29 | |
| 30 // Override BluetoothGattCharacteristic interfaces. | |
| 31 std::string GetIdentifier() const override; | |
| 32 BluetoothUUID GetUUID() const override; | |
| 33 bool IsLocal() const override; | |
| 34 std::vector<uint8_t>& GetValue() const override; | |
| 35 BluetoothGattService* GetService() const override; | |
| 36 Properties GetProperties() const override; | |
| 37 Permissions GetPermissions() const override; | |
| 38 bool IsNotifying() const override; | |
| 39 std::vector<BluetoothGattDescriptor*> GetDescriptors() const override; | |
| 40 BluetoothGattDescriptor* GetDescriptor( | |
| 41 const std::string& identifier) const override; | |
| 42 bool AddDescriptor(BluetoothGattDescriptor* descriptor) override; | |
| 43 bool UpdateValue(const std::vector<uint8_t>& value) override; | |
| 44 void StartNotifySession(const NotifySessionCallback& callback, | |
| 45 const ErrorCallback& error_callback) override; | |
| 46 void ReadRemoteCharacteristic(const ValueCallback& callback, | |
| 47 const ErrorCallback& error_callback) override; | |
| 48 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value, | |
| 49 const base::Closure& callback, | |
| 50 const ErrorCallback& error_callback) override; | |
| 51 | |
| 52 void Update(); | |
|
ortuno
2016/02/19 17:33:06
This function name is too vague. Please make the n
gogerald1
2016/02/19 22:45:02
Done. add a description should be enough.
| |
| 53 uint16_t GetAttributeHandle() const; | |
| 54 | |
| 55 private: | |
| 56 BluetoothAdapterWin* adapter_; | |
| 57 BluetoothRemoteGattServiceWin* parent_service_; | |
| 58 scoped_refptr<BluetoothTaskManagerWin> task_manager_; | |
| 59 | |
| 60 // Characteristic info from OS and used to interact with OS. | |
| 61 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info_; | |
| 62 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | |
| 63 BluetoothUUID characteristic_uuid_; | |
| 64 std::vector<uint8_t> characteristic_value_; | |
| 65 | |
| 66 base::WeakPtrFactory<BluetoothRemoteGattCharacteristicWin> weak_ptr_factory_; | |
| 67 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicWin); | |
| 68 }; | |
| 69 | |
| 70 } // namespace device | |
| 71 | |
| 72 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ | |
| OLD | NEW |