mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[posix] stop setting up and de-initializing uninitialized modules when dry run (#7550)
Initialization of these modules is not called when dry run, so setup and de-initialization should not be called either.
This commit is contained in:
@@ -224,6 +224,8 @@ void otPlatSettingsDeinit(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
VerifyOrExit(!IsSystemDryRun());
|
||||
|
||||
#if OPENTHREAD_POSIX_CONFIG_SECURE_SETTINGS_ENABLE
|
||||
otPosixSecureSettingsDeinit(aInstance);
|
||||
#endif
|
||||
|
||||
@@ -161,6 +161,8 @@ exit:
|
||||
|
||||
void platformSetUp(void)
|
||||
{
|
||||
VerifyOrExit(!gDryRun);
|
||||
|
||||
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
platformBackboneSetUp();
|
||||
#endif
|
||||
@@ -184,6 +186,9 @@ void platformSetUp(void)
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE || OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
SuccessOrDie(otSetStateChangedCallback(gInstance, processStateChange, gInstance));
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
otInstance *otSysInit(otPlatformConfig *aPlatformConfig)
|
||||
@@ -203,6 +208,8 @@ otInstance *otSysInit(otPlatformConfig *aPlatformConfig)
|
||||
|
||||
void platformTearDown(void)
|
||||
{
|
||||
VerifyOrExit(!gDryRun);
|
||||
|
||||
#if OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE
|
||||
ot::Posix::Daemon::Get().TearDown();
|
||||
#endif
|
||||
@@ -222,6 +229,9 @@ void platformTearDown(void)
|
||||
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
platformBackboneTearDown();
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void platformDeinit(void)
|
||||
@@ -230,6 +240,10 @@ void platformDeinit(void)
|
||||
virtualTimeDeinit();
|
||||
#endif
|
||||
platformRadioDeinit();
|
||||
|
||||
// For Dry-Run option, only the radio is initialized.
|
||||
VerifyOrExit(!gDryRun);
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
|
||||
ot::Posix::Udp::Get().Deinit();
|
||||
#endif
|
||||
@@ -247,6 +261,9 @@ void platformDeinit(void)
|
||||
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
platformBackboneDeinit();
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void otSysDeinit(void)
|
||||
|
||||
Reference in New Issue
Block a user