mirror of
https://github.com/espressif/openthread.git
synced 2026-07-09 05:40:27 +00:00
104ca6d10d
This change is attempting to address two issues:
1. Returning `kThreadError_Busy`, when `kThreadError_Already`,
`kThreadError_InvalidState`, or even the lazy
`kThreadError_Failed` would be more-appropriate/less-misleading.
2. Setters returning an error when the value to be changed is already
set to the requested value.
Number one hurts debuggability. Number two makes the code more fragile.
The cases where both intersect can be maddening.
This change replaces cases inappropriately returning
`kThreadError_Busy` with a better, more specific error code. It also
makes some "setter" functions (Including `otInterfaceUp()` and
`otThreadStart()`) return success if the value is already set.