mirror of
https://github.com/espressif/openthread.git
synced 2026-08-18 08:29:52 +00:00
[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:
@@ -539,18 +539,8 @@ exit:
|
||||
FreeMessageOnError(message, error);
|
||||
}
|
||||
|
||||
void DuaManager::HandleDuaResponse(void *aContext,
|
||||
otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo,
|
||||
otError aResult)
|
||||
void DuaManager::HandleDuaResponse(Coap::Message *aMessage, Error aResult)
|
||||
{
|
||||
static_cast<DuaManager *>(aContext)->HandleDuaResponse(AsCoapMessagePtr(aMessage), AsCoreTypePtr(aMessageInfo),
|
||||
aResult);
|
||||
}
|
||||
|
||||
void DuaManager::HandleDuaResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
Error error;
|
||||
|
||||
mIsDuaPending = false;
|
||||
|
||||
Reference in New Issue
Block a user