| // Copyright 2019 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; |
| |
| /// LoWPAN Connectivity State |
| /// |
| /// This enum describes the level of connectivity being provided |
| /// by a device. |
| enum ConnectivityState : int32 { |
| /// Inactive state. |
| /// |
| /// In this state the device is unprovisioned and administratively |
| /// disabled (inactive). |
| /// |
| /// This state can always be explicitly entered by calling `Leave` |
| /// followed by `SetActive(false)`. |
| INACTIVE = 1; |
| |
| /// Ready state. |
| /// |
| /// In this state the device is provisioned for a network, but is |
| /// administratively disabled (inactive). |
| /// |
| /// This state can be directly entered with the following actions |
| /// based on the current connectivity state: |
| /// |
| /// * `INACTIVE`: by calling `ProvisionNetwork(...)`. |
| /// * `ATTACHING`, `ATTACHED`, `ISOLATED`, `COMMISSIONING`: by calling `SetActive(false)`. |
| READY = 2; |
| |
| /// Offline state. |
| /// |
| /// In this state the device is administratively enabled (active) |
| /// but is not provisioned and thus has no network to attach to. |
| /// |
| /// This state can be directly entered with the following actions |
| /// based on the current connectivity state: |
| /// |
| /// * `INACTIVE`: by calling `SetActive(true)`. |
| /// * `ATTACHING`, `ATTACHED`, `ISOLATED`, `COMMISSIONING`: by calling `Leave()`. |
| OFFLINE = 3; |
| |
| /// Attaching state. |
| /// |
| /// In this state the device is administratively enabled |
| /// (active) and either provisioned for a network or shortly |
| /// about to become provisioned for a network. |
| /// |
| /// The interface enters this state when it starts the process |
| /// of trying to find other nodes so that it can attach to any |
| /// pre-existing network fragment, or when it is in the process |
| /// of calculating the optimal values for unspecified parameters |
| /// when forming a new network. |
| /// |
| /// This state can be directly entered with the following actions |
| /// based on the current connectivity state: |
| /// |
| /// * `READY`: by calling `SetActive(true)` |
| /// * `OFFLINE`, `ATTACHING`, `ATTACHED`, `ISOLATED`, `COMMISSIONING`: |
| /// by calling `ProvisionNetwork(...)`, `FormNetwork(...)`, or `JoinNetwork(...)` |
| ATTACHING = 4; |
| |
| /// Attached state. |
| /// |
| /// In this state the device is both administratively enabled |
| /// (active) and provisioned for a network. The device is an |
| /// active participant on the network and can communicate with |
| /// peers. |
| /// |
| /// This state usually implies that peers are available, but that |
| /// may not actually be the case due to current network conditions |
| /// or privacy-protecting measures. |
| /// |
| /// This state cannot generally be entered directly, rather |
| /// the device will enter this state automatically from the |
| /// `ATTACHING` or `ISOLATED` states once connectivity has been |
| /// (re)established. |
| ATTACHED = 5; |
| |
| /// Isolated state. |
| /// |
| /// In this state the device is both administratively enabled |
| /// (active) and provisioned for a network. However, the device |
| /// has no connectivity because there are no peers in range on |
| /// the provisioned network. |
| /// |
| /// Once peer devices on the same network come into range |
| /// the connectivity state will eventually switch back to |
| /// `ATTACHED`, indicating restored connectivity with at least |
| /// one peer. |
| /// |
| /// This state cannot generally be entered directly, rather |
| /// the device may enter this state automatically from the |
| /// `ATTACHING` or `ATTACHED` states. |
| ISOLATED = 6; |
| |
| /// Commissioning state. |
| /// |
| /// Currently unused, but will later be used to |
| /// support in-band commissioning. It is usually appropriate |
| /// to consider this as a synonym for the `ATTACHING` state |
| /// except that the device remains unprovisioned. |
| COMMISSIONING = 7; |
| }; |