[api] update message API to create message with priority (#3199)

This commit is contained in:
Zhanglong Xia
2018-11-05 12:48:39 -08:00
committed by Jonathan Hui
parent f5fdf506ad
commit f8909593a9
28 changed files with 176 additions and 91 deletions
+7 -4
View File
@@ -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;
}