mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 04:37:47 +00:00
[api] update message API to create message with priority (#3199)
This commit is contained in:
committed by
Jonathan Hui
parent
f5fdf506ad
commit
f8909593a9
@@ -194,16 +194,19 @@ otError otIp6Send(otInstance *aInstance, otMessage *aMessage)
|
||||
return error;
|
||||
}
|
||||
|
||||
otMessage *otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled)
|
||||
otMessage *otIp6NewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
||||
{
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
Message * message = instance.GetMessagePool().New(Message::kTypeIp6, 0);
|
||||
Message * message;
|
||||
|
||||
if (message)
|
||||
if (aSettings != NULL)
|
||||
{
|
||||
message->SetLinkSecurityEnabled(aLinkSecurityEnabled);
|
||||
VerifyOrExit(aSettings->mPriority <= OT_MESSAGE_PRIORITY_HIGH, message = NULL);
|
||||
}
|
||||
|
||||
message = instance.GetMessagePool().New(Message::kTypeIp6, 0, aSettings);
|
||||
|
||||
exit:
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user