[tmf] introduce DeclareTmfResponseHandlerIn helper macros (#12187)

This commit introduces two new macros, `DeclareTmfResponseHandlerIn`
and `DeclareTmfResponseHandlerFullParamIn`, to simplify the
definition of TMF/CoAP response handlers.

These macros generate the boilerplate code for the `static` callback
method within a class and delegate the call to a non-static member
method with the same name. This removes the repetitive pattern of
manually defining the `static` wrapper in each class.

The existing response handlers across various core components are
updated to use the new helper macros.
This commit is contained in:
Abtin Keshavarzian
2025-12-01 10:21:01 -08:00
committed by GitHub
parent 578467b78c
commit c0f4cccc65
19 changed files with 77 additions and 212 deletions
-9
View File
@@ -3332,15 +3332,6 @@ exit:
LogSendError(kTypeAddressRelease, error);
}
void Mle::HandleAddressSolicitResponse(void *aContext,
otMessage *aMessage,
const otMessageInfo *aMessageInfo,
otError aResult)
{
static_cast<Mle *>(aContext)->HandleAddressSolicitResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
aResult);
}
void Mle::HandleAddressSolicitResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult)
{
uint8_t status;