summaryrefslogtreecommitdiff
path: root/cesar/common/defs
diff options
context:
space:
mode:
authorNélio Laranjeiro2010-09-23 13:54:39 +0200
committerNélio Laranjeiro2010-09-30 17:30:47 +0200
commita25e3a1f26fb95916a761e03a1a4901e45591aae (patch)
tree3c941d85944f08565a510bc29bdfd5b481309ef4 /cesar/common/defs
parentc2d4434fa55569771de17f6e249bc5cab7c6b9d1 (diff)
cesar/cp: use HPAV_NID_IS_VALID to test nid validity, closes #1900
Diffstat (limited to 'cesar/common/defs')
-rw-r--r--cesar/common/defs/homeplugAV.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cesar/common/defs/homeplugAV.h b/cesar/common/defs/homeplugAV.h
index e30be10228..fb3650c0a8 100644
--- a/cesar/common/defs/homeplugAV.h
+++ b/cesar/common/defs/homeplugAV.h
@@ -89,4 +89,12 @@ typedef enum hpav_access_t hpav_access_t;
* Only valid if operating in CSMA only mode.. */
#define HPAV_SCHEDULE_PERMAMENT_VALUE 0x7
+/** Define the size of the NID. */
+#define HPAV_NID_SIZE 7
+#define HPAV_NID_SIZE_BITS 54
+
+/** Test if the NID is valid. */
+#define HPAV_NID_IS_VALID(nid) \
+ ((nid) >> HPAV_NID_SIZE_BITS == 0)
+
#endif /* common_defs_homeplugAV_h */