]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/dip/Dip.h
TEP3: #define to enum and email in README
[tinyos-2.x.git] / tos / lib / net / dip / Dip.h
index 6d9886076dc74b9f2470870ac8fed7faf2a7fdac..0d840f34709b8ddd348ef9e98f7b7dcc50a34faf 100644 (file)
@@ -2,14 +2,16 @@
 #ifndef __DIP_H__
 #define __DIP_H__
 
-#define DIP_TAU_LOW (1024L)
-#define DIP_TAU_HIGH (65535L)
 
 #define UQ_DIP unique("DIP")
 #define UQCOUNT_DIP uniqueCount("DIP")
 
-#define DIP_UNKNOWN_VERSION 0xFFFFFFFF
-#define DIP_UNKNOWN_INDEX 0xFFFF
+enum {
+  DIP_TAU_LOW = 1024L,
+  DIP_TAU_HIGH = 65535L,
+  DIP_UNKNOWN_VERSION = 0xFFFFFFFF,
+  DIP_UNKNOWN_INDEX = 0xFFFF
+};
 
 typedef enum {
   ID_DIP_INVALID = 0x0,
@@ -19,7 +21,10 @@ typedef enum {
 } dip_msgid_t;
 
 enum {
-  AM_DIP = 0x84
+  AM_DIP = 0x62,
+  AM_DIP_DATA_MSG = 0x62, // For MIG tool
+  AM_DIP_MSG = 0x62, // For MIG tool
+  AM_DIP_DATA = 0x62 // For MIG tool
 };
 
 typedef uint16_t dip_index_t;
@@ -30,24 +35,24 @@ typedef nx_uint32_t nx_dip_version_t;
 typedef uint8_t dip_estimate_t;
 typedef dip_index_t dip_hashlen_t;
 
-typedef nx_struct dip_msg_t {
+typedef nx_struct dip_msg {
   nx_uint8_t type; // dip_msgid_t
   nx_uint8_t content[0];
 } dip_msg_t;
 
-typedef nx_struct dip_data_msg_t {
+typedef nx_struct dip_data_msg {
   nx_dip_key_t key;
   nx_dip_version_t version;
   nx_uint8_t size;
   nx_uint8_t data[0];
 } dip_data_msg_t;
 
-typedef nx_struct dip_vector_msg_t {
+typedef nx_struct dip_vector_msg {
   nx_uint8_t unitLen;
   nx_uint32_t vector[0];
 } dip_vector_msg_t;
 
-typedef nx_struct dip_summary_msg_t {
+typedef nx_struct dip_summary_msg {
   nx_uint8_t unitLen;
   nx_uint32_t salt;
   nx_uint32_t info[0];
@@ -64,11 +69,13 @@ dip_estimate_t DIP_VECTOR_ESTIMATE;
 
 /* TUNABLE PARAMETERS */
 
-typedef struct dip_data_t {
-  uint8_t data[16];
+typedef nx_struct dip_data {
+  nx_uint8_t data[16];
 } dip_data_t;
 
-#define DIP_SUMMARY_VALUES_PER_PACKET 2
-#define DIP_VECTOR_VALUES_PER_PACKET 2
+enum {
+  DIP_SUMMARY_VALUES_PER_PACKET = 2,
+  DIP_VECTOR_VALUES_PER_PACKET = 2
+};
 
 #endif