mirror of
https://github.com/espressif/openthread.git
synced 2026-08-26 04:09:52 +00:00
[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user