[cli] move a few static util methods to Cli::Utils class (#10138)

This commit moves a few static util methods from the `Interpreter`
class to the `Cli::Utils` class. Since the `Interpreter` class and
other classes for cli components inherit the `Cli::Utils`, they can
still access these methods. Putting these methods in utils class is
more intuitive. This change also makes other cli classes less
dependent on the `Interpreter` class.
This commit is contained in:
Li Cao
2024-05-01 10:56:18 -07:00
committed by GitHub
parent 0c6c2fedad
commit 3bf281d32d
13 changed files with 397 additions and 362 deletions
+2 -3
View File
@@ -134,7 +134,7 @@ template <> otError UdpExample::Process<Cmd("connect")>(Arg aArgs[])
otSockAddr sockaddr;
bool nat64Synth;
SuccessOrExit(error = Interpreter::ParseToIp6Address(GetInstancePtr(), aArgs[0], sockaddr.mAddress, nat64Synth));
SuccessOrExit(error = ParseToIp6Address(GetInstancePtr(), aArgs[0], sockaddr.mAddress, nat64Synth));
if (nat64Synth)
{
@@ -269,8 +269,7 @@ template <> otError UdpExample::Process<Cmd("send")>(Arg aArgs[])
{
bool nat64Synth;
SuccessOrExit(
error = Interpreter::ParseToIp6Address(GetInstancePtr(), aArgs[0], messageInfo.mPeerAddr, nat64Synth));
SuccessOrExit(error = ParseToIp6Address(GetInstancePtr(), aArgs[0], messageInfo.mPeerAddr, nat64Synth));
if (nat64Synth)
{