-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleRoutingTree.h
110 lines (97 loc) · 2.39 KB
/
SimpleRoutingTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef SIMPLEROUTINGTREE_H
#define SIMPLEROUTINGTREE_H
enum{
SENDER_QUEUE_SIZE=5,
RECEIVER_QUEUE_SIZE=3,
AM_SIMPLEROUTINGTREEMSG=22,
AM_ROUTINGMSG=22,
AM_MEASMSG=12, // AM for MeasMsg
TIMER_PERIOD_MILLI=60 * 1024, // Epoch time
TIMER_FAST_PERIOD=256, // Send time
BOOT_TIME = 10 * 1024, // Time given in simulation to boot
TIMER_ROUTING_DURATION=3 * 1024, // Routing Time
MAX_CHILDREN = 32, // Maximum number of node's children
MAX_QUERIES = 2,
///////////////////////////////////////
SUM = 1,
MAX = 2,
MIN = 3,
COUNT = 4,
AVG = 5,
VAR = 6,
//////////////////////////////////////
SUMSQ = 7,
//////////////////////////////////////
};
// Tina mode or Extended TAG with 2 queries Routing
typedef nx_struct Routing4field
{
nx_uint8_t mode;
nx_uint8_t select;
nx_uint8_t select2ortct;
nx_uint8_t depth;
} Routing4field;
// Extended TAG with 1 query Routing
typedef nx_struct Routing3field
{
nx_uint8_t mode;
nx_uint8_t select;
nx_uint8_t depth;
} Routing3field;
// Struct for ChildInfo
typedef struct ChildInfo
{
nx_uint16_t childID;
nx_uint16_t sum;
nx_uint8_t count;
nx_uint8_t max;
nx_uint8_t min;
nx_uint32_t sumsq;
} ChildInfo;
// MIN || MAX || COUNT
typedef nx_struct OneMeas8bit
{
nx_uint8_t measurement;
} OneMeas8bit;
// SUM
typedef nx_struct OneMeas16bit
{
nx_uint16_t measurement;
} OneMeas16bit;
// MIN-MAX-COUNT (PAIR)
typedef nx_struct TwoMeas8bit
{
nx_uint8_t measurement1;
nx_uint8_t measurement2;
// Holds type of queries
nx_uint8_t measurementQueries[MAX_QUERIES];
} TwoMeas8bit;
// AVG || SUM - (MIN || MAX || COUNT || AVG) || AVG - COUNT
typedef nx_struct TwoMeasMixedbit
{
nx_uint16_t measurement16bit;
nx_uint8_t measurement8bit;
} TwoMeasMixedbit;
// AVG - MAX || AVG - MIN
typedef nx_struct ThreeMeasMixedbit
{
nx_uint16_t measurement16bit;
nx_uint8_t measurement8bit1;
nx_uint8_t measurement8bit2;
} ThreeMeasMixedbit;
// VAR || VAR - AVG || VAR - SUM || VAR - COUNT
typedef nx_struct VarMeasSimple
{
nx_uint32_t measurement32bit;
nx_uint16_t measurement16bit;
nx_uint8_t measurement8bit;
} VarMeasSimple;
// VAR - MIN || VAR - MAX
typedef nx_struct VarMeasDouble
{
nx_uint32_t measurement32bit;
nx_uint16_t measurement16bit;
nx_uint8_t measurement8bit1;
nx_uint8_t measurement8bit2;
} VarMeasDouble;
#endif