Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
IEEE802_15_4Address Class Reference

IEEE 802.15.4 address. More...

#include <IEEE802_15_4Frame.hpp>

Public Member Functions

 IEEE802_15_4Address (const uint8_t *eui, int32_t pan=-1)
 IEEE802_15_4Address (uint16_t shortId, int32_t pan=-1)
bool isBroadcast ()
 Broadcast 주소인지 여부 확인
bool operator== (const IEEE802_15_4Address &r) const
bool operator!= (const IEEE802_15_4Address &r) const
bool operator== (const uint8_t *r) const
bool operator== (const uint16_t &r) const
bool operator< (const IEEE802_15_4Address &r) const

Public Attributes

struct { 
   uint8_t   len 
   uint16_t   id 
} pan
 PAN ID.
union { 
   uint16_t   s16 
   uint8_t   s64 [8] 
   uint64_t   u64 
} id

Detailed Description

Constructor & Destructor Documentation

◆ IEEE802_15_4Address() [1/3]

IEEE802_15_4Address::IEEE802_15_4Address ( )
inline
62 {
63 this->pan.id = 0;
64 this->pan.len = 0;
65 this->len = 0;
66 }
uint8_t len
Definition IEEE802_15_4Frame.hpp:94
struct IEEE802_15_4Address::@235320077217060177125107316172225356322336100061 pan
PAN ID.

◆ IEEE802_15_4Address() [2/3]

IEEE802_15_4Address::IEEE802_15_4Address ( const uint8_t * eui,
int32_t pan = -1 )
inline
68 {
69 memcpy(this->id.s64, eui, 8);
70 this->len = 8;
71 if (pan >= 0 && pan <= 0xFFFF) {
72 this->pan.len = 2;
73 this->pan.id = pan;
74 } else {
75 this->pan.len = 0;
76 }
77 }
uint8_t s64[8]
Definition IEEE802_15_4Frame.hpp:101

◆ IEEE802_15_4Address() [3/3]

IEEE802_15_4Address::IEEE802_15_4Address ( uint16_t shortId,
int32_t pan = -1 )
inline
79 {
80 this->id.s16 = shortId;
81 this->len = 2;
82 if (pan >= 0 && pan <= 0xFFFF) {
83 this->pan.len = 2;
84 this->pan.id = pan;
85 } else {
86 this->pan.len = 0;
87 }
88 }

Member Function Documentation

◆ isBroadcast()

bool IEEE802_15_4Address::isBroadcast ( )
inline

Broadcast 주소인지 여부 확인

109 {
110 return (this->len == 2 && this->id.s16 == 0xFFFF) ? true : false;
111 }
uint16_t s16
Definition IEEE802_15_4Frame.hpp:100

◆ operator!=()

bool IEEE802_15_4Address::operator!= ( const IEEE802_15_4Address & r) const
inline
123 {
124 if (this->pan.len == 2 && r.pan.len == 2 &&
125 this->pan.id != 0xFFFF && r.pan.id != 0xFFFF &&
126 this->pan.id != r.pan.id) {
127 return true;
128 }
129
130 return (this->len != r.len || memcmp(&this->id, &r.id, this->len) != 0);
131 }
uint16_t id
Definition IEEE802_15_4Frame.hpp:95

◆ operator<()

bool IEEE802_15_4Address::operator< ( const IEEE802_15_4Address & r) const
inline
141 {
142 if (this->pan.len == 2) {
143 if (this->pan.len == r.pan.len) {
144 if (this->pan.id < r.pan.id) {
145 return true;
146 }
147 }
148 }
149
150 if (this->len < r.len) {
151 return true;
152 } else if (this->len == 2) {
153 return (this->id.s16 < r.id.s16);
154 } else /* if (this->len == 8) */ {
155 return (this->id.u64 < r.id.u64);
156 }
157 }

◆ operator==() [1/3]

bool IEEE802_15_4Address::operator== ( const IEEE802_15_4Address & r) const
inline
113 {
114 if (this->pan.len == 2 && r.pan.len == 2 &&
115 this->pan.id != 0xFFFF && r.pan.id != 0xFFFF &&
116 this->pan.id != r.pan.id) {
117 return false;
118 }
119
120 return (this->len == r.len && memcmp(&this->id, &r.id, this->len) == 0);
121 }

◆ operator==() [2/3]

bool IEEE802_15_4Address::operator== ( const uint16_t & r) const
inline
137 {
138 return (this->len == 2 && this->id.s16 == r);
139 }

◆ operator==() [3/3]

bool IEEE802_15_4Address::operator== ( const uint8_t * r) const
inline
133 {
134 return (this->len == 8 && memcmp(this->id.s64, r, 8) == 0);
135 }

Member Data Documentation

◆ id

uint16_t IEEE802_15_4Address::id

◆ len

uint8_t IEEE802_15_4Address::len

either 0 or 2

one of 0, 1, 2, or 8

Examples
atsamr21-xpro/LPP-Receiver/main.cpp, and st-nucleo-l152re/LPP-Receiver/main.cpp.

◆ s16

uint16_t IEEE802_15_4Address::s16

valid when len == 2

◆ s64

uint8_t IEEE802_15_4Address::s64[8]

valid when len == 8


The documentation for this class was generated from the following file: