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
@@ -1339,7 +1339,7 @@ exit:
}
#ifndef OTDLL
void Interpreter::s_HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo,
void Interpreter::s_HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo,
const otIcmp6Header *aIcmpHeader)
{
static_cast<Interpreter *>(aContext)->HandleIcmpReceive(*static_cast<Message *>(aMessage),
@@ -1439,7 +1439,7 @@ void Interpreter::HandlePingTimer()
ThreadError error = kThreadError_None;
uint32_t timestamp = HostSwap32(Timer::GetNow());
otMessage message;
otMessage *message;
const otMessageInfo *messageInfo = static_cast<const otMessageInfo *>(&sMessageInfo);
VerifyOrExit((message = otIp6NewMessage(mInstance, true)) != NULL, error = kThreadError_NoBufs);
@@ -2851,7 +2851,7 @@ exit:
}
#ifndef OTDLL
void Interpreter::s_HandleDiagnosticGetResponse(otMessage aMessage, const otMessageInfo *aMessageInfo,
void Interpreter::s_HandleDiagnosticGetResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo,
void *aContext)
{
static_cast<Interpreter *>(aContext)->HandleDiagnosticGetResponse(*static_cast<Message *>(aMessage),
+2 -2
View File
@@ -238,7 +238,7 @@ private:
#endif
#ifndef OTDLL
static void s_HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo,
static void s_HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo,
const otIcmp6Header *aIcmpHeader);
static void s_HandlePingTimer(void *aContext);
#endif
@@ -251,7 +251,7 @@ private:
void *aContext);
static void OTCALL s_HandlePanIdConflict(uint16_t aPanId, uint32_t aChannelMask, void *aContext);
#ifndef OTDLL
static void OTCALL s_HandleDiagnosticGetResponse(otMessage aMessage, const otMessageInfo *aMessageInfo,
static void OTCALL s_HandleDiagnosticGetResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo,
void *aContext);
#endif
static void OTCALL s_HandleJoinerCallback(ThreadError aError, void *aContext);
+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));
+2 -2
View File
@@ -93,8 +93,8 @@ private:
kMaxLineLength = 128,
};
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(otMessage *aMessage, const otMessageInfo *aMessageInfo);
otUdpSocket mSocket;
otMessageInfo mPeer;