Change otMessage type to not hide pointer. (#1416)

This commit is contained in:
Jonathan Hui
2017-03-02 12:43:59 -08:00
committed by GitHub
parent eff6620022
commit 31b389fb4e
63 changed files with 186 additions and 190 deletions
+3 -3
View File
@@ -65,12 +65,12 @@ exit:
return error;
}
void Udp::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
void Udp::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
static_cast<Udp *>(aContext)->HandleUdpReceive(aMessage, aMessageInfo);
}
void Udp::HandleUdpReceive(otMessage aMessage, const otMessageInfo *aMessageInfo)
void Udp::HandleUdpReceive(otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
uint16_t payloadLength = otMessageGetLength(aMessage) - otMessageGetOffset(aMessage);
char buf[512];
@@ -99,7 +99,7 @@ exit:
int Udp::Output(const char *aBuf, uint16_t aBufLength)
{
ThreadError error = kThreadError_None;
otMessage message;
otMessage *message;
VerifyOrExit((message = otUdpNewMessage(mInstance, true)) != NULL, error = kThreadError_NoBufs);
SuccessOrExit(error = otMessageSetLength(message, aBufLength));