mirror of
https://github.com/espressif/openthread.git
synced 2026-07-10 22:30:21 +00:00
[core] use RLOC16-related constants and methods consistently across modules (#10434)
This commit aims to make the use of RLOC16-related constants and methods consistent across different modules. - It replaces `Mac::kShortAddrInvalid` with `Mle::kInvalidRloc16` to refer to an invalid RLOC16 value (note that these constants use the same value `0xfffe`). - It uses `Get<Mle::Mle>().GetRloc16()` to retrieve the device's RLOC16 instead of `Get<Mac::Mac>().GetShortAddress()`. - It updates `AddressResolver` to consistently use `uint16_t` for RLOC16 (instead of the `Mac::ShortAddress` typedef).
This commit is contained in:
committed by
GitHub
parent
dc69fb1ace
commit
cc8f66c56f
@@ -81,7 +81,7 @@ otError otThreadGetLeaderRloc(otInstance *aInstance, otIp6Address *aLeaderRloc)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
|
||||
VerifyOrExit(AsCoreType(aInstance).Get<Mle::Mle>().GetRloc16() != Mac::kShortAddrInvalid, error = kErrorDetached);
|
||||
VerifyOrExit(AsCoreType(aInstance).Get<Mle::Mle>().GetRloc16() != Mle::kInvalidRloc16, error = kErrorDetached);
|
||||
AsCoreType(aInstance).Get<Mle::Mle>().GetLeaderRloc(AsCoreType(aLeaderRloc));
|
||||
|
||||
exit:
|
||||
@@ -197,7 +197,7 @@ otError otThreadGetServiceAloc(otInstance *aInstance, uint8_t aServiceId, otIp6A
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
|
||||
VerifyOrExit(AsCoreType(aInstance).Get<Mle::Mle>().GetRloc16() != Mac::kShortAddrInvalid, error = kErrorDetached);
|
||||
VerifyOrExit(AsCoreType(aInstance).Get<Mle::Mle>().GetRloc16() != Mle::kInvalidRloc16, error = kErrorDetached);
|
||||
AsCoreType(aInstance).Get<Mle::Mle>().GetServiceAloc(aServiceId, AsCoreType(aServiceAloc));
|
||||
|
||||
exit:
|
||||
|
||||
Reference in New Issue
Block a user