-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleRoutingTree.h
74 lines (52 loc) · 1.3 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
#ifndef SIMPLEROUTINGTREE_H
#define SIMPLEROUTINGTREE_H
enum{
SENDER_QUEUE_SIZE=5,
RECEIVER_QUEUE_SIZE=3,
AM_SIMPLEROUTINGTREEMSG=22,
AM_ROUTINGMSG=22,
AM_REAGGREGATE=10,
AM_DISTR=30,
SEND_CHECK_MILLIS=70000,
TIMER_PERIOD_MILLI=30720,
TIMER_FAST_PERIOD=128,
//Aggregates flags
MAX = 0,
COUNT = 1,
MAXCOUNT = 2,
};
typedef struct childNode{
nx_uint8_t nodeID;
nx_uint8_t maxVal;
nx_uint8_t countVal;
} childNode;
typedef nx_struct RoutingMsg
{
nx_uint8_t depth;
//This variable holds the flag for the selection of the aggregate function and the TCT.
nx_uint8_t executionParameters;
} RoutingMsg;
typedef nx_struct ReaggregateMsg
{
//This variable holds the flag for the selection of the aggregate function and the TCT.
nx_uint8_t newAggregate;
} ReaggregateMsg;
typedef nx_struct DistributionMsgFull
{
nx_uint16_t max; //16 bits are not required but this is the only way to tell messages apart
nx_uint8_t count;
} DistributionMsgFull;
typedef nx_struct DistributionMsgSemi
{
nx_uint8_t flag; //Used to mark if COUNT or MAX was sent during double aggregation but signle TiNA transmission
nx_uint8_t data;
} DistributionMsgSemi;
typedef nx_struct DistributionMsgSingle
{
nx_uint8_t data;
} DistributionMsgSingle;
typedef nx_struct BufferMsg
{
nx_uint8_t data8bit;
} BufferMsg;
#endif