[mle] use Tlv::FindTlvValueOffset() instead of FindTlvOffset() (#8413)

This commit updates `Mle` modules to use `FindTlvValueOffset()`
instead of `FindTlvOffset()` when trying to find a variable length
TLV (e.g., Network Data TLV or Address Registration TLV). This helps
simplify the code (we avoid reading the TLV again and can directly
read and process the TLV's value).
This commit is contained in:
Abtin Keshavarzian
2022-11-18 13:01:56 -08:00
committed by GitHub
parent 564d667790
commit 411a20a62b
11 changed files with 81 additions and 89 deletions
+2 -1
View File
@@ -129,7 +129,8 @@ static void Init(void)
SuccessOrQuit(message->AppendBytes(mockNetworkData, sizeof(mockNetworkData)));
IgnoreError(sInstance->Get<NetworkData::Leader>().SetNetworkData(0, 0, NetworkData::kStableSubset, *message, 0));
IgnoreError(
sInstance->Get<NetworkData::Leader>().SetNetworkData(0, 0, NetworkData::kStableSubset, *message, 2, 0x20));
}
/**