mirror of
https://github.com/espressif/openthread.git
synced 2026-09-10 03:00:09 +00:00
Remove use of gnu-extension anonymous struct/union definitions. (#1651)
This commit is contained in:
+37
-37
@@ -270,7 +270,7 @@ Message *Message::GetNext(void) const
|
||||
Message *next;
|
||||
Message *tail;
|
||||
|
||||
if (mInfo.mInPriorityQ)
|
||||
if (mBuffer.mHead.mInfo.mInPriorityQ)
|
||||
{
|
||||
PriorityQueue *priorityQueue = GetPriorityQueue();
|
||||
VerifyOrExit(priorityQueue != NULL, next = NULL);
|
||||
@@ -309,7 +309,7 @@ ThreadError Message::SetLength(uint16_t aLength)
|
||||
SuccessOrExit(error = GetMessagePool()->ReclaimBuffers(bufs));
|
||||
|
||||
SuccessOrExit(error = ResizeMessage(totalLengthRequest));
|
||||
mInfo.mLength = aLength;
|
||||
mBuffer.mHead.mInfo.mLength = aLength;
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -334,8 +334,8 @@ ThreadError Message::MoveOffset(int aDelta)
|
||||
assert(GetOffset() + aDelta <= GetLength());
|
||||
VerifyOrExit(GetOffset() + aDelta <= GetLength(), error = kThreadError_InvalidArgs);
|
||||
|
||||
mInfo.mOffset += static_cast<int16_t>(aDelta);
|
||||
assert(mInfo.mOffset <= GetLength());
|
||||
mBuffer.mHead.mInfo.mOffset += static_cast<int16_t>(aDelta);
|
||||
assert(mBuffer.mHead.mInfo.mOffset <= GetLength());
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -348,7 +348,7 @@ ThreadError Message::SetOffset(uint16_t aOffset)
|
||||
assert(aOffset <= GetLength());
|
||||
VerifyOrExit(aOffset <= GetLength(), error = kThreadError_InvalidArgs);
|
||||
|
||||
mInfo.mOffset = aOffset;
|
||||
mBuffer.mHead.mInfo.mOffset = aOffset;
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -358,11 +358,11 @@ bool Message::IsSubTypeMle(void) const
|
||||
{
|
||||
bool rval = false;
|
||||
|
||||
if (mInfo.mSubType == kSubTypeMleAnnounce ||
|
||||
mInfo.mSubType == kSubTypeMleDiscoverRequest ||
|
||||
mInfo.mSubType == kSubTypeMleDiscoverResponse ||
|
||||
mInfo.mSubType == kSubTypeMleChildUpdateRequest ||
|
||||
mInfo.mSubType == kSubTypeMleGeneral)
|
||||
if (mBuffer.mHead.mInfo.mSubType == kSubTypeMleAnnounce ||
|
||||
mBuffer.mHead.mInfo.mSubType == kSubTypeMleDiscoverRequest ||
|
||||
mBuffer.mHead.mInfo.mSubType == kSubTypeMleDiscoverResponse ||
|
||||
mBuffer.mHead.mInfo.mSubType == kSubTypeMleChildUpdateRequest ||
|
||||
mBuffer.mHead.mInfo.mSubType == kSubTypeMleGeneral)
|
||||
{
|
||||
rval = true;
|
||||
}
|
||||
@@ -377,12 +377,12 @@ ThreadError Message::SetPriority(uint8_t aPriority)
|
||||
|
||||
VerifyOrExit(aPriority < kNumPriorities, error = kThreadError_InvalidArgs);
|
||||
|
||||
VerifyOrExit(IsInAQueue(), mInfo.mPriority = aPriority);
|
||||
VerifyOrExit(mInfo.mPriority != aPriority);
|
||||
VerifyOrExit(IsInAQueue(), mBuffer.mHead.mInfo.mPriority = aPriority);
|
||||
VerifyOrExit(mBuffer.mHead.mInfo.mPriority != aPriority);
|
||||
|
||||
if (mInfo.mInPriorityQ)
|
||||
if (mBuffer.mHead.mInfo.mInPriorityQ)
|
||||
{
|
||||
priorityQueue = mInfo.mPriorityQueue;
|
||||
priorityQueue = mBuffer.mHead.mInfo.mPriorityQueue;
|
||||
priorityQueue->Dequeue(*this);
|
||||
}
|
||||
else
|
||||
@@ -390,7 +390,7 @@ ThreadError Message::SetPriority(uint8_t aPriority)
|
||||
GetMessagePool()->GetAllMessagesQueue()->RemoveFromList(MessageInfo::kListAll, *this);
|
||||
}
|
||||
|
||||
mInfo.mPriority = aPriority;
|
||||
mBuffer.mHead.mInfo.mPriority = aPriority;
|
||||
|
||||
if (priorityQueue != NULL)
|
||||
{
|
||||
@@ -433,18 +433,18 @@ ThreadError Message::Prepend(const void *aBuf, uint16_t aLength)
|
||||
newBuffer->SetNextBuffer(GetNextBuffer());
|
||||
SetNextBuffer(newBuffer);
|
||||
|
||||
if (GetReserved() < sizeof(mHeadData))
|
||||
if (GetReserved() < sizeof(mBuffer.mHead.mData))
|
||||
{
|
||||
// Copy payload from the first buffer.
|
||||
memcpy(newBuffer->mHeadData + GetReserved(), mHeadData + GetReserved(),
|
||||
sizeof(mHeadData) - GetReserved());
|
||||
memcpy(newBuffer->mBuffer.mHead.mData + GetReserved(), mBuffer.mHead.mData + GetReserved(),
|
||||
sizeof(mBuffer.mHead.mData) - GetReserved());
|
||||
}
|
||||
|
||||
SetReserved(GetReserved() + kBufferDataSize);
|
||||
}
|
||||
|
||||
SetReserved(GetReserved() - aLength);
|
||||
mInfo.mLength += aLength;
|
||||
mBuffer.mHead.mInfo.mLength += aLength;
|
||||
SetOffset(GetOffset() + aLength);
|
||||
|
||||
if (aBuf != NULL)
|
||||
@@ -458,18 +458,18 @@ exit:
|
||||
|
||||
ThreadError Message::RemoveHeader(uint16_t aLength)
|
||||
{
|
||||
assert(aLength <= mInfo.mLength);
|
||||
assert(aLength <= mBuffer.mHead.mInfo.mLength);
|
||||
|
||||
mInfo.mReserved += aLength;
|
||||
mInfo.mLength -= aLength;
|
||||
mBuffer.mHead.mInfo.mReserved += aLength;
|
||||
mBuffer.mHead.mInfo.mLength -= aLength;
|
||||
|
||||
if (mInfo.mOffset > aLength)
|
||||
if (mBuffer.mHead.mInfo.mOffset > aLength)
|
||||
{
|
||||
mInfo.mOffset -= aLength;
|
||||
mBuffer.mHead.mInfo.mOffset -= aLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
mInfo.mOffset = 0;
|
||||
mBuffer.mHead.mInfo.mOffset = 0;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
@@ -678,29 +678,29 @@ exit:
|
||||
|
||||
bool Message::GetChildMask(uint8_t aChildIndex) const
|
||||
{
|
||||
assert(aChildIndex < sizeof(mInfo.mChildMask) * 8);
|
||||
return (mInfo.mChildMask[aChildIndex / 8] & (0x80 >> (aChildIndex % 8))) != 0;
|
||||
assert(aChildIndex < sizeof(mBuffer.mHead.mInfo.mChildMask) * 8);
|
||||
return (mBuffer.mHead.mInfo.mChildMask[aChildIndex / 8] & (0x80 >> (aChildIndex % 8))) != 0;
|
||||
}
|
||||
|
||||
void Message::ClearChildMask(uint8_t aChildIndex)
|
||||
{
|
||||
assert(aChildIndex < sizeof(mInfo.mChildMask) * 8);
|
||||
mInfo.mChildMask[aChildIndex / 8] &= ~(0x80 >> (aChildIndex % 8));
|
||||
assert(aChildIndex < sizeof(mBuffer.mHead.mInfo.mChildMask) * 8);
|
||||
mBuffer.mHead.mInfo.mChildMask[aChildIndex / 8] &= ~(0x80 >> (aChildIndex % 8));
|
||||
}
|
||||
|
||||
void Message::SetChildMask(uint8_t aChildIndex)
|
||||
{
|
||||
assert(aChildIndex < sizeof(mInfo.mChildMask) * 8);
|
||||
mInfo.mChildMask[aChildIndex / 8] |= 0x80 >> (aChildIndex % 8);
|
||||
assert(aChildIndex < sizeof(mBuffer.mHead.mInfo.mChildMask) * 8);
|
||||
mBuffer.mHead.mInfo.mChildMask[aChildIndex / 8] |= 0x80 >> (aChildIndex % 8);
|
||||
}
|
||||
|
||||
bool Message::IsChildPending(void) const
|
||||
{
|
||||
bool rval = false;
|
||||
|
||||
for (size_t i = 0; i < sizeof(mInfo.mChildMask); i++)
|
||||
for (size_t i = 0; i < sizeof(mBuffer.mHead.mInfo.mChildMask); i++)
|
||||
{
|
||||
if (mInfo.mChildMask[i] != 0)
|
||||
if (mBuffer.mHead.mInfo.mChildMask[i] != 0)
|
||||
{
|
||||
ExitNow(rval = true);
|
||||
}
|
||||
@@ -779,14 +779,14 @@ uint16_t Message::UpdateChecksum(uint16_t aChecksum, uint16_t aOffset, uint16_t
|
||||
|
||||
void Message::SetMessageQueue(MessageQueue *aMessageQueue)
|
||||
{
|
||||
mInfo.mMessageQueue = aMessageQueue;
|
||||
mInfo.mInPriorityQ = false;
|
||||
mBuffer.mHead.mInfo.mMessageQueue = aMessageQueue;
|
||||
mBuffer.mHead.mInfo.mInPriorityQ = false;
|
||||
}
|
||||
|
||||
void Message::SetPriorityQueue(PriorityQueue *aPriorityQueue)
|
||||
{
|
||||
mInfo.mPriorityQueue = aPriorityQueue;
|
||||
mInfo.mInPriorityQ = true;
|
||||
mBuffer.mHead.mInfo.mPriorityQueue = aPriorityQueue;
|
||||
mBuffer.mHead.mInfo.mInPriorityQ = true;
|
||||
}
|
||||
|
||||
MessageQueue::MessageQueue(void)
|
||||
|
||||
+44
-40
@@ -147,7 +147,7 @@ private:
|
||||
* @returns A pointer to the first data byte.
|
||||
*
|
||||
*/
|
||||
uint8_t *GetFirstData(void) { return mHeadData; }
|
||||
uint8_t *GetFirstData(void) { return mBuffer.mHead.mData; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the first byte of data in the first message buffer.
|
||||
@@ -155,7 +155,7 @@ private:
|
||||
* @returns A pointer to the first data byte.
|
||||
*
|
||||
*/
|
||||
const uint8_t *GetFirstData(void) const { return mHeadData; }
|
||||
const uint8_t *GetFirstData(void) const { return mBuffer.mHead.mData; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the first data byte of a subsequent message buffer.
|
||||
@@ -163,7 +163,7 @@ private:
|
||||
* @returns A pointer to the first data byte.
|
||||
*
|
||||
*/
|
||||
uint8_t *GetData(void) { return mData; }
|
||||
uint8_t *GetData(void) { return mBuffer.mData; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the first data byte of a subsequent message buffer.
|
||||
@@ -171,7 +171,7 @@ private:
|
||||
* @returns A pointer to the first data byte.
|
||||
*
|
||||
*/
|
||||
const uint8_t *GetData(void) const { return mData; }
|
||||
const uint8_t *GetData(void) const { return mBuffer.mData; }
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -184,10 +184,10 @@ private:
|
||||
struct
|
||||
{
|
||||
MessageInfo mInfo;
|
||||
uint8_t mHeadData[kHeadBufferDataSize];
|
||||
};
|
||||
uint8_t mData[kHeadBufferDataSize];
|
||||
} mHead;
|
||||
uint8_t mData[kBufferDataSize];
|
||||
};
|
||||
} mBuffer;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
*
|
||||
* @returns The number of bytes in the message.
|
||||
*/
|
||||
uint16_t GetLength(void) const { return mInfo.mLength; }
|
||||
uint16_t GetLength(void) const { return mBuffer.mHead.mInfo.mLength; }
|
||||
|
||||
/**
|
||||
* This method sets the number of bytes in the message.
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
* @returns A byte offset within the message.
|
||||
*
|
||||
*/
|
||||
uint16_t GetOffset(void) const { return mInfo.mOffset; }
|
||||
uint16_t GetOffset(void) const { return mBuffer.mHead.mInfo.mOffset; }
|
||||
|
||||
/**
|
||||
* This method moves the byte offset within the message.
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
* @returns The type of the message.
|
||||
*
|
||||
*/
|
||||
uint8_t GetType(void) const { return mInfo.mType; }
|
||||
uint8_t GetType(void) const { return mBuffer.mHead.mInfo.mType; }
|
||||
|
||||
/**
|
||||
* This method sets the message type.
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
* @param[in] aType The message type.
|
||||
*
|
||||
*/
|
||||
void SetType(uint8_t aType) { mInfo.mType = aType; }
|
||||
void SetType(uint8_t aType) { mBuffer.mHead.mInfo.mType = aType; }
|
||||
|
||||
/**
|
||||
* This method returns the sub type of the message.
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
* @returns The sub type of the message.
|
||||
*
|
||||
*/
|
||||
uint8_t GetSubType(void) const { return mInfo.mSubType; }
|
||||
uint8_t GetSubType(void) const { return mBuffer.mHead.mInfo.mSubType; }
|
||||
|
||||
/**
|
||||
* This method sets the message sub type.
|
||||
@@ -330,7 +330,7 @@ public:
|
||||
* @param[in] aSubType The message sub type.
|
||||
*
|
||||
*/
|
||||
void SetSubType(uint8_t aSubType) { mInfo.mSubType = aSubType; }
|
||||
void SetSubType(uint8_t aSubType) { mBuffer.mHead.mInfo.mSubType = aSubType; }
|
||||
|
||||
/**
|
||||
* This method returns whether or not the message is of MLE subtype.
|
||||
@@ -347,7 +347,7 @@ public:
|
||||
* @returns The priority level associated with this message.
|
||||
*
|
||||
*/
|
||||
uint8_t GetPriority(void) const { return mInfo.mPriority; }
|
||||
uint8_t GetPriority(void) const { return mBuffer.mHead.mInfo.mPriority; }
|
||||
|
||||
/**
|
||||
* This method sets the messages priority.
|
||||
@@ -464,7 +464,7 @@ public:
|
||||
* @returns The 6LoWPAN datagram tag.
|
||||
*
|
||||
*/
|
||||
uint16_t GetDatagramTag(void) const { return mInfo.mDatagramTag; }
|
||||
uint16_t GetDatagramTag(void) const { return mBuffer.mHead.mInfo.mDatagramTag; }
|
||||
|
||||
/**
|
||||
* This method sets the datagram tag used for 6LoWPAN fragmentation.
|
||||
@@ -472,7 +472,7 @@ public:
|
||||
* @param[in] aTag The 6LoWPAN datagram tag.
|
||||
*
|
||||
*/
|
||||
void SetDatagramTag(uint16_t aTag) { mInfo.mDatagramTag = aTag; }
|
||||
void SetDatagramTag(uint16_t aTag) { mBuffer.mHead.mInfo.mDatagramTag = aTag; }
|
||||
|
||||
/**
|
||||
* This method returns whether or not the message forwarding is scheduled for the child.
|
||||
@@ -518,7 +518,7 @@ public:
|
||||
* @returns The IEEE 802.15.4 Destination PAN ID.
|
||||
*
|
||||
*/
|
||||
uint16_t GetPanId(void) const { return mInfo.mPanId; }
|
||||
uint16_t GetPanId(void) const { return mBuffer.mHead.mInfo.mPanId; }
|
||||
|
||||
/**
|
||||
* This method sets the IEEE 802.15.4 Destination PAN ID.
|
||||
@@ -528,7 +528,7 @@ public:
|
||||
* @param[in] aPanId The IEEE 802.15.4 Destination PAN ID.
|
||||
*
|
||||
*/
|
||||
void SetPanId(uint16_t aPanId) { mInfo.mPanId = aPanId; }
|
||||
void SetPanId(uint16_t aPanId) { mBuffer.mHead.mInfo.mPanId = aPanId; }
|
||||
|
||||
/**
|
||||
* This method returns the IEEE 802.15.4 Channel to use for transmission.
|
||||
@@ -538,7 +538,7 @@ public:
|
||||
* @returns The IEEE 802.15.4 Channel to use for transmission.
|
||||
*
|
||||
*/
|
||||
uint8_t GetChannel(void) const { return mInfo.mChannel; }
|
||||
uint8_t GetChannel(void) const { return mBuffer.mHead.mInfo.mChannel; }
|
||||
|
||||
/**
|
||||
* This method sets the IEEE 802.15.4 Channel to use for transmission.
|
||||
@@ -548,7 +548,7 @@ public:
|
||||
* @param[in] aChannel The IEEE 802.15.4 Channel to use for transmission.
|
||||
*
|
||||
*/
|
||||
void SetChannel(uint8_t aChannel) { mInfo.mChannel = aChannel; }
|
||||
void SetChannel(uint8_t aChannel) { mBuffer.mHead.mInfo.mChannel = aChannel; }
|
||||
|
||||
/**
|
||||
* This method returns the timeout used for 6LoWPAN reassembly.
|
||||
@@ -556,7 +556,7 @@ public:
|
||||
* @returns The time remaining in seconds.
|
||||
*
|
||||
*/
|
||||
uint8_t GetTimeout(void) const { return mInfo.mTimeout; }
|
||||
uint8_t GetTimeout(void) const { return mBuffer.mHead.mInfo.mTimeout; }
|
||||
|
||||
/**
|
||||
* This method sets the timeout used for 6LoWPAN reassembly.
|
||||
@@ -564,7 +564,7 @@ public:
|
||||
* @param[in] aTimeout The timeout value.
|
||||
*
|
||||
*/
|
||||
void SetTimeout(uint8_t aTimeout) { mInfo.mTimeout = aTimeout; }
|
||||
void SetTimeout(uint8_t aTimeout) { mBuffer.mHead.mInfo.mTimeout = aTimeout; }
|
||||
|
||||
/**
|
||||
* This method returns the interface ID.
|
||||
@@ -572,7 +572,7 @@ public:
|
||||
* @returns The interface ID.
|
||||
*
|
||||
*/
|
||||
int8_t GetInterfaceId(void) const { return mInfo.mInterfaceId; }
|
||||
int8_t GetInterfaceId(void) const { return mBuffer.mHead.mInfo.mInterfaceId; }
|
||||
|
||||
/**
|
||||
* This method sets the interface ID.
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
* @param[in] aInterfaceId The interface ID value.
|
||||
*
|
||||
*/
|
||||
void SetInterfaceId(int8_t aInterfaceId) { mInfo.mInterfaceId = aInterfaceId; }
|
||||
void SetInterfaceId(int8_t aInterfaceId) { mBuffer.mHead.mInfo.mInterfaceId = aInterfaceId; }
|
||||
|
||||
/**
|
||||
* This method returns whether or not message forwarding is scheduled for direct transmission.
|
||||
@@ -589,19 +589,19 @@ public:
|
||||
* @retval FALSE If message forwarding is not scheduled for direct transmission.
|
||||
*
|
||||
*/
|
||||
bool GetDirectTransmission(void) const { return mInfo.mDirectTx; }
|
||||
bool GetDirectTransmission(void) const { return mBuffer.mHead.mInfo.mDirectTx; }
|
||||
|
||||
/**
|
||||
* This method unschedules forwarding using direct transmission.
|
||||
*
|
||||
*/
|
||||
void ClearDirectTransmission(void) { mInfo.mDirectTx = false; }
|
||||
void ClearDirectTransmission(void) { mBuffer.mHead.mInfo.mDirectTx = false; }
|
||||
|
||||
/**
|
||||
* This method schedules forwarding using direct transmission.
|
||||
*
|
||||
*/
|
||||
void SetDirectTransmission(void) { mInfo.mDirectTx = true; }
|
||||
void SetDirectTransmission(void) { mBuffer.mHead.mInfo.mDirectTx = true; }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not link security is enabled for the message.
|
||||
@@ -610,15 +610,15 @@ public:
|
||||
* @retval FALSE If link security is not enabled.
|
||||
*
|
||||
*/
|
||||
bool IsLinkSecurityEnabled(void) const { return mInfo.mLinkSecurity; }
|
||||
bool IsLinkSecurityEnabled(void) const { return mBuffer.mHead.mInfo.mLinkSecurity; }
|
||||
|
||||
/**
|
||||
* This method sets whether or not link security is enabled for the message.
|
||||
*
|
||||
* @param[in] aLinkSecurityEnabled TRUE if link security is enabled, FALSE otherwise.
|
||||
* @param[in] aEnabled TRUE if link security is enabled, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
void SetLinkSecurityEnabled(bool aLinkSecurityEnabled) { mInfo.mLinkSecurity = aLinkSecurityEnabled; }
|
||||
void SetLinkSecurityEnabled(bool aEnabled) { mBuffer.mHead.mInfo.mLinkSecurity = aEnabled; }
|
||||
|
||||
/**
|
||||
* This method is used to update a checksum value.
|
||||
@@ -638,7 +638,9 @@ public:
|
||||
* @returns A pointer to the message queue or NULL if not in any message queue.
|
||||
*
|
||||
*/
|
||||
MessageQueue *GetMessageQueue(void) const { return (!mInfo.mInPriorityQ) ? mInfo.mMessageQueue : NULL; }
|
||||
MessageQueue *GetMessageQueue(void) const {
|
||||
return (!mBuffer.mHead.mInfo.mInPriorityQ) ? mBuffer.mHead.mInfo.mMessageQueue : NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -648,7 +650,7 @@ private:
|
||||
* @returns A pointer to the message pool.
|
||||
*
|
||||
*/
|
||||
MessagePool *GetMessagePool(void) const { return mInfo.mMessagePool; }
|
||||
MessagePool *GetMessagePool(void) const { return mBuffer.mHead.mInfo.mMessagePool; }
|
||||
|
||||
/**
|
||||
* This method sets the message pool this message to which this message belongs.
|
||||
@@ -656,7 +658,7 @@ private:
|
||||
* @param[in] aMessagePool A pointer to the message pool
|
||||
*
|
||||
*/
|
||||
void SetMessagePool(MessagePool *aMessagePool) { mInfo.mMessagePool = aMessagePool; }
|
||||
void SetMessagePool(MessagePool *aMessagePool) { mBuffer.mHead.mInfo.mMessagePool = aMessagePool; }
|
||||
|
||||
/**
|
||||
* This method returns `true` if the message is enqueued in any queue (`MessageQueue` or `PriorityQueue`).
|
||||
@@ -664,7 +666,7 @@ private:
|
||||
* @returns `true` if the message is in any queue, `false` otherwise.
|
||||
*
|
||||
*/
|
||||
bool IsInAQueue(void) const { return (mInfo.mMessageQueue != NULL); }
|
||||
bool IsInAQueue(void) const { return (mBuffer.mHead.mInfo.mMessageQueue != NULL); }
|
||||
|
||||
/**
|
||||
* This method sets the message queue information for the message.
|
||||
@@ -680,7 +682,9 @@ private:
|
||||
* @returns A pointer to the priority queue or NULL if not in any priority queue.
|
||||
*
|
||||
*/
|
||||
PriorityQueue *GetPriorityQueue(void) const { return (mInfo.mInPriorityQ) ? mInfo.mPriorityQueue : NULL; }
|
||||
PriorityQueue *GetPriorityQueue(void) const {
|
||||
return (mBuffer.mHead.mInfo.mInPriorityQ) ? mBuffer.mHead.mInfo.mPriorityQueue : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the message queue information for the message.
|
||||
@@ -698,7 +702,7 @@ private:
|
||||
* @returns A reference to the mNext pointer for the specified list.
|
||||
*
|
||||
*/
|
||||
Message *&Next(uint8_t aList) { return mInfo.mNext[aList]; }
|
||||
Message *&Next(uint8_t aList) { return mBuffer.mHead.mInfo.mNext[aList]; }
|
||||
|
||||
/**
|
||||
* This method returns a const reference to the `mNext` pointer for a given list.
|
||||
@@ -708,7 +712,7 @@ private:
|
||||
* @returns A const reference to the mNext pointer for the specified list.
|
||||
*
|
||||
*/
|
||||
Message *const &Next(uint8_t aList) const { return mInfo.mNext[aList]; }
|
||||
Message *const &Next(uint8_t aList) const { return mBuffer.mHead.mInfo.mNext[aList]; }
|
||||
|
||||
/**
|
||||
* This method returns a reference to the `mPrev` pointer for a given list.
|
||||
@@ -718,7 +722,7 @@ private:
|
||||
* @returns A reference to the mPrev pointer for the specified list.
|
||||
*
|
||||
*/
|
||||
Message *&Prev(uint8_t aList) { return mInfo.mPrev[aList]; }
|
||||
Message *&Prev(uint8_t aList) { return mBuffer.mHead.mInfo.mPrev[aList]; }
|
||||
|
||||
/**
|
||||
* This method returns the number of reserved header bytes.
|
||||
@@ -726,7 +730,7 @@ private:
|
||||
* @returns The number of reserved header bytes.
|
||||
*
|
||||
*/
|
||||
uint16_t GetReserved(void) const { return mInfo.mReserved; }
|
||||
uint16_t GetReserved(void) const { return mBuffer.mHead.mInfo.mReserved; }
|
||||
|
||||
/**
|
||||
* This method sets the number of reserved header bytes.
|
||||
@@ -734,7 +738,7 @@ private:
|
||||
* @pram[in] aReservedHeader The number of header bytes to reserve.
|
||||
*
|
||||
*/
|
||||
void SetReserved(uint16_t aReservedHeader) { mInfo.mReserved = aReservedHeader; }
|
||||
void SetReserved(uint16_t aReservedHeader) { mBuffer.mHead.mInfo.mReserved = aReservedHeader; }
|
||||
|
||||
/**
|
||||
* This method adds or frees message buffers to meet the requested length.
|
||||
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
* @returns The link frame counter value.
|
||||
*
|
||||
*/
|
||||
uint32_t GetLinkFrameCounter(void) const { return mValid.mLinkFrameCounter; }
|
||||
uint32_t GetLinkFrameCounter(void) const { return mValidPending.mValid.mLinkFrameCounter; }
|
||||
|
||||
/**
|
||||
* This method sets the link frame counter value.
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
* @param[in] aFrameCounter The link frame counter value.
|
||||
*
|
||||
*/
|
||||
void SetLinkFrameCounter(uint32_t aFrameCounter) { mValid.mLinkFrameCounter = aFrameCounter; }
|
||||
void SetLinkFrameCounter(uint32_t aFrameCounter) { mValidPending.mValid.mLinkFrameCounter = aFrameCounter; }
|
||||
|
||||
/**
|
||||
* This method gets the MLE frame counter value.
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
* @returns The MLE frame counter value.
|
||||
*
|
||||
*/
|
||||
uint32_t GetMleFrameCounter(void) const { return mValid.mMleFrameCounter; }
|
||||
uint32_t GetMleFrameCounter(void) const { return mValidPending.mValid.mMleFrameCounter; }
|
||||
|
||||
/**
|
||||
* This method sets the MLE frame counter value.
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
* @param[in] aFrameCounter The MLE frame counter value.
|
||||
*
|
||||
*/
|
||||
void SetMleFrameCounter(uint32_t aFrameCounter) { mValid.mMleFrameCounter = aFrameCounter; }
|
||||
void SetMleFrameCounter(uint32_t aFrameCounter) { mValidPending.mValid.mMleFrameCounter = aFrameCounter; }
|
||||
|
||||
/**
|
||||
* This method gets the RLOC16 value.
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
* @returns The RLOC16 value.
|
||||
*
|
||||
*/
|
||||
uint16_t GetRloc16(void) const { return mValid.mRloc16; }
|
||||
uint16_t GetRloc16(void) const { return mValidPending.mValid.mRloc16; }
|
||||
|
||||
/**
|
||||
* This method sets the RLOC16 value.
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
* @param[in] aRloc16 The RLOC16 value.
|
||||
*
|
||||
*/
|
||||
void SetRloc16(uint16_t aRloc16) { mValid.mRloc16 = aRloc16; }
|
||||
void SetRloc16(uint16_t aRloc16) { mValidPending.mValid.mRloc16 = aRloc16; }
|
||||
|
||||
/**
|
||||
* This method indicates whether an IEEE 802.15.4 Data Request message was received.
|
||||
@@ -307,8 +307,8 @@ public:
|
||||
*
|
||||
*/
|
||||
void GenerateChallenge(void) {
|
||||
for (uint8_t i = 0; i < sizeof(mPending.mChallenge); i++) {
|
||||
mPending.mChallenge[i] = static_cast<uint8_t>(otPlatRandomGet());
|
||||
for (uint8_t i = 0; i < sizeof(mValidPending.mPending.mChallenge); i++) {
|
||||
mValidPending.mPending.mChallenge[i] = static_cast<uint8_t>(otPlatRandomGet());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
* @returns The current challenge value.
|
||||
*
|
||||
*/
|
||||
const uint8_t *GetChallenge(void) const { return mPending.mChallenge; }
|
||||
const uint8_t *GetChallenge(void) const { return mValidPending.mPending.mChallenge; }
|
||||
|
||||
/**
|
||||
* This method returns the size (byets) of the challenge value for MLE Link Request/Response exchanges.
|
||||
@@ -326,7 +326,7 @@ public:
|
||||
* @returns The size (byets) of the challenge value for MLE Link Request/Response exchanges.
|
||||
*
|
||||
*/
|
||||
uint8_t GetChallengeSize(void) const { return sizeof(mPending.mChallenge); }
|
||||
uint8_t GetChallengeSize(void) const { return sizeof(mValidPending.mPending.mChallenge); }
|
||||
|
||||
private:
|
||||
Mac::ExtAddress mMacAddr; ///< The IEEE 802.15.4 Extended Address
|
||||
@@ -344,7 +344,7 @@ private:
|
||||
uint8_t mChallenge[Mle::ChallengeTlv::kMaxSize]; ///< The challenge value
|
||||
uint8_t mChallengeLength; ///< The challenge length
|
||||
} mPending;
|
||||
};
|
||||
} mValidPending;
|
||||
|
||||
uint32_t mKeySequence; ///< Current key sequence
|
||||
uint8_t mState : 3; ///< The link state
|
||||
|
||||
Reference in New Issue
Block a user