[ncp] add empty implementation for dnssd platform APIs (#10877)

This commit adds empty implementation for a NCP based version of
otPlatDnssd APIs.

Like NCP version of otPlatInfraIf APIs, this commit adds a control
option to enable/disable the simulation platform version of
otPlatDnssd APIs to avoid conflict. By default, the simulation version
of implementation will still be turned on.
This commit is contained in:
Li Cao
2024-10-30 13:10:30 -07:00
committed by GitHub
parent 06d83fcca1
commit 74cdd26085
7 changed files with 204 additions and 2 deletions
@@ -52,6 +52,13 @@ else()
target_compile_definitions(ot-simulation-config INTERFACE "OPENTHREAD_SIMULATION_IMPLEMENT_INFRA_IF=0")
endif()
option(OT_SIMULATION_DNSSD "enable simulation dnssd" ON)
if (OT_SIMULATION_DNSSD)
target_compile_definitions(ot-simulation-config INTERFACE "OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD=1")
else()
target_compile_definitions(ot-simulation-config INTERFACE "OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD=0")
endif()
if(NOT OT_PLATFORM_CONFIG)
set(OT_PLATFORM_CONFIG "openthread-core-simulation-config.h" PARENT_SCOPE)
endif()
+2 -2
View File
@@ -30,7 +30,7 @@
#include <openthread/platform/dnssd.h>
#if OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE
#if OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE && OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD
otPlatDnssdState otPlatDnssdGetState(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
@@ -164,4 +164,4 @@ void otPlatDnssdStopIp4AddressResolver(otInstance *aInstance, const otPlatDnssdA
OT_UNUSED_VARIABLE(aResolver);
}
#endif // OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE
#endif // OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE && OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD
@@ -116,3 +116,12 @@
#ifndef OPENTHREAD_SIMULATION_IMPLEMENT_INFRA_IF
#define OPENTHREAD_SIMULATION_IMPLEMENT_INFRA_IF 1
#endif
/**
* @def OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD
*
* Define as 1 for the simulation platform to provide implementation of `otPlatDnssd` APIs.
*/
#ifndef OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD
#define OPENTHREAD_SIMULATION_IMPLEMENT_DNSSD 1
#endif