forked from xinyu391/zircon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform-proxy-client.h
More file actions
44 lines (32 loc) · 1.27 KB
/
platform-proxy-client.h
File metadata and controls
44 lines (32 loc) · 1.27 KB
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
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <ddktl/device.h>
#include <ddktl/protocol/platform-proxy.h>
#include <fbl/ref_ptr.h>
#include <fbl/vector.h>
#include <lib/zx/channel.h>
#include <lib/zx/handle.h>
#include "platform-proxy.h"
namespace platform_bus {
class ProxyClient;
using ProxyClientType = ddk::Device<ProxyClient>;
class ProxyClient : public ProxyClientType,
public ddk::PlatformProxyProtocol<ProxyClient> {
public:
explicit ProxyClient(uint32_t proto_id, zx_device_t* parent, fbl::RefPtr<PlatformProxy> proxy)
: ProxyClientType(parent), proto_id_(proto_id), proxy_(proxy) {}
static zx_status_t Create(uint32_t proto_id, zx_device_t* parent,
fbl::RefPtr<PlatformProxy> proxy);
// Device protocol implementation.
void DdkRelease();
// Platform proxy protocol implementation.
zx_status_t RegisterProtocol(uint32_t proto_id, const void* protocol);
zx_status_t Proxy(platform_proxy_args_t* args);
private:
DISALLOW_COPY_ASSIGN_AND_MOVE(ProxyClient);
uint32_t proto_id_;
fbl::RefPtr<PlatformProxy> proxy_;
};
} // namespace platform_bus