blob: 4495c7a9e297f67d9334c35dac0c27c8ccecfeba [file] [log] [blame]
// Copyright 2024 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.
library fuchsia.hardware.test;
using zx;
@serializable
type Metadata = table {
1: test_property string:MAX;
};
closed protocol MetadataSender {
// Use `fdf_metadata::MetadataServer::Serve()` to serve |metadata| to the driver's outgoing
// directory and offer the metadata to the driver's future child nodes using
// `fdf_metadata::MetadataServer::CreateOffers()`
strict ServeMetadata(struct {
metadata Metadata;
}) -> () error zx.Status;
/// Add a child node that the metadata_retriever driver variants can bind to. The child node
/// will expose metadata offered by the parent driver.
strict AddMetadataRetrieverNode(struct {
/// Whether to match the new child node to the metadata_retriever_use driver or the
/// metadata_retriever_no_use driver.
uses_metadata_fidl_service bool;
}) -> () error zx.Status;
/// Add a child node that the metadata_forwarder driver can bind to. The child node will expose
/// metadata offered by the parent driver.
strict AddMetadataForwarderNode() -> () error zx.Status;
};
service MetadataSenderService {
device client_end:MetadataSender;
};
closed protocol MetadataRetriever {
/// Use `fdf_metadata::GetMetadata()` to retrieve metadata from its parent driver and return it.
strict GetMetadata() -> (struct {
metadata Metadata;
}) error zx.Status;
/// Use `fdf_metadata::GetMetadataIfExists()` to retrieve metadata from its parent driver and
/// return it.
strict GetMetadataIfExists() -> (struct {
metadata Metadata;
/// False if `fdf_metadata::GetMetadataIfExists()` returned a std::nullopt.
retrieved_metadata bool;
}) error zx.Status;
};
service MetadataRetrieverService {
device client_end:MetadataRetriever;
};
closed protocol Root {
/// Add a child that the metadata_sender driver variants can bind to.
strict AddMetadataSenderNode(struct {
/// Whether to match the new child node to the metadata_sender_expose driver or the
/// metadata_sender_no_expose driver.
exposes_metadata_fidl_service bool;
}) -> () error zx.Status;
};
service RootService {
device client_end:Root;
};