Get<Mac::Mac>().SetEnabled #12676
Replies: 1 comment
-
|
The asymmetry—enabling the MAC when the interface goes up, but not disabling it when the interface goes down—stems from a strict Separation of Concerns in OpenThread's architecture between the Network Layer (Thread IP/MLE) and the Link Layer (802.15.4 MAC). Here is the technical breakdown of why 1. Independent Link-Layer OperationsEven when the Thread network interface is "Down" (meaning IPv6 routing, Mesh Link Establishment, and upper-layer protocols are halted), the device may still need the physical and MAC layers to remain active. For example, an application might need to perform an Active Scan (looking for 802.15.4 beacons), an Energy Scan (assessing channel noise), or to listen for raw, low-level commissioning frames. If 2. Shared Radio and Multiprotocol SupportMany modern IoT SoCs use dynamic multiprotocol (DMP) to share a single radio between Thread and other protocols like Bluetooth Low Energy (BLE), Zigbee, or proprietary 802.15.4 stacks. The OpenThread MAC layer is often involved in arbitrating this radio time. Unconditionally shutting down the MAC layer just because the Thread IPv6 interface went down could forcefully kill the radio for other concurrent protocols. 3. Layer Dependency Logic (The Asymmetry)The logic in
4. Explicit Link Control via APIOpenThread is designed to give developers granular control over state management. If a developer genuinely wants to power down the MAC and the radio to enter a deep sleep state, they are expected to explicitly call link-layer APIs (such as Summary: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In ThreadNetif::Up(), OT code set GetMac::Mac().SetEnabled(true);
Why is GetMac::Mac().SetEnabled(false) not set in ThreadNetif::Down()?
Beta Was this translation helpful? Give feedback.
All reactions