blob: c94f5e10731a424b956095c560d4e81c305c6ff1 [file] [log] [blame]
// Copyright 2023 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.lowpan.thread;
using fuchsia.lowpan;
@available(added=12)
type DetailedLoggingLevel = flexible enum {
LOWPAN_LOG_UNSPECIFIED = 0; // Zero value enum is UNSPECIFIED
LOWPAN_LOG_EMERG = 1; // System is unusable
LOWPAN_LOG_ALERT = 2; // Action must be taken immediately
LOWPAN_LOG_CRIT = 3; // Critical conditions
LOWPAN_LOG_ERR = 4; // Error conditions
LOWPAN_LOG_WARNING = 5; // Warning conditions
LOWPAN_LOG_NOTICE = 6; // Normal but significant condition
LOWPAN_LOG_INFO = 7; // Informational
LOWPAN_LOG_DEBUG = 8; // Debug level messages
};
/// OpenThread feature configuration.
///
/// This table describes what OpenThread features are enabled or disabled
/// for a given interface. See the [`Feature`] protocol for more information.
@available(added=11)
type FeatureConfig = table {
/// Determines if TREL is enabled or disabled.
1: trel_enabled bool;
/// Determines if NAT64 is enabled or disabled.
2: nat64_enabled bool;
/// Determines if SRP replication is enabled or disabled.
3: srp_replication_enabled bool;
/// Determines if detailed logging is enabled. If set to
/// false, default logging level set in config file should
/// be used in lowpan-ot-driver.
@available(added=12)
4: detailed_logging_enabled bool;
/// Set target log level. The value will be used only if
/// `detailed_logging_enabled` is set to true.
@available(added=12)
5: detailed_logging_level DetailedLoggingLevel;
/// Determines if DHCPv6-PD is enabled or disabled.
@available(added=18)
6: dhcpv6_pd_enabled bool;
/// Determines if DNS upstream query is enabled or disabled.
@available(added=19)
7: dns_upstream_query_enabled bool;
};
/// Protocol for connecting to [`Feature`] on a LoWPAN device.
@discoverable
@available(added=11)
closed protocol FeatureConnector {
/// Connects to the [`Feature`] protocol on the
/// named LoWPAN device.
///
/// The name of the interface can be learned by calling
/// [`fuchsia.lowpan/Lookup.GetDevices`].
///
/// If there is an error in processing this request
/// the given channel is closed and an epitaph code used
/// to describe the reason for the failure:
///
/// * `ZX_ERR_INVALID_ARGUMENT`: The given interface name
/// was not formatted correctly or otherwise invalid.
/// * `ZX_ERR_NOT_FOUND`: No interface was found with the
/// given name.
/// * `ZX_ERR_NOT_SUPPORTED`: The interface exists but
/// does not support this protocol.
strict Connect(resource struct {
name fuchsia.lowpan.InterfaceName;
server_end server_end:Feature;
});
};
/// Protocol for fetching and updating the OpenThread feature configuration
/// for a specific LoWPAN interface.
@available(added=11)
closed protocol Feature {
/// Updates the current OpenThread feature configuration for this
/// interface.
///
/// Any unset field in `config` will leave that field unchanged.
strict UpdateFeatureConfig(struct {
config FeatureConfig;
}) -> ();
/// Returns the current OpenThread feature configuration for this
/// interface.
///
/// A unset field in the returned value means that feature is not
/// supported.
strict GetFeatureConfig() -> (struct {
config FeatureConfig;
});
};