mirror of
https://github.com/espressif/openthread.git
synced 2026-08-11 21:27:46 +00:00
[infra-if] add missing otInstance parameter to otPlatInfraIf APIs (#12662)
This commit updates the following `otPlatInfraIf` platform APIs to include an `otInstance *` as their first parameter: - `otPlatInfraIfHasAddress()` - `otPlatInfraIfSendIcmp6Nd()` - `otPlatInfraIfDiscoverNat64Prefix()` Other APIs under `otPlatInfraIf` already follow this pattern. Passing the `otInstance` pointer is the required standard for all platform and public APIs; however, it was missed during the initial design of these specific APIs. While missing this parameter is often not a blocker on platforms using a single OpenThread instance, it has become a blocker for simulations, especially when multiple Border Routers are emulated in the same simulation setup. This change introduces a compatibility break for existing platform implementations, however, it is necessary to support new use cases (simulation of BRs). It also helps ensure consistent API design across the stack.
This commit is contained in:
@@ -478,14 +478,14 @@ OT_TOOL_WEAK otLinkMetrics otPlatRadioGetEnhAckProbingMetrics(otInstance *, cons
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
|
||||
|
||||
OT_TOOL_WEAK bool otPlatInfraIfHasAddress(uint32_t, const otIp6Address *) { return false; }
|
||||
OT_TOOL_WEAK bool otPlatInfraIfHasAddress(otInstance *, uint32_t, const otIp6Address *) { return false; }
|
||||
|
||||
OT_TOOL_WEAK otError otPlatInfraIfSendIcmp6Nd(uint32_t, const otIp6Address *, const uint8_t *, uint16_t)
|
||||
OT_TOOL_WEAK otError otPlatInfraIfSendIcmp6Nd(otInstance *, uint32_t, const otIp6Address *, const uint8_t *, uint16_t)
|
||||
{
|
||||
return OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK otError otPlatInfraIfDiscoverNat64Prefix(uint32_t) { return OT_ERROR_FAILED; }
|
||||
OT_TOOL_WEAK otError otPlatInfraIfDiscoverNat64Prefix(otInstance *, uint32_t) { return OT_ERROR_FAILED; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE && OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_CLIENT_ENABLE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user