mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[srp-server] allow disabling "Fast Start Mode" via auto-enable (#11319)
This commit updates the `Srp::Server` so that Fast Start Mode can be disabled by a call to `otSrpServerSetAutoEnableMode()`, in addition to the existing method of calling `otSrpServerSetEnabled()`. The `test_srp_server` unit test is updated to validate this new behavior.
This commit is contained in:
@@ -1367,6 +1367,22 @@ void TestSrpServerFastStartMode(void)
|
||||
VerifyOrQuit(srpServer->IsFastStartModeEnabled());
|
||||
VerifyOrQuit(srpServer->GetState() == Srp::Server::kStateRunning);
|
||||
|
||||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// Start auto-enable mode and ensure "fast start mode" is turned
|
||||
// off and the original AddressMode is restored on the SRP server.
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
|
||||
srpServer->SetAutoEnableMode(true);
|
||||
|
||||
VerifyOrQuit(!srpServer->IsFastStartModeEnabled());
|
||||
VerifyOrQuit(srpServer->IsAutoEnableMode());
|
||||
|
||||
VerifyOrQuit(srpServer->GetState() == Srp::Server::kStateDisabled);
|
||||
VerifyOrQuit(srpServer->GetAddressMode() == Srp::Server::kAddressModeUnicast);
|
||||
|
||||
VerifyOrQuit(srpServer->EnableFastStartMode() == kErrorInvalidState);
|
||||
#endif
|
||||
|
||||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// Finalize OT instance and validate all heap allocations are freed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user