forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote_service.h
51 lines (38 loc) · 1.45 KB
/
remote_service.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// 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 CHROMECAST_DEVICE_BLUETOOTH_LE_REMOTE_SERVICE_H_
#define CHROMECAST_DEVICE_BLUETOOTH_LE_REMOTE_SERVICE_H_
#include <map>
#include <memory>
#include <vector>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "chromecast/public/bluetooth/gatt.h"
namespace chromecast {
namespace bluetooth {
class RemoteCharacteristic;
class RemoteDevice;
// A proxy for a remote service on a RemoteDevice. Unless otherwise
// specified, all callbacks are run on the caller's thread.
class RemoteService : public base::RefCountedThreadSafe<RemoteService> {
public:
// Returns a list of characteristics in this service.
virtual std::vector<scoped_refptr<RemoteCharacteristic>>
GetCharacteristics() = 0;
virtual scoped_refptr<RemoteCharacteristic> GetCharacteristicByUuid(
const bluetooth_v2_shlib::Uuid& uuid) = 0;
virtual const bluetooth_v2_shlib::Uuid& uuid() const = 0;
virtual uint16_t handle() const = 0;
virtual bool primary() const = 0;
protected:
friend class base::RefCountedThreadSafe<RemoteService>;
RemoteService() = default;
virtual ~RemoteService() = default;
private:
DISALLOW_COPY_AND_ASSIGN(RemoteService);
};
} // namespace bluetooth
} // namespace chromecast
#endif // CHROMECAST_DEVICE_BLUETOOTH_LE_REMOTE_SERVICE_H_