[mac] introduce ScanResult to encapsulate scan results (#12453)

This commit introduces the `ScanResult` class, which inherits from
`otActiveScanResult`. This new class provides C++ idiomatic getter
methods that return core OpenThread types (e.g., `ExtAddress`,
`ExtendedPanId`, `NetworkName`) instead of raw C structures.

The logic for parsing a received Beacon frame and populating the
result fields is moved into `ScanResult::PopulateFromBeacon()`.
This centralizes the parsing logic and allows it to be reused
across different modules.

Consequently, `Mac`, `DiscoverScanner`, `Seeker`, and
`PanIdQueryServer` are updated to utilize `ScanResult`. The `Mac`
class is also updated to use the `Callback` template for the active
scan handler, replacing the previous raw function pointer and context.
This commit is contained in:
Abtin Keshavarzian
2026-02-17 15:20:37 -06:00
committed by GitHub
parent 75db779969
commit 416bb890a5
16 changed files with 379 additions and 184 deletions
-1
View File
@@ -39,7 +39,6 @@ class UnitTester
{
public:
using Seeker = MeshCoP::Seeker;
using ScanResult = MeshCoP::Seeker::ScanResult;
using CandidateEntry = MeshCoP::Seeker::CandidateEntry;
static void CreateScanResult(ScanResult &aResult, uint64_t aExtPanId, uint64_t aExtAddr, int8_t aRssi)