mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 04:37:47 +00:00
[coap] add IsBound() check in Coap::Send (#4205)
This commit is contained in:
@@ -895,7 +895,7 @@ void Coap::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessage
|
||||
|
||||
otError Coap::Send(ot::Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
{
|
||||
return mSocket.SendTo(aMessage, aMessageInfo);
|
||||
return mSocket.IsBound() ? mSocket.SendTo(aMessage, aMessageInfo) : OT_ERROR_INVALID_STATE;
|
||||
}
|
||||
|
||||
} // namespace Coap
|
||||
|
||||
Reference in New Issue
Block a user