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
+1 -1
View File
@@ -420,7 +420,7 @@ N.B.: It is important to check the ReceiveFlags in NDIS_TEST_RECEIVE_CANNOT_PEND
// delivery to TCPIP.
void
otLwfReceiveIp6DatagramCallback(
_In_ otMessage aMessage,
_In_ otMessage *aMessage,
_In_ void *aContext
)
{
+1 -1
View File
@@ -146,7 +146,7 @@ otLwfEventProcessingIndicateEnergyScanResult(
//
void otLwfStateChangedCallback(uint32_t aFlags, _In_ void *aContext);
void otLwfReceiveIp6DatagramCallback(_In_ otMessage aMessage, _In_ void *aContext);
void otLwfReceiveIp6DatagramCallback(_In_ otMessage *aMessage, _In_ void *aContext);
void otLwfActiveScanCallback(_In_ otActiveScanResult *aResult, _In_ void *aContext);
void otLwfEnergyScanCallback(_In_ otEnergyScanResult *aResult, _In_ void *aContext);
void otLwfDiscoverCallback(_In_ otActiveScanResult *aResult, _In_ void *aContext);
+5 -5
View File
@@ -154,7 +154,7 @@ typedef struct otCoapHeader
* @retval kThreadError_ResponseTimeout No response or acknowledgment received during timeout period.
*
*/
typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
/**
@@ -166,7 +166,7 @@ typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otM
* @param[in] aMessageInfo A pointer to the message info for @p aMessage.
*
*/
typedef void (*otCoapRequestHandler)(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
typedef void (*otCoapRequestHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
/**
@@ -372,7 +372,7 @@ const otCoapOption *otCoapHeaderGetNextOption(otCoapHeader *aHeader);
* @returns A pointer to the message or NULL if failed to allocate message.
*
*/
otMessage otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader);
otMessage *otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader);
/**
* This function sends a CoAP request.
@@ -390,7 +390,7 @@ otMessage otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader);
* @retval kThreadError_NoBufs Failed to allocate retransmission data.
*
*/
ThreadError otCoapSendRequest(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo,
ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo,
otCoapResponseHandler aHandler, void *aContext);
/**
@@ -456,7 +456,7 @@ void otCoapServerRemoveResource(otInstance *aInstance, otCoapResource *aResource
* @retval kThreadError_NoBufs Insufficient buffers available to send the CoAP response.
*
*/
ThreadError otCoapSendResponse(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo);
ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo);
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP
/**
+1 -1
View File
@@ -96,7 +96,7 @@ ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandl
* May be zero.
*
*/
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage aMessage,
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage,
const otMessageInfo *aMessageInfo, uint16_t aIdentifier);
/**
+3 -3
View File
@@ -241,7 +241,7 @@ ThreadError otIp6CreateSemanticallyOpaqueIid(otInstance *aInstance, otNetifAddre
*
* @sa otFreeMessage
*/
otMessage otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
otMessage *otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
/**
* This function pointer is called when an IPv6 datagram is received.
@@ -250,7 +250,7 @@ otMessage otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
* @param[in] aContext A pointer to application-specific context.
*
*/
typedef void (*otIp6ReceiveCallback)(otMessage aMessage, void *aContext);
typedef void (*otIp6ReceiveCallback)(otMessage *aMessage, void *aContext);
/**
* This function registers a callback to provide received IPv6 datagrams.
@@ -303,7 +303,7 @@ void otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled);
* @param[in] aMessage A pointer to the message buffer containing the IPv6 datagram.
*
*/
ThreadError otIp6Send(otInstance *aInstance, otMessage aMessage);
ThreadError otIp6Send(otInstance *aInstance, otMessage *aMessage);
/**
* This function adds a port to the allowed unsecured port list.
+14 -14
View File
@@ -66,7 +66,7 @@ extern "C" {
* @sa otMessageRead
* @sa otMessageWrite
*/
ThreadError otMessageFree(otMessage aMessage);
ThreadError otMessageFree(otMessage *aMessage);
/**
* Get the message length in bytes.
@@ -84,7 +84,7 @@ ThreadError otMessageFree(otMessage aMessage);
* @sa otMessageWrite
* @sa otMessageSetLength
*/
uint16_t otMessageGetLength(otMessage aMessage);
uint16_t otMessageGetLength(otMessage *aMessage);
/**
* Set the message length in bytes.
@@ -103,7 +103,7 @@ uint16_t otMessageGetLength(otMessage aMessage);
* @sa otMessageRead
* @sa otMessageWrite
*/
ThreadError otMessageSetLength(otMessage aMessage, uint16_t aLength);
ThreadError otMessageSetLength(otMessage *aMessage, uint16_t aLength);
/**
* Get the message offset in bytes.
@@ -120,7 +120,7 @@ ThreadError otMessageSetLength(otMessage aMessage, uint16_t aLength);
* @sa otMessageRead
* @sa otMessageWrite
*/
uint16_t otMessageGetOffset(otMessage aMessage);
uint16_t otMessageGetOffset(otMessage *aMessage);
/**
* Set the message offset in bytes.
@@ -139,7 +139,7 @@ uint16_t otMessageGetOffset(otMessage aMessage);
* @sa otMessageRead
* @sa otMessageWrite
*/
ThreadError otMessageSetOffset(otMessage aMessage, uint16_t aOffset);
ThreadError otMessageSetOffset(otMessage *aMessage, uint16_t aOffset);
/**
* This function indicates whether or not link security is enabled for the message.
@@ -150,7 +150,7 @@ ThreadError otMessageSetOffset(otMessage aMessage, uint16_t aOffset);
* @retval FALSE If link security is not enabled.
*
*/
bool otMessageIsLinkSecurityEnabled(otMessage aMessage);
bool otMessageIsLinkSecurityEnabled(otMessage *aMessage);
/**
* This function sets/forces the message to be forwarded using direct transmission.
@@ -161,7 +161,7 @@ bool otMessageIsLinkSecurityEnabled(otMessage aMessage);
* follow the normal procedure.
*
*/
void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled);
void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled);
/**
* Append bytes to a message.
@@ -181,7 +181,7 @@ void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled);
* @sa otMessageRead
* @sa otMessageWrite
*/
ThreadError otMessageAppend(otMessage aMessage, const void *aBuf, uint16_t aLength);
ThreadError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength);
/**
* Read bytes from a message.
@@ -201,7 +201,7 @@ ThreadError otMessageAppend(otMessage aMessage, const void *aBuf, uint16_t aLeng
* @sa otMessageSetOffset
* @sa otMessageWrite
*/
int otMessageRead(otMessage aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength);
int otMessageRead(otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength);
/**
* Write bytes to a message.
@@ -221,7 +221,7 @@ int otMessageRead(otMessage aMessage, uint16_t aOffset, void *aBuf, uint16_t aLe
* @sa otMessageSetOffset
* @sa otMessageRead
*/
int otMessageWrite(otMessage aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength);
int otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength);
/**
* This structure represents an OpenThread message queue.
@@ -254,7 +254,7 @@ void otMessageQueueInit(otMessageQueue *aQueue);
* @retval kThreadError_Already The message is already enqueued in a queue.
*
*/
ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage aMessage);
ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage);
/**
* This function removes a message from the given message queue.
@@ -266,7 +266,7 @@ ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage aMessage);
* @retval kThreadError_NotFound The message is not enqueued in this queue.
*
*/
ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage aMessage);
ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage);
/**
* This function returns a pointer to the message at the head of the queue.
@@ -276,7 +276,7 @@ ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage aMessage);
* @returns A pointer to the message at the head of queue or NULL if queue is empty.
*
*/
otMessage otMessageQueueGetHead(otMessageQueue *aQueue);
otMessage *otMessageQueueGetHead(otMessageQueue *aQueue);
/**
* This function returns a pointer to the next message in the queue by iterating forward (from head to tail).
@@ -288,7 +288,7 @@ otMessage otMessageQueueGetHead(otMessageQueue *aQueue);
* NULL is returned if `aMessage` is not in the queue `aQueue`.
*
*/
otMessage otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage aMessage);
otMessage *otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage *aMessage);
/**
* Get the Message Buffer information.
+4 -11
View File
@@ -39,6 +39,8 @@
#include "openthread/types.h"
#include "openthread/message.h"
/**
* @defgroup messagepool MessagePool
* @ingroup platform
@@ -50,15 +52,6 @@
*
*/
/**
* This structure contains a pointer to the next Message buffer.
*
*/
struct BufferHeader
{
struct BufferHeader *mNext; ///< A pointer to the next Message buffer.
};
#ifdef __cplusplus
extern "C" {
#endif
@@ -78,7 +71,7 @@ void otPlatMessagePoolInit(uint16_t aMinNumFreeBuffers, size_t aBufferSize);
* @returns A pointer to the Buffer or NULL if no Buffers are available.
*
*/
struct BufferHeader *otPlatMessagePoolNew(void);
otMessage *otPlatMessagePoolNew(void);
/**
* This function is used to free a Buffer back to the platform managed buffer pool.
@@ -86,7 +79,7 @@ struct BufferHeader *otPlatMessagePoolNew(void);
* @param[in] aBuffer The Buffer to free.
*
*/
void otPlatMessagePoolFree(struct BufferHeader *aBuffer);
void otPlatMessagePoolFree(otMessage *aBuffer);
/**
* Get the number of free buffers.
+1 -1
View File
@@ -848,7 +848,7 @@ OTAPI ThreadError OTCALL otThreadGetParentAverageRssi(otInstance *aInstance, int
* @param[in] aContext A pointer to application-specific context.
*
*/
typedef void (*otReceiveDiagnosticGetCallback)(otMessage aMessage, const otMessageInfo *aMessageInfo,
typedef void (*otReceiveDiagnosticGetCallback)(otMessage *aMessage, const otMessageInfo *aMessageInfo,
void *aContext);
/**
+5 -2
View File
@@ -347,7 +347,10 @@ typedef struct otMessageInfo
/**
* This type points to an OpenThread message buffer.
*/
typedef void *otMessage;
typedef struct otMessage
{
struct otMessage *mNext; ///< A pointer to the next Message buffer.
} otMessage;
/**
* @addtogroup commands Commands
@@ -1040,7 +1043,7 @@ typedef struct otIcmp6Header otIcmp6Header;
* @param[in] aIcmpHeader A pointer to the received ICMPv6 header.
*
*/
typedef void (*otIcmp6ReceiveCallback)(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo,
typedef void (*otIcmp6ReceiveCallback)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo,
const otIcmp6Header *aIcmpHeader);
/**
+3 -3
View File
@@ -56,7 +56,7 @@ extern "C" {
* This callback allows OpenThread to inform the application of a received UDP message.
*
*/
typedef void (*otUdpReceive)(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
typedef void (*otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
/**
* This structure represents a UDP socket.
@@ -83,7 +83,7 @@ typedef struct otUdpSocket
* @sa otFreeMessage
*
*/
otMessage otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
/**
* Open a UDP/IPv6 socket.
@@ -149,7 +149,7 @@ ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName);
* @sa otUdpSend
*
*/
ThreadError otUdpSend(otUdpSocket *aSocket, otMessage aMessage, const otMessageInfo *aMessageInfo);
ThreadError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo);
/**
* @}
+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;
+3 -3
View File
@@ -126,12 +126,12 @@ const otCoapOption *otCoapHeaderGetNextOption(otCoapHeader *aHeader)
return static_cast<const otCoapOption *>(static_cast<Coap::Header *>(aHeader)->GetNextOption());
}
otMessage otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader)
otMessage *otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader)
{
return aInstance->mThreadNetif.GetCoapClient().NewMessage(*(static_cast<const Coap::Header *>(aHeader)));
}
ThreadError otCoapSendRequest(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo,
ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo,
otCoapResponseHandler aHandler, void *aContext)
{
return aInstance->mThreadNetif.GetCoapClient().SendMessage(
@@ -165,7 +165,7 @@ void otCoapServerRemoveResource(otInstance *aInstance, otCoapResource *aResource
aInstance->mApplicationCoapServer.RemoveResource(*static_cast<Coap::Resource *>(aResource));
}
ThreadError otCoapSendResponse(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo)
ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
return aInstance->mApplicationCoapServer.SendMessage(
*static_cast<Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
+1 -1
View File
@@ -56,7 +56,7 @@ ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandl
return aInstance->mIp6.mIcmp.RegisterHandler(*static_cast<Ip6::IcmpHandler *>(aHandler));
}
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage aMessage,
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage,
const otMessageInfo *aMessageInfo, uint16_t aIdentifier)
{
return aInstance->mIp6.mIcmp.SendEchoRequest(*static_cast<Message *>(aMessage),
+2 -2
View File
@@ -158,7 +158,7 @@ void otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled)
aInstance->mIp6.SetReceiveIp6FilterEnabled(aEnabled);
}
ThreadError otIp6Send(otInstance *aInstance, otMessage aMessage)
ThreadError otIp6Send(otInstance *aInstance, otMessage *aMessage)
{
ThreadError error;
@@ -172,7 +172,7 @@ ThreadError otIp6Send(otInstance *aInstance, otMessage aMessage)
return error;
}
otMessage otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled)
otMessage *otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled)
{
Message *message = aInstance->mIp6.mMessagePool.New(Message::kTypeIp6, 0);
+15 -15
View File
@@ -41,42 +41,42 @@ using namespace Thread;
extern "C" {
#endif
ThreadError otMessageFree(otMessage aMessage)
ThreadError otMessageFree(otMessage *aMessage)
{
return static_cast<Message *>(aMessage)->Free();
}
uint16_t otMessageGetLength(otMessage aMessage)
uint16_t otMessageGetLength(otMessage *aMessage)
{
Message *message = static_cast<Message *>(aMessage);
return message->GetLength();
}
ThreadError otMessageSetLength(otMessage aMessage, uint16_t aLength)
ThreadError otMessageSetLength(otMessage *aMessage, uint16_t aLength)
{
Message *message = static_cast<Message *>(aMessage);
return message->SetLength(aLength);
}
uint16_t otMessageGetOffset(otMessage aMessage)
uint16_t otMessageGetOffset(otMessage *aMessage)
{
Message *message = static_cast<Message *>(aMessage);
return message->GetOffset();
}
ThreadError otMessageSetOffset(otMessage aMessage, uint16_t aOffset)
ThreadError otMessageSetOffset(otMessage *aMessage, uint16_t aOffset)
{
Message *message = static_cast<Message *>(aMessage);
return message->SetOffset(aOffset);
}
bool otMessageIsLinkSecurityEnabled(otMessage aMessage)
bool otMessageIsLinkSecurityEnabled(otMessage *aMessage)
{
Message *message = static_cast<Message *>(aMessage);
return message->IsLinkSecurityEnabled();
}
void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled)
void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled)
{
Message *message = static_cast<Message *>(aMessage);
@@ -90,19 +90,19 @@ void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled)
}
}
ThreadError otMessageAppend(otMessage aMessage, const void *aBuf, uint16_t aLength)
ThreadError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength)
{
Message *message = static_cast<Message *>(aMessage);
return message->Append(aBuf, aLength);
}
int otMessageRead(otMessage aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength)
int otMessageRead(otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength)
{
Message *message = static_cast<Message *>(aMessage);
return message->Read(aOffset, aLength, aBuf);
}
int otMessageWrite(otMessage aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength)
int otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength)
{
Message *message = static_cast<Message *>(aMessage);
return message->Write(aOffset, aLength, aBuf);
@@ -113,30 +113,30 @@ void otMessageQueueInit(otMessageQueue *aQueue)
aQueue->mData = NULL;
}
ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage aMessage)
ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage)
{
Message *message = static_cast<Message *>(aMessage);
MessageQueue *queue = static_cast<MessageQueue *>(aQueue);
return queue->Enqueue(*message);
}
ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage aMessage)
ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage)
{
Message *message = static_cast<Message *>(aMessage);
MessageQueue *queue = static_cast<MessageQueue *>(aQueue);
return queue->Dequeue(*message);
}
otMessage otMessageQueueGetHead(otMessageQueue *aQueue)
otMessage *otMessageQueueGetHead(otMessageQueue *aQueue)
{
MessageQueue *queue = static_cast<MessageQueue *>(aQueue);
return queue->GetHead();
}
otMessage otMessageQueueGetNext(otMessageQueue *aQueue, otMessage aMessage)
otMessage *otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage *aMessage)
{
Message *next;
Message *message = static_cast<Message *>(aMessage);
const Message *message = static_cast<const Message *>(aMessage);
MessageQueue *queue = static_cast<MessageQueue *>(aQueue);
VerifyOrExit(message != NULL, next = NULL);
+2 -2
View File
@@ -41,7 +41,7 @@ using namespace Thread;
extern "C" {
#endif
otMessage otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled)
otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled)
{
Message *message = aInstance->mIp6.mUdp.NewMessage(0);
@@ -91,7 +91,7 @@ ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName)
return socket->Bind(*static_cast<const Ip6::SockAddr *>(aSockName));
}
ThreadError otUdpSend(otUdpSocket *aSocket, otMessage aMessage, const otMessageInfo *aMessageInfo)
ThreadError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
Ip6::UdpSocket *socket = static_cast<Ip6::UdpSocket *>(aSocket);
return socket->SendTo(*static_cast<Message *>(aMessage),
+1 -1
View File
@@ -80,7 +80,7 @@ ThreadError CoapBase::Stop(void)
return mSocket.Close();
}
void CoapBase::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
void CoapBase::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
static_cast<CoapBase *>(aContext)->mReceiver(aContext, *static_cast<Message *>(aMessage),
*static_cast<const Ip6::MessageInfo *>(aMessageInfo));
+1 -1
View File
@@ -134,7 +134,7 @@ protected:
ReceiverFunction mReceiver;
private:
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
};
} // namespace Coap
+4 -4
View File
@@ -121,7 +121,7 @@ struct MessageInfo
* This class represents a Message buffer.
*
*/
class Buffer : public ::BufferHeader
class Buffer : public ::otMessage
{
friend class Message;
@@ -138,7 +138,7 @@ public:
* This method sets the pointer to the next message buffer.
*
*/
void SetNextBuffer(class Buffer *buf) { mNext = static_cast<BufferHeader *>(buf); }
void SetNextBuffer(class Buffer *buf) { mNext = static_cast<otMessage *>(buf); }
private:
/**
@@ -175,7 +175,7 @@ private:
enum
{
kBufferDataSize = kBufferSize - sizeof(struct BufferHeader),
kBufferDataSize = kBufferSize - sizeof(struct otMessage),
kHeadBufferDataSize = kBufferDataSize - sizeof(struct MessageInfo),
};
@@ -194,7 +194,7 @@ private:
* This class represents a message.
*
*/
class Message: private Buffer
class Message: public Buffer
{
friend class MessagePool;
friend class MessageQueue;
+7 -7
View File
@@ -359,7 +359,7 @@ exit:
return error;
}
void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<Commissioner *>(aContext)->HandleMgmtCommissisonerGetResponse(
@@ -461,7 +461,7 @@ exit:
return error;
}
void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<Commissioner *>(aContext)->HandleMgmtCommissisonerSetResponse(
@@ -526,7 +526,7 @@ exit:
return error;
}
void Commissioner::HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<Commissioner *>(aContext)->HandleLeaderPetitionResponse(
@@ -626,7 +626,7 @@ exit:
return error;
}
void Commissioner::HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<Commissioner *>(aContext)->HandleLeaderKeepAliveResponse(
@@ -660,7 +660,7 @@ exit:
otLogFuncExit();
}
void Commissioner::HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Commissioner *>(aContext)->HandleRelayReceive(
@@ -748,7 +748,7 @@ exit:
otLogFuncExit();
}
void Commissioner::HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Commissioner *>(aContext)->HandleDatasetChanged(
@@ -773,7 +773,7 @@ exit:
otLogFuncExit();
}
void Commissioner::HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Commissioner::HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Commissioner *>(aContext)->HandleJoinerFinalize(
+7 -7
View File
@@ -208,32 +208,32 @@ private:
static void HandleTimer(void *aContext);
void HandleTimer(void);
static void HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
void HandleMgmtCommissisonerSetResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError aResult);
static void HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
void HandleMgmtCommissisonerGetResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError aResult);
static void HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
void HandleLeaderPetitionResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError aResult);
static void HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
void HandleLeaderKeepAliveResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError aResult);
static void HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleRelayReceive(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleDatasetChanged(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleJoinerFinalize(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+2 -2
View File
@@ -942,7 +942,7 @@ exit:
return error;
}
void ActiveDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void ActiveDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<ActiveDatasetBase *>(aContext)->HandleGet(
@@ -1154,7 +1154,7 @@ void PendingDatasetBase::HandleNetworkUpdate(uint8_t &aFlags)
DatasetManager::HandleNetworkUpdate(aFlags);
}
void PendingDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void PendingDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<PendingDatasetBase *>(aContext)->HandleGet(
+3 -3
View File
@@ -91,7 +91,7 @@ protected:
ThreadNetif &mNetif;
private:
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleTimer(void *aContext);
@@ -124,7 +124,7 @@ public:
ThreadError Set(const Timestamp &aTimestamp, const Message &aMessage, uint16_t aOffset, uint8_t aLength);
private:
static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleGet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
@@ -164,7 +164,7 @@ protected:
uint32_t mNetworkTime;
private:
static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleGet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+2 -2
View File
@@ -189,7 +189,7 @@ void ActiveDataset::StopLeader(void)
mNetif.GetCoapServer().RemoveResource(mResourceSet);
}
void ActiveDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void ActiveDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<ActiveDataset *>(aContext)->HandleSet(
@@ -227,7 +227,7 @@ void PendingDataset::StopLeader(void)
mNetif.GetCoapServer().RemoveResource(mResourceSet);
}
void PendingDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void PendingDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<PendingDataset *>(aContext)->HandleSet(
+2 -2
View File
@@ -57,7 +57,7 @@ public:
void StopLeader(void);
private:
static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleSet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
@@ -76,7 +76,7 @@ public:
void StopLeader(void);
private:
static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleSet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+1 -1
View File
@@ -121,7 +121,7 @@ exit:
return error;
}
void EnergyScanClient::HandleReport(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void EnergyScanClient::HandleReport(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<EnergyScanClient *>(aContext)->HandleReport(
+1 -1
View File
@@ -79,7 +79,7 @@ public:
const Ip6::Address &aAddress, otCommissionerEnergyReportCallback aCallback, void *aContext);
private:
static void HandleReport(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleReport(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleReport(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+2 -2
View File
@@ -328,7 +328,7 @@ exit:
otLogFuncExit();
}
void Joiner::HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Joiner::HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<Joiner *>(aContext)->HandleJoinerFinalizeResponse(
@@ -363,7 +363,7 @@ exit:
otLogFuncExit();
}
void Joiner::HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Joiner::HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Joiner *>(aContext)->HandleJoinerEntrust(
+2 -2
View File
@@ -110,12 +110,12 @@ private:
void HandleSecureCoapClientConnect(bool aConnected);
void SendJoinerFinalize(void);
static void HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
void HandleJoinerFinalizeResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError aResult);
static void HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
void SendJoinerEntrustResponse(const Coap::Header &aRequestHeader, const Ip6::MessageInfo &aRequestInfo);
+3 -3
View File
@@ -145,7 +145,7 @@ ThreadError JoinerRouter::SetJoinerUdpPort(uint16_t aJoinerUdpPort)
return kThreadError_None;
}
void JoinerRouter::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
void JoinerRouter::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
static_cast<JoinerRouter *>(aContext)->HandleUdpReceive(*static_cast<Message *>(aMessage),
*static_cast<const Ip6::MessageInfo *>(aMessageInfo));
@@ -226,7 +226,7 @@ exit:
otLogFuncExitErr(error);
}
void JoinerRouter::HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void JoinerRouter::HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<JoinerRouter *>(aContext)->HandleRelayTransmit(
@@ -495,7 +495,7 @@ exit:
return error;
}
void JoinerRouter::HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void JoinerRouter::HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<JoinerRouter *>(aContext)->HandleJoinerEntrustResponse(static_cast<Coap::Header *>(aHeader),
+3 -3
View File
@@ -91,14 +91,14 @@ private:
static void HandleNetifStateChanged(uint32_t aFlags, void *aContext);
void HandleNetifStateChanged(uint32_t aFlags);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError result);
void HandleJoinerEntrustResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError result);
+2 -2
View File
@@ -61,7 +61,7 @@ Leader::Leader(ThreadNetif &aThreadNetif):
mNetif.GetCoapServer().AddResource(mKeepAlive);
}
void Leader::HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Leader::HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Leader *>(aContext)->HandlePetition(
@@ -151,7 +151,7 @@ exit:
return error;
}
void Leader::HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Leader::HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Leader *>(aContext)->HandleKeepAlive(
+3 -3
View File
@@ -109,19 +109,19 @@ private:
static void HandleTimer(void *aContext);
void HandleTimer(void);
static void HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandlePetition(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
ThreadError SendPetitionResponse(const Coap::Header &aRequestHeader, const Ip6::MessageInfo &aMessageInfo,
StateTlv::State aState);
static void HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleKeepAlive(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
ThreadError SendKeepAliveResponse(const Coap::Header &aRequestHeader, const Ip6::MessageInfo &aMessageInfo,
StateTlv::State aState);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void ResignCommissioner(void);
+1 -1
View File
@@ -106,7 +106,7 @@ exit:
return error;
}
void PanIdQueryClient::HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void PanIdQueryClient::HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<PanIdQueryClient *>(aContext)->HandleConflict(
+1 -1
View File
@@ -77,7 +77,7 @@ public:
otCommissionerPanIdConflictCallback aCallback, void *aContext);
private:
static void HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleConflict(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+1 -1
View File
@@ -509,7 +509,7 @@ ThreadError Dhcp6Client::AppendRapidCommit(Message &aMessage)
return aMessage.Append(&option, sizeof(option));
}
void Dhcp6Client::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
void Dhcp6Client::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
Dhcp6Client *obj = static_cast<Dhcp6Client *>(aContext);
obj->HandleUdpReceive(*static_cast<Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
+1 -1
View File
@@ -207,7 +207,7 @@ private:
ThreadError AppendElapsedTime(Message &aMessage);
ThreadError AppendRapidCommit(Message &aMessage);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
void ProcessReply(Message &aMessage);
+1 -1
View File
@@ -247,7 +247,7 @@ exit:
return error;
}
void Dhcp6Server::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
void Dhcp6Server::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
Dhcp6Server *obj = static_cast<Dhcp6Server *>(aContext);
obj->HandleUdpReceive(*static_cast<Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
+1 -1
View File
@@ -134,7 +134,7 @@ private:
ThreadError AddIaAddress(Message &aMessage, otIp6Prefix &aIp6Prefix, ClientIdentifier &aClient);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
void ProcessSolicit(Message &aMessage, otIp6Address &aDst, uint8_t *aTransactionId);
+4 -4
View File
@@ -264,7 +264,7 @@ exit:
return error;
}
void AddressResolver::HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void AddressResolver::HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<AddressResolver *>(aContext)->HandleAddressNotification(
@@ -400,7 +400,7 @@ exit:
return error;
}
void AddressResolver::HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void AddressResolver::HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<AddressResolver *>(aContext)->HandleAddressError(
@@ -483,7 +483,7 @@ exit:
{}
}
void AddressResolver::HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void AddressResolver::HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<AddressResolver *>(aContext)->HandleAddressQuery(
@@ -646,7 +646,7 @@ void AddressResolver::HandleTimer()
}
}
void AddressResolver::HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo,
void AddressResolver::HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo,
const otIcmp6Header *aIcmpHeader)
{
static_cast<AddressResolver *>(aContext)->HandleIcmpReceive(*static_cast<Message *>(aMessage),
+5 -5
View File
@@ -162,21 +162,21 @@ private:
const ThreadLastTransactionTimeTlv *aLastTransactionTimeTlv,
const Ip6::Address &aDestination);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
static void HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleAddressError(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleAddressQuery(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleAddressNotification(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo,
static void HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo,
const otIcmp6Header *aIcmpHeader);
void HandleIcmpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo, const Ip6::IcmpHeader &aIcmpHeader);
+1 -1
View File
@@ -92,7 +92,7 @@ exit:
return error;
}
void AnnounceBeginServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void AnnounceBeginServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<AnnounceBeginServer *>(aContext)->HandleRequest(
+1 -1
View File
@@ -89,7 +89,7 @@ private:
kDefaultPeriod = 1000,
};
static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleRequest(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+1 -1
View File
@@ -64,7 +64,7 @@ EnergyScanServer::EnergyScanServer(ThreadNetif &aThreadNetif) :
mNetif.GetCoapServer().AddResource(mEnergyScan);
}
void EnergyScanServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void EnergyScanServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<EnergyScanServer *>(aContext)->HandleRequest(
+1 -1
View File
@@ -72,7 +72,7 @@ private:
kReportDelay = 500, ///< Delay before sending a report (milliseconds)
};
static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleRequest(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+1 -1
View File
@@ -1951,7 +1951,7 @@ exit:
return error;
}
void Mle::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
void Mle::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
static_cast<Mle *>(aContext)->HandleUdpReceive(*static_cast<Message *>(aMessage),
*static_cast<const Ip6::MessageInfo *>(aMessageInfo));
+1 -1
View File
@@ -1361,7 +1361,7 @@ private:
void HandleParentRequestTimer(void);
static void HandleDelayedResponseTimer(void *aContext);
void HandleDelayedResponseTimer(void);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleSendChildUpdateRequest(void *aContext);
void HandleSendChildUpdateRequest(void);
+3 -3
View File
@@ -3733,7 +3733,7 @@ exit:
return error;
}
void MleRouter::HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void MleRouter::HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<MleRouter *>(aContext)->HandleAddressSolicitResponse(static_cast<Coap::Header *>(aHeader),
@@ -3849,7 +3849,7 @@ exit:
{}
}
void MleRouter::HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void MleRouter::HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<MleRouter *>(aContext)->HandleAddressSolicit(
@@ -4012,7 +4012,7 @@ exit:
}
}
void MleRouter::HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void MleRouter::HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<MleRouter *>(aContext)->HandleAddressRelease(
+3 -3
View File
@@ -661,14 +661,14 @@ private:
ThreadError UpdateChildAddresses(const AddressRegistrationTlv &aTlv, Child &aChild);
void UpdateRoutes(const RouteTlv &aTlv, uint8_t aRouterId);
static void HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError result);
void HandleAddressSolicitResponse(Coap::Header *aHeader, Message *aMessage,
const Ip6::MessageInfo *aMessageInfo, ThreadError result);
static void HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleAddressRelease(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+3 -3
View File
@@ -138,7 +138,7 @@ exit:
return;
}
void Leader::HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Leader::HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Leader *>(aContext)->HandleServerData(
@@ -175,7 +175,7 @@ exit:
return;
}
void Leader::HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Leader::HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Leader *>(aContext)->HandleCommissioningSet(
@@ -269,7 +269,7 @@ exit:
return;
}
void Leader::HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void Leader::HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<Leader *>(aContext)->HandleCommissioningGet(
+3 -3
View File
@@ -141,7 +141,7 @@ public:
ThreadError SendServerDataNotification(uint16_t aRloc16);
private:
static void HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleServerData(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
@@ -172,11 +172,11 @@ private:
bool IsStableUpdated(uint16_t aRloc16, uint8_t *aTlvs, uint8_t aTlvsLength, uint8_t *aTlvsBase,
uint8_t aTlvsBaseLength);
static void HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleCommissioningSet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleCommissioningGet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+5 -5
View File
@@ -129,7 +129,7 @@ exit:
return error;
}
void NetworkDiagnostic::HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void NetworkDiagnostic::HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult)
{
static_cast<NetworkDiagnostic *>(aContext)->HandleDiagnosticGetResponse(*static_cast<Coap::Header *>(aHeader),
@@ -156,7 +156,7 @@ exit:
return;
}
void NetworkDiagnostic::HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void NetworkDiagnostic::HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<NetworkDiagnostic *>(aContext)->HandleDiagnosticGetAnswer(*static_cast<Coap::Header *>(aHeader),
@@ -413,7 +413,7 @@ exit:
return error;
}
void NetworkDiagnostic::HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void NetworkDiagnostic::HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<NetworkDiagnostic *>(aContext)->HandleDiagnosticGetQuery(
@@ -480,7 +480,7 @@ exit:
}
}
void NetworkDiagnostic::HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void NetworkDiagnostic::HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<NetworkDiagnostic *>(aContext)->HandleDiagnosticGetRequest(
@@ -576,7 +576,7 @@ exit:
return error;
}
void NetworkDiagnostic::HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void NetworkDiagnostic::HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<NetworkDiagnostic *>(aContext)->HandleDiagnosticReset(
+5 -5
View File
@@ -112,24 +112,24 @@ private:
ThreadError AppendChildTable(Message &aMessage);
ThreadError FillRequestedTlvs(Message &aRequest, Message &aResponse, NetworkDiagnosticTlv &aNetworkDiagnosticTlv);
static void HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleDiagnosticGetRequest(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleDiagnosticGetQuery(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo, ThreadError aResult);
void HandleDiagnosticGetResponse(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
ThreadError aResult);
static void HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleDiagnosticGetAnswer(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
static void HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo);
void HandleDiagnosticReset(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
+1 -1
View File
@@ -56,7 +56,7 @@ PanIdQueryServer::PanIdQueryServer(ThreadNetif &aThreadNetif) :
mNetif.GetCoapServer().AddResource(mPanIdQuery);
}
void PanIdQueryServer::HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
void PanIdQueryServer::HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
const otMessageInfo *aMessageInfo)
{
static_cast<PanIdQueryServer *>(aContext)->HandleQuery(
+2 -2
View File
@@ -71,7 +71,7 @@ private:
kScanDelay = 1000, ///< SCAN_DELAY (milliseconds)
};
static void HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo);
void HandleQuery(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
static void HandleScanResult(void *aContext, Mac::Frame *aFrame);
@@ -80,7 +80,7 @@ private:
static void HandleTimer(void *aContext);
void HandleTimer(void);
static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo);
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
ThreadError SendConflict(void);
+6 -6
View File
@@ -563,7 +563,7 @@ ThreadError NcpBase::OutboundFrameFeedData(const uint8_t *aDataBuffer, uint16_t
return mTxFrameBuffer.InFrameFeedData(aDataBuffer, aDataBufferLength);
}
ThreadError NcpBase::OutboundFrameFeedMessage(otMessage aMessage)
ThreadError NcpBase::OutboundFrameFeedMessage(otMessage *aMessage)
{
return mTxFrameBuffer.InFrameFeedMessage(aMessage);
}
@@ -577,12 +577,12 @@ ThreadError NcpBase::OutboundFrameEnd(void)
// MARK: Outbound Datagram Handling
// ----------------------------------------------------------------------------
void NcpBase::HandleDatagramFromStack(otMessage aMessage, void *aContext)
void NcpBase::HandleDatagramFromStack(otMessage *aMessage, void *aContext)
{
static_cast<NcpBase *>(aContext)->HandleDatagramFromStack(aMessage);
}
void NcpBase::HandleDatagramFromStack(otMessage aMessage)
void NcpBase::HandleDatagramFromStack(otMessage *aMessage)
{
ThreadError errorCode = kThreadError_None;
bool isSecure = otMessageIsLinkSecurityEnabled(aMessage);
@@ -1439,7 +1439,7 @@ exit:
return errorCode;
}
ThreadError NcpBase::SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage aMessage)
ThreadError NcpBase::SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage *aMessage)
{
ThreadError errorCode = kThreadError_None;
@@ -4330,7 +4330,7 @@ ThreadError NcpBase::SetPropertyHandler_STREAM_NET_INSECURE(uint8_t header, spin
unsigned int meta_len(0);
// STREAM_NET_INSECURE packets are not secured at layer 2.
otMessage message = otIp6NewMessage(mInstance, false);
otMessage *message = otIp6NewMessage(mInstance, false);
if (message == NULL)
{
@@ -4403,7 +4403,7 @@ ThreadError NcpBase::SetPropertyHandler_STREAM_NET(uint8_t header, spinel_prop_k
unsigned int meta_len(0);
// STREAM_NET requires layer 2 security.
otMessage message = otIp6NewMessage(mInstance, true);
otMessage *message = otIp6NewMessage(mInstance, true);
if (message == NULL)
{
+4 -4
View File
@@ -106,7 +106,7 @@ protected:
* @retval kThreadError_NoBufs Insufficient buffer space available to add message.
*
*/
ThreadError OutboundFrameFeedMessage(otMessage aMessage);
ThreadError OutboundFrameFeedMessage(otMessage *aMessage);
/**
* This method finalizes and sends the current outbound frame
@@ -144,9 +144,9 @@ private:
/**
* Trampoline for HandleDatagramFromStack().
*/
static void HandleDatagramFromStack(otMessage aMessage, void *aContext);
static void HandleDatagramFromStack(otMessage *aMessage, void *aContext);
void HandleDatagramFromStack(otMessage aMessage);
void HandleDatagramFromStack(otMessage *aMessage);
/**
* Trampoline for HandleRawFrame().
@@ -246,7 +246,7 @@ private:
ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, const uint8_t *value_ptr,
uint16_t value_len);
ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage message);
ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage *message);
ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, const char *format, ...);
+6 -6
View File
@@ -55,7 +55,7 @@ NcpFrameBuffer::~NcpFrameBuffer()
void NcpFrameBuffer::Clear(void)
{
otMessage message;
otMessage *message;
bool wasEmpty = IsEmpty();
// Write (InFrame) related variables
@@ -243,7 +243,7 @@ void NcpFrameBuffer::InFrameEndSegment(uint16_t aHeaderFlags)
// This method discards the current frame.
void NcpFrameBuffer::InFrameDiscard(void)
{
otMessage message;
otMessage *message;
// Move the write segment head and tail pointers back to frame start.
mWriteSegmentHead = mWriteSegmentTail = mWriteFrameStart;
@@ -281,7 +281,7 @@ exit:
return error;
}
ThreadError NcpFrameBuffer::InFrameFeedMessage(otMessage aMessage)
ThreadError NcpFrameBuffer::InFrameFeedMessage(otMessage *aMessage)
{
ThreadError error = kThreadError_None;
@@ -300,7 +300,7 @@ exit:
ThreadError NcpFrameBuffer::InFrameEnd(void)
{
otMessage message;
otMessage *message;
bool wasEmpty = IsEmpty();
// End/Close the current segment (if any).
@@ -547,7 +547,7 @@ ThreadError NcpFrameBuffer::OutFrameRemove(void)
{
ThreadError error = kThreadError_None;
uint8_t *bufPtr;
otMessage message;
otMessage *message;
uint16_t header;
VerifyOrExit(!IsEmpty(), error = kThreadError_NotFound);
@@ -609,7 +609,7 @@ uint16_t NcpFrameBuffer::OutFrameGetLength(void)
uint16_t frameLength = 0;
uint16_t header;
uint8_t *bufPtr;
otMessage message = NULL;
otMessage *message = NULL;
// If the frame length was calculated before, return the previously calculated length.
VerifyOrExit(mReadFrameLength == kUnknownFrameLength, frameLength = mReadFrameLength);
+2 -2
View File
@@ -125,7 +125,7 @@ public:
* @retval kThreadError_NoBufs Insufficient buffer space available to add message.
*
*/
ThreadError InFrameFeedMessage(otMessage aMessage);
ThreadError InFrameFeedMessage(otMessage *aMessage);
/**
* This method finalizes/ends the current input frame being written to the buffer.
@@ -347,7 +347,7 @@ private:
uint8_t * mReadSegmentTail; // Pointer to end of current segment in the frame being read.
uint8_t * mReadPointer; // Pointer to next byte to read (either in segment or in msg buffer).
otMessage mReadMessage; // Current Message in the frame being read.
otMessage * mReadMessage; // Current Message in the frame being read.
uint16_t mReadMessageOffset; // Offset within current message being read.
uint8_t mMessageBuffer[kMessageReadBufferSize]; // Buffer to hold part of current message being read.
+5 -5
View File
@@ -149,8 +149,8 @@ void TestMessageQueue(void)
void VerifyMessageQueueContentUsingOtApi(otMessageQueue *aQueue, int aExpectedLength, ...)
{
va_list args;
otMessage message;
otMessage msgArg;
otMessage *message;
otMessage *msgArg;
va_start(args, aExpectedLength);
@@ -168,7 +168,7 @@ void VerifyMessageQueueContentUsingOtApi(otMessageQueue *aQueue, int aExpectedLe
{
VerifyOrQuit(aExpectedLength != 0, "MessageQueue contains more entries than expected\n");
msgArg = va_arg(args, otMessage);
msgArg = va_arg(args, otMessage *);
VerifyOrQuit(msgArg == message, "MessageQueue content does not match what is expected.\n");
aExpectedLength--;
@@ -186,9 +186,9 @@ void TestMessageQueueOtApis(void)
otInstance *instance;
otMessageQueue queue, queue2;
otMessage msg[kNumTestMessages];
otMessage *msg[kNumTestMessages];
ThreadError error;
otMessage message;
otMessage *message;
#ifdef OPENTHREAD_MULTIPLE_INSTANCE
size_t otInstanceBufferLength = 0;