mirror of
https://github.com/espressif/openthread.git
synced 2026-08-09 04:07:47 +00:00
Change otMessage type to not hide pointer. (#1416)
This commit is contained in:
+3
-3
@@ -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
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user