| // 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.lowpan.thread; |
| |
| using fuchsia.lowpan; |
| |
| /// Openthread capabilities. |
| /// |
| /// Capabilities refers to features supported by openthread. For |
| /// instance, nat64 refers to, if openthread has the required |
| /// software support for nat64, which is determined by macros defined in openthread. |
| /// It doesn't refer to if the feature is enabled or disabled. |
| /// The table describes the capabilities of openthread that are supported/not-supported. |
| /// For every new feature that's added, the table below should be updated. |
| @available(added=18) |
| type Capabilities = table { |
| /// The fields cannot be absent. They are set to true or false. |
| /// Describes if nat64 is supported. |
| /// If nat64 is true, Openthread supports nat64, false otherwise. |
| 1: nat64 bool; |
| |
| /// Describes if dhcpv6 prefix delegation is supported. |
| /// If dhcpv6_pd is true, Openthread supports dhcpv6pd, false otherwise. |
| 2: dhcpv6_pd bool; |
| }; |
| |
| /// Protocol for connecting to [`Capabilities`] on a LoWPAN device. |
| @discoverable |
| @available(added=18) |
| closed protocol CapabilitiesConnector { |
| /// Connects to the [`ThreadCapabilities`] 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:ThreadCapabilities; |
| }); |
| }; |
| |
| /// Protocol for retrieving supported capabilities of the thread stack. |
| @available(added=18) |
| closed protocol ThreadCapabilities { |
| /// Returns the current capabilities of Openthread for this interface. |
| /// |
| /// capabilities is not expected to change for the lifetime of the |
| /// interface. |
| strict GetCapabilities() -> (struct { |
| capabilities Capabilities; |
| }); |
| }; |