mirror of
https://github.com/espressif/openthread.git
synced 2026-08-02 00:57:47 +00:00
[coap] update Interceptor to use Msg (#12331)
This commit updates the `CoapBase::Interceptor` function pointer type to accept `const Msg &` instead of separate `const Message &` and `const Ip6::MessageInfo &` arguments. It also reorders the `void *` to match other CoAP callbacks. Implementations in `BackboneTmfAgent::Filter` and `Agent::Filter` have been updated to match the new signature.
This commit is contained in:
@@ -197,12 +197,12 @@ bool Agent::HandleResource(const char *aUriPath, Msg &aMsg)
|
||||
return didHandle;
|
||||
}
|
||||
|
||||
Error Agent::Filter(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, void *aContext)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aMessage);
|
||||
Error Agent::Filter(void *aContext, const Msg &aRxMsg) { return static_cast<Agent *>(aContext)->Filter(aRxMsg); }
|
||||
|
||||
return static_cast<Agent *>(aContext)->IsTmfMessage(aMessageInfo.GetPeerAddr(), aMessageInfo.GetSockAddr(),
|
||||
aMessageInfo.GetSockPort())
|
||||
Error Agent::Filter(const Msg &aRxMsg) const
|
||||
{
|
||||
return IsTmfMessage(aRxMsg.mMessageInfo.GetPeerAddr(), aRxMsg.mMessageInfo.GetSockAddr(),
|
||||
aRxMsg.mMessageInfo.GetSockPort())
|
||||
? kErrorNone
|
||||
: kErrorNotTmf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user