0.01.00
message.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, The OpenThread Authors.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. Neither the name of the copyright holder nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
34 #ifndef MESSAGE_HPP_
35 #define MESSAGE_HPP_
36 
37 #include "openthread-core-config.h"
38 
39 #include "utils/wrap_stdint.h"
40 #include "utils/wrap_string.h"
41 
42 #include <openthread/message.h>
44 
45 #include "common/code_utils.hpp"
46 #include "common/locator.hpp"
47 #include "mac/mac_frame.hpp"
48 #include "thread/link_quality.hpp"
49 
50 namespace ot {
51 
62 enum
63 {
66 };
67 
68 class Message;
69 class MessagePool;
70 class MessageQueue;
71 class PriorityQueue;
72 
78 {
79  enum
80  {
81  kListAll = 0,
83  kNumLists = 2,
84  };
85 
89  union
90  {
93  } mQueue;
94 
95  uint16_t mReserved;
96  uint16_t mLength;
97  uint16_t mOffset;
98  uint16_t mDatagramTag;
100 
101  uint8_t mChildMask[8];
102  uint8_t mTimeout;
103  int8_t mInterfaceId;
104  union
105  {
106  uint16_t mPanId;
107  uint8_t mChannel;
108  } mPanIdChannel;
109 
110  uint8_t mType : 2;
111  uint8_t mSubType : 4;
112  bool mDirectTx : 1;
113  bool mLinkSecurity : 1;
114  uint8_t mPriority : 2;
115  bool mInPriorityQ : 1;
116 };
117 
122 class Buffer : public ::otMessage
123 {
124  friend class Message;
125 
126 public:
133  class Buffer *GetNextBuffer(void) const { return static_cast<Buffer *>(mNext); }
134 
139  void SetNextBuffer(class Buffer *buf) { mNext = static_cast<otMessage *>(buf); }
140 
141 private:
148  uint8_t *GetFirstData(void) { return mBuffer.mHead.mData; }
149 
156  const uint8_t *GetFirstData(void) const { return mBuffer.mHead.mData; }
157 
164  uint8_t *GetData(void) { return mBuffer.mData; }
165 
172  const uint8_t *GetData(void) const { return mBuffer.mData; }
173 
174  enum
175  {
176  kBufferDataSize = kBufferSize - sizeof(struct otMessage),
177  kHeadBufferDataSize = kBufferDataSize - sizeof(struct MessageInfo),
178  };
179 
180  union
181  {
182  struct
183  {
184  MessageInfo mInfo;
185  uint8_t mData[kHeadBufferDataSize];
186  } mHead;
187  uint8_t mData[kBufferDataSize];
188  } mBuffer;
189 };
190 
195 class Message: public Buffer
196 {
197  friend class MessagePool;
198  friend class MessageQueue;
199  friend class PriorityQueue;
200 
201 public:
202  enum
203  {
204  kTypeIp6 = 0,
205  kType6lowpan = 1,
206  kTypeMacDataPoll = 2,
207  kTypeSupervision = 3,
208  };
209 
210  enum
211  {
212  kSubTypeNone = 0,
213  kSubTypeMleAnnounce = 1,
214  kSubTypeMleDiscoverRequest = 2,
215  kSubTypeMleDiscoverResponse = 3,
216  kSubTypeJoinerEntrust = 4,
217  kSubTypeMplRetransmission = 5,
218  kSubTypeMleGeneral = 6,
219  kSubTypeJoinerFinalizeResponse = 7,
220  kSubTypeMleChildUpdateRequest = 8,
221  };
222 
223  enum
224  {
225  kPriorityHigh = 0,
226  kPriorityMedium = 1,
227  kPriorityLow = 2,
228  kPriorityVeryLow = 3,
229 
230  kNumPriorities = 4,
231  };
232 
237  void Free(void);
238 
245  Message *GetNext(void) const;
246 
252  uint16_t GetLength(void) const { return mBuffer.mHead.mInfo.mLength; }
253 
263  otError SetLength(uint16_t aLength);
264 
269  uint8_t GetBufferCount(void) const;
270 
277  uint16_t GetOffset(void) const { return mBuffer.mHead.mInfo.mOffset; }
278 
288  otError MoveOffset(int aDelta);
289 
299  otError SetOffset(uint16_t aOffset);
300 
307  uint8_t GetType(void) const { return mBuffer.mHead.mInfo.mType; }
308 
315  void SetType(uint8_t aType) { mBuffer.mHead.mInfo.mType = aType; }
316 
323  uint8_t GetSubType(void) const { return mBuffer.mHead.mInfo.mSubType; }
324 
331  void SetSubType(uint8_t aSubType) { mBuffer.mHead.mInfo.mSubType = aSubType; }
332 
340  bool IsSubTypeMle(void) const;
341 
348  uint8_t GetPriority(void) const { return mBuffer.mHead.mInfo.mPriority; }
349 
361  otError SetPriority(uint8_t aPriority);
362 
375  otError Prepend(const void *aBuf, uint16_t aLength);
376 
385  otError RemoveHeader(uint16_t aLength);
386 
399  otError Append(const void *aBuf, uint16_t aLength);
400 
411  uint16_t Read(uint16_t aOffset, uint16_t aLength, void *aBuf) const;
412 
423  int Write(uint16_t aOffset, uint16_t aLength, const void *aBuf);
424 
436  int CopyTo(uint16_t aSourceOffset, uint16_t aDestinationOffset, uint16_t aLength, Message &aMessage) const;
437 
449  Message *Clone(uint16_t aLength) const;
450 
457  Message *Clone(void) const { return Clone(GetLength()); };
458 
465  uint16_t GetDatagramTag(void) const { return mBuffer.mHead.mInfo.mDatagramTag; }
466 
473  void SetDatagramTag(uint16_t aTag) { mBuffer.mHead.mInfo.mDatagramTag = aTag; }
474 
484  bool GetChildMask(uint8_t aChildIndex) const;
485 
492  void ClearChildMask(uint8_t aChildIndex);
493 
500  void SetChildMask(uint8_t aChildIndex);
501 
509  bool IsChildPending(void) const;
510 
519  uint16_t GetPanId(void) const { return mBuffer.mHead.mInfo.mPanIdChannel.mPanId; }
520 
529  void SetPanId(uint16_t aPanId) { mBuffer.mHead.mInfo.mPanIdChannel.mPanId = aPanId; }
530 
539  uint8_t GetChannel(void) const { return mBuffer.mHead.mInfo.mPanIdChannel.mChannel; }
540 
549  void SetChannel(uint8_t aChannel) { mBuffer.mHead.mInfo.mPanIdChannel.mChannel = aChannel; }
550 
557  uint8_t GetTimeout(void) const { return mBuffer.mHead.mInfo.mTimeout; }
558 
565  void SetTimeout(uint8_t aTimeout) { mBuffer.mHead.mInfo.mTimeout = aTimeout; }
566 
573  int8_t GetInterfaceId(void) const { return mBuffer.mHead.mInfo.mInterfaceId; }
574 
581  void SetInterfaceId(int8_t aInterfaceId) { mBuffer.mHead.mInfo.mInterfaceId = aInterfaceId; }
582 
590  bool GetDirectTransmission(void) const { return mBuffer.mHead.mInfo.mDirectTx; }
591 
596  void ClearDirectTransmission(void) { mBuffer.mHead.mInfo.mDirectTx = false; }
597 
602  void SetDirectTransmission(void) { mBuffer.mHead.mInfo.mDirectTx = true; }
603 
611  bool IsLinkSecurityEnabled(void) const { return mBuffer.mHead.mInfo.mLinkSecurity; }
612 
619  void SetLinkSecurityEnabled(bool aEnabled) { mBuffer.mHead.mInfo.mLinkSecurity = aEnabled; }
620 
629  void AddRss(int8_t aRss) { mBuffer.mHead.mInfo.mRssAverager.Add(aRss); }
630 
637  int8_t GetAverageRss(void) const { return mBuffer.mHead.mInfo.mRssAverager.GetAverage(); }
638 
645  const RssAverager &GetRssAverager(void) const { return mBuffer.mHead.mInfo.mRssAverager; }
646 
656  static uint16_t UpdateChecksum(uint16_t aChecksum, uint16_t aValue);
657 
668  static uint16_t UpdateChecksum(uint16_t aChecksum, const void *aBuf, uint16_t aLength);
669 
680  uint16_t UpdateChecksum(uint16_t aChecksum, uint16_t aOffset, uint16_t aLength) const;
681 
689  return (!mBuffer.mHead.mInfo.mInPriorityQ) ? mBuffer.mHead.mInfo.mQueue.mMessage : NULL;
690  }
691 
692 private:
693 
700  MessagePool *GetMessagePool(void) const { return mBuffer.mHead.mInfo.mMessagePool; }
701 
708  void SetMessagePool(MessagePool *aMessagePool) { mBuffer.mHead.mInfo.mMessagePool = aMessagePool; }
709 
716  bool IsInAQueue(void) const { return (mBuffer.mHead.mInfo.mQueue.mMessage != NULL); }
717 
724  void SetMessageQueue(MessageQueue *aMessageQueue);
725 
732  PriorityQueue *GetPriorityQueue(void) const {
733  return (mBuffer.mHead.mInfo.mInPriorityQ) ? mBuffer.mHead.mInfo.mQueue.mPriority : NULL;
734  }
735 
742  void SetPriorityQueue(PriorityQueue *aPriorityQueue);
743 
752  Message *&Next(uint8_t aList) { return mBuffer.mHead.mInfo.mNext[aList]; }
753 
762  Message *const &Next(uint8_t aList) const { return mBuffer.mHead.mInfo.mNext[aList]; }
763 
772  Message *&Prev(uint8_t aList) { return mBuffer.mHead.mInfo.mPrev[aList]; }
773 
780  uint16_t GetReserved(void) const { return mBuffer.mHead.mInfo.mReserved; }
781 
788  void SetReserved(uint16_t aReservedHeader) { mBuffer.mHead.mInfo.mReserved = aReservedHeader; }
789 
799  otError ResizeMessage(uint16_t aLength);
800 };
801 
807 {
808  friend class Message;
809  friend class PriorityQueue;
810 
811 public:
812 
819  {
822  };
823 
828  MessageQueue(void);
829 
836  Message *GetHead(void) const;
837 
847  otError Enqueue(Message &aMessage) { return Enqueue(aMessage, kQueuePositionTail); }
848 
859  otError Enqueue(Message &aMessage, QueuePosition aPosition);
860 
870  otError Dequeue(Message &aMessage);
871 
879  void GetInfo(uint16_t &aMessageCount, uint16_t &aBufferCount) const;
880 
881 private:
882 
889  Message *GetTail(void) const { return static_cast<Message *>(mData); }
890 
897  void SetTail(Message *aMessage) { mData = aMessage; }
898 
906  void AddToList(uint8_t aListId, Message &aMessage) { AddToList(aListId, aMessage, kQueuePositionTail); }
907 
916  void AddToList(uint8_t aListId, Message &aMessage, QueuePosition aPosition);
917 
925  void RemoveFromList(uint8_t aListId, Message &aMessage);
926 };
927 
933 {
934  friend class Message;
935  friend class MessageQueue;
936  friend class MessagePool;
937 
938 public:
943  PriorityQueue(void);
944 
951  Message *GetHead(void) const;
952 
962  Message *GetHeadForPriority(uint8_t aPriority) const;
963 
973  otError Enqueue(Message &aMessage);
974 
984  otError Dequeue(Message &aMessage);
985 
993  void GetInfo(uint16_t &aMessageCount, uint16_t &aBufferCount) const;
994 
995 private:
996 
1003  Message *GetTail(void) const;
1004 
1012  void AddToList(uint8_t aListId, Message &aMessage);
1013 
1021  void RemoveFromList(uint8_t aListId, Message &aMessage);
1022 
1031  uint8_t PrevPriority(uint8_t aPriority) const {
1032  return (aPriority == 0) ? (Message::kNumPriorities - 1) : (aPriority - 1);
1033  }
1034 
1044  Message *FindFirstNonNullTail(uint8_t aStartPriorityLevel) const;
1045 
1046 private:
1047 
1048  Message *mTails[Message::kNumPriorities];
1049 };
1050 
1056 {
1057  friend class Message;
1058  friend class MessageQueue;
1059  friend class PriorityQueue;
1060 
1061 public:
1062 
1067  class Iterator
1068  {
1069  friend class MessagePool;
1070 
1071  public:
1075  Iterator(void) : mMessage(NULL) { }
1076 
1083  Message *GetMessage(void) const { return mMessage; }
1084 
1090  bool IsEmpty(void) const { return (mMessage == NULL); }
1091 
1097  bool HasEnded(void) const { return IsEmpty(); }
1098 
1105  Iterator GetNext(void) const { return Iterator(Next()); }
1106 
1113  Iterator GetPrev(void) const { return Iterator(Prev()); }
1114 
1121  Iterator &GoToNext(void) { mMessage = Next(); return *this; }
1122 
1129  Iterator &GoToPrev(void) { mMessage = Prev(); return *this; }
1130 
1131  private:
1132  Iterator(Message *aMessage) : mMessage(aMessage) { }
1133  Message *Next(void) const;
1134  Message *Prev(void) const;
1135 
1136  Message *mMessage;
1137  };
1138 
1143  MessagePool(otInstance &aInstance);
1144 
1155  Message *New(uint8_t aType, uint16_t aReserveHeader);
1156 
1163  void Free(Message *aMessage);
1164 
1172  Iterator GetAllMessagesHead(void) const;
1173 
1181  Iterator GetAllMessagesTail(void) const { return Iterator(mAllQueue.GetTail()); }
1182 
1189 #if OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT
1190  uint16_t GetFreeBufferCount(void) const { return otPlatMessagePoolNumFreeBuffers(&GetInstance()); }
1191 #else
1192  uint16_t GetFreeBufferCount(void) const { return mNumFreeBuffers; }
1193 #endif
1194 
1195 private:
1196  enum
1197  {
1198  kDefaultMessagePriority = Message::kPriorityLow,
1199  };
1200 
1201  Buffer *NewBuffer(void);
1202  void FreeBuffers(Buffer *aBuffer);
1203  otError ReclaimBuffers(int aNumBuffers);
1204  PriorityQueue *GetAllMessagesQueue(void) { return &mAllQueue; }
1205 
1206 #if OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT == 0
1207  uint16_t mNumFreeBuffers;
1208  Buffer mBuffers[kNumBuffers];
1209  Buffer *mFreeBuffers;
1210 #endif
1211 
1212  PriorityQueue mAllQueue;
1213 };
1214 
1220 } // namespace ot
1221 
1222 #endif // MESSAGE_HPP_
otError Enqueue(Message &aMessage)
This method adds a message to the end of the list.
Definition: message.hpp:847
uint16_t otPlatMessagePoolNumFreeBuffers(otInstance *aInstance)
Get the number of free buffers.
This class represents a Message buffer.
Definition: message.hpp:122
This type represents all the static / global variables used by OpenThread allocated in one place...
Definition: openthread-instance.h:59
Identifies the all messages list (maintained by the MessagePool).
Definition: message.hpp:81
Message * GetMessage(void) const
This method returns the associated message with the iterator.
Definition: message.hpp:1083
Definition: cli.cpp:90
This file includes the platform abstraction for the message pool.
void SetDirectTransmission(void)
This method schedules forwarding using direct transmission.
Definition: message.hpp:602
int8_t GetAverageRss(void) const
This method returns the average RSS (Received Signal Strength) associated with the message...
Definition: message.hpp:637
This class represents an iterator for iterating through all queued message from this pool...
Definition: message.hpp:1067
uint8_t mChildMask[8]
A bit-vector to indicate which sleepy children need to receive this.
Definition: message.hpp:101
This class implements a message queue.
Definition: message.hpp:806
uint16_t mLength
Number of bytes within the message.
Definition: message.hpp:96
union ot::MessageInfo::@14 mPanIdChannel
Used for MLE Discover Request, Response, and Announce messages.
void SetPanId(uint16_t aPanId)
This method sets the IEEE 802.15.4 Destination PAN ID.
Definition: message.hpp:529
uint8_t mSubType
Identifies the message sub type.
Definition: message.hpp:111
Iterator(void)
This constructor initializes an empty iterator.
Definition: message.hpp:1075
void SetSubType(uint8_t aSubType)
This method sets the message sub type.
Definition: message.hpp:331
bool mDirectTx
Used to indicate whether a direct transmission is required.
Definition: message.hpp:112
uint8_t GetTimeout(void) const
This method returns the timeout used for 6LoWPAN reassembly.
Definition: message.hpp:557
This file includes definitions for locator class for OpenThread objects.
Iterator & GoToPrev(void)
This method moves the current iterator to the previous message on the list.
Definition: message.hpp:1129
uint16_t mPanId
Used for MLE Discover Request and Response messages.
Definition: message.hpp:106
uint16_t GetLength(void) const
This method returns the number of bytes in the message.
Definition: message.hpp:252
uint16_t GetFreeBufferCount(void) const
This method returns the number of free buffers.
Definition: message.hpp:1192
This structure contains metdata about a Message.
Definition: message.hpp:77
This file is a wrapper for the standard "string.h" file Some platforms provide all required functions...
int8_t GetInterfaceId(void) const
This method returns the interface ID.
Definition: message.hpp:573
Indicates the head (front) of the list.
Definition: message.hpp:820
Iterator GetPrev(void) const
This method returns a new iterator corresponding to previous message on the list. ...
Definition: message.hpp:1113
uint8_t mTimeout
Seconds remaining before dropping the message.
Definition: message.hpp:102
void SetDatagramTag(uint16_t aTag)
This method sets the datagram tag used for 6LoWPAN fragmentation.
Definition: message.hpp:473
void SetChannel(uint8_t aChannel)
This method sets the IEEE 802.15.4 Channel to use for transmission.
Definition: message.hpp:549
This file defines the top-level OpenThread APIs related to message buffer and queues.
PriorityQueue * mPriority
Identifies the priority queue (if any) where this message is queued.
Definition: message.hpp:92
This type points to an OpenThread message buffer.
Definition: types.h:479
#define OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE
The size of a message buffer in bytes.
Definition: openthread-core-default-config.h:105
bool IsLinkSecurityEnabled(void) const
This method indicates whether or not link security is enabled for the message.
Definition: message.hpp:611
uint8_t mType
Identifies the type of message.
Definition: message.hpp:110
MessageQueue * mMessage
Identifies the message queue (if any) where this message is queued.
Definition: message.hpp:91
bool mLinkSecurity
Indicates whether or not link security is enabled.
Definition: message.hpp:113
class Buffer * GetNextBuffer(void) const
This method returns a pointer to the next message buffer.
Definition: message.hpp:133
uint8_t GetType(void) const
This method returns the type of the message.
Definition: message.hpp:307
RssAverager mRssAverager
The averager maintaining the received signal strength (RSS) average.
Definition: message.hpp:99
Low priority level.
Definition: message.hpp:227
Message * mNext[kNumLists]
A pointer to the next Message in a doubly linked list.
Definition: message.hpp:86
MessageQueue * GetMessageQueue(void) const
This method returns a pointer to the message queue (if any) where this message is queued...
Definition: message.hpp:688
void ClearDirectTransmission(void)
This method unschedules forwarding using direct transmission.
Definition: message.hpp:596
Indicates the tail (end) of the list.
Definition: message.hpp:821
const RssAverager & GetRssAverager(void) const
This method returns a const reference to RssAverager of the message.
Definition: message.hpp:645
uint16_t mOffset
A byte offset within the message.
Definition: message.hpp:97
This class represents a message pool.
Definition: message.hpp:1055
This file includes definitions for generating and processing IEEE 802.15.4 MAC frames.
uint16_t GetOffset(void) const
This method returns the byte offset within the message.
Definition: message.hpp:277
uint8_t GetSubType(void) const
This method returns the sub type of the message.
Definition: message.hpp:323
union ot::MessageInfo::@13 mQueue
Identifies the queue (if any) where this message is queued.
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
The number of message buffers in the buffer pool.
Definition: openthread-core-default-config.h:95
This class represents a message.
Definition: message.hpp:195
uint16_t GetDatagramTag(void) const
This method returns the datagram tag used for 6LoWPAN fragmentation.
Definition: message.hpp:465
int8_t mInterfaceId
The interface ID.
Definition: message.hpp:103
uint16_t mDatagramTag
The datagram tag used for 6LoWPAN fragmentation.
Definition: message.hpp:98
Iterator & GoToNext(void)
This method moves the current iterator to the next message on the list.
Definition: message.hpp:1121
void SetLinkSecurityEnabled(bool aEnabled)
This method sets whether or not link security is enabled for the message.
Definition: message.hpp:619
Message * Clone(void) const
This method creates a copy of the current Message.
Definition: message.hpp:457
MessagePool * mMessagePool
Identifies the message pool for this message.
Definition: message.hpp:88
Identifies the list for per-interface message queue.
Definition: message.hpp:82
bool mInPriorityQ
Indicates whether the message is queued in normal or priority queue.
Definition: message.hpp:115
bool IsEmpty(void) const
This method returns true if the iterator is empty (i.e., associated with a NULL message) ...
Definition: message.hpp:1090
This class implements locator for otInstance object.
Definition: locator.hpp:63
void SetTimeout(uint8_t aTimeout)
This method sets the timeout used for 6LoWPAN reassembly.
Definition: message.hpp:565
uint16_t mReserved
Number of header bytes reserved for the message.
Definition: message.hpp:95
Iterator GetNext(void) const
This method returns a new iterator corresponding to next message on the list.
Definition: message.hpp:1105
This class implements a priority queue.
Definition: message.hpp:932
uint8_t mChannel
Used for MLE Announce.
Definition: message.hpp:107
This class implements a Received Signal Strength (RSS) averager.
Definition: link_quality.hpp:60
Number of priority levels.
Definition: message.hpp:230
void SetNextBuffer(class Buffer *buf)
This method sets the pointer to the next message buffer.
Definition: message.hpp:139
void AddRss(int8_t aRss)
This method updates the average RSS (Received Signal Strength) associated with the message by adding ...
Definition: message.hpp:629
uint8_t GetChannel(void) const
This method returns the IEEE 802.15.4 Channel to use for transmission.
Definition: message.hpp:539
void SetInterfaceId(int8_t aInterfaceId)
This method sets the interface ID.
Definition: message.hpp:581
bool GetDirectTransmission(void) const
This method returns whether or not message forwarding is scheduled for direct transmission.
Definition: message.hpp:590
uint8_t GetPriority(void) const
This method returns the message priority level.
Definition: message.hpp:348
uint16_t GetPanId(void) const
This method returns the IEEE 802.15.4 Destination PAN ID.
Definition: message.hpp:519
Number of lists.
Definition: message.hpp:83
void SetType(uint8_t aType)
This method sets the message type.
Definition: message.hpp:315
QueuePosition
This enumeration represents a position (head or tail) in the queue.
Definition: message.hpp:818
Iterator GetAllMessagesTail(void) const
This method returns a pointer to the last message (head) in the all-messages list.
Definition: message.hpp:1181
Message * mPrev[kNumLists]
A pointer to the previous Message in a doubly linked list.
Definition: message.hpp:87
otError
This enumeration represents error codes used throughout OpenThread.
Definition: types.h:107
This file includes compile-time configuration constants for OpenThread.
This structure represents an OpenThread message queue.
Definition: message.h:235
bool HasEnded(void) const
This method returns true if the iterator has ended (beyond the last message on list).
Definition: message.hpp:1097
This file includes macros for validating runtime conditions.