Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service_mac.h

Issue 1948763003: Adding support for service scan on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Adding disconnect with error Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
ortuno 2016/05/06 16:03:33 nit: 2016
jlebel 2016/05/07 00:16:11 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_SERVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_
7
8 #include <stdint.h>
9
10 #include <vector>
11
12 #include "base/mac/scoped_nsobject.h"
13 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
14
15 @class CBService;
16
17 namespace device {
18
19 class BluetoothLowEnergyDeviceMac;
20 class BluetoothDevice;
21 class BluetoothGattCharacteristic;
22
23 class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattServiceMac
24 : public BluetoothRemoteGattService {
25 public:
26 BluetoothRemoteGattServiceMac(
27 BluetoothLowEnergyDeviceMac* bluetooth_device_mac,
28 CBService* service,
29 bool primary);
ortuno 2016/05/06 16:03:33 nit: is_primary
jlebel 2016/05/07 00:16:11 Done.
30 ~BluetoothRemoteGattServiceMac() override;
31
32 // BluetoothRemoteGattService override.
33 std::string GetIdentifier() const override;
34 BluetoothUUID GetUUID() const override;
35 bool IsPrimary() const override;
36 BluetoothDevice* GetDevice() const override;
37 std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristics()
38 const override;
39 std::vector<BluetoothRemoteGattService*> GetIncludedServices() const override;
40 BluetoothRemoteGattCharacteristic* GetCharacteristic(
41 const std::string& identifier) const override;
42
43 // Registers this GATT service. Calling Register will make this service and
44 // all of its associated attributes available on the local adapters GATT
45 // database and the service UUID will be advertised to nearby devices if the
46 // local adapter is discoverable. Call Unregister to make this service no
47 // longer available.
48 //
49 // These methods only make sense for services that are local and will hence
50 // fail if this instance represents a remote GATT service. |callback| is
51 // called to denote success and |error_callback| to denote failure.
52 void Register(const base::Closure& callback,
53 const ErrorCallback& error_callback);
54 void Unregister(const base::Closure& callback,
ortuno 2016/05/06 16:03:33 You don't need these two functions. BluetoothGattS
jlebel 2016/05/07 00:16:11 Done.
55 const ErrorCallback& error_callback);
56
57 private:
58 friend BluetoothLowEnergyDeviceMac;
59
60 // Returns CBService.
61 CBService* GetService() const;
62
63 BluetoothLowEnergyDeviceMac* bluetooth_device_mac_;
ortuno 2016/05/06 16:03:33 Please add a comment that mentions that this is th
jlebel 2016/05/07 00:16:11 Done.
64 base::scoped_nsobject<CBService> service_;
ortuno 2016/05/06 16:03:33 Also add a comment for this variable.
jlebel 2016/05/07 00:16:11 Done.
65 bool is_primary_;
66
67 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceMac);
68 };
69
70 } // namespace device
71
72 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698