|
|
| 34 |
* Common packet header fields. |
34 |
* Common packet header fields. |
| 35 |
* |
35 |
* |
| 36 |
* Includes 1 byte src address, 1 byte dest address, |
36 |
* Includes 1 byte src address, 1 byte dest address, |
| 37 |
* and a 1 byte type field. |
37 |
* and a 2 bytes packetType field. |
| 38 |
* |
38 |
* |
| 39 |
* The type field is protocol specific; see the relevant MAC protocol. |
39 |
* The packetType field is protocol specific; see the relevant MAC protocol. |
| 40 |
*/ |
40 |
*/ |
| 41 |
class UanHeaderCommon : public Header |
41 |
class UanHeaderCommon : public Header |
| 42 |
{ |
42 |
{ |
|
|
| 49 |
* |
49 |
* |
| 50 |
* \param src Source address defined in header. |
50 |
* \param src Source address defined in header. |
| 51 |
* \param dest Destination address defined in header. |
51 |
* \param dest Destination address defined in header. |
| 52 |
* \param type Header type. |
52 |
* \param packetType The type of the packet. |
| 53 |
*/ |
53 |
*/ |
| 54 |
UanHeaderCommon (const UanAddress src, const UanAddress dest, uint8_t type); |
54 |
UanHeaderCommon (const UanAddress src, const UanAddress dest, uint16_t packetType); |
| 55 |
/** Destructor */ |
55 |
/** Destructor */ |
| 56 |
virtual ~UanHeaderCommon (); |
56 |
virtual ~UanHeaderCommon (); |
| 57 |
|
57 |
|
|
|
| 74 |
*/ |
74 |
*/ |
| 75 |
void SetSrc (UanAddress src); |
75 |
void SetSrc (UanAddress src); |
| 76 |
/** |
76 |
/** |
| 77 |
* Set the header type. |
77 |
* Set the type of packet. |
| 78 |
* |
78 |
* |
| 79 |
* Use of this value is protocol specific. |
79 |
* Use of this value is protocol specific. |
| 80 |
* \param type The type value. |
80 |
* \param packetType The type of packet. |
| 81 |
*/ |
81 |
*/ |
| 82 |
void SetType (uint8_t type); |
82 |
void SetPacketType (uint16_t packetType); |
| 83 |
|
83 |
|
| 84 |
/** |
84 |
/** |
| 85 |
* Get the destination address. |
85 |
* Get the destination address. |
|
|
| 94 |
*/ |
94 |
*/ |
| 95 |
UanAddress GetSrc (void) const; |
95 |
UanAddress GetSrc (void) const; |
| 96 |
/** |
96 |
/** |
| 97 |
* Get the header type value. |
97 |
* Get the type of packet. |
| 98 |
* |
98 |
* |
| 99 |
* \return value of type field. |
99 |
* Use of this value is protocol specific. |
|
|
100 |
* \return The type of packet. |
| 100 |
*/ |
101 |
*/ |
| 101 |
uint8_t GetType (void) const; |
102 |
uint16_t GetPacketType (void) const; |
| 102 |
|
103 |
|
| 103 |
|
104 |
|
| 104 |
// Inherited methods |
105 |
// Inherited methods |
|
|
| 110 |
private: |
111 |
private: |
| 111 |
UanAddress m_dest; //!< The destination address. |
112 |
UanAddress m_dest; //!< The destination address. |
| 112 |
UanAddress m_src; //!< The source address. |
113 |
UanAddress m_src; //!< The source address. |
| 113 |
uint8_t m_type; //!< The type field. |
114 |
uint16_t m_packetType; //!< The type field. |
| 114 |
|
115 |
|
| 115 |
}; // class UanHeaderCommon |
116 |
}; // class UanHeaderCommon |
| 116 |
|
117 |
|