-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSRTreeAppC.nc
68 lines (54 loc) · 1.97 KB
/
SRTreeAppC.nc
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
#include "SimpleRoutingTree.h"
configuration SRTreeAppC @safe() { }
implementation{
components SRTreeC;
#if defined(DELUGE) //defined(DELUGE_BASESTATION) || defined(DELUGE_LIGHT_BASESTATION)
components DelugeC;
#endif
#ifdef PRINTFDBG_MODE
components PrintfC;
#endif
// Standard Component Declaration
components MainC, ActiveMessageC, RandomC, RandomMlcgC;
// Timer Declarations
components new TimerMilliC() as RoutingMsgTimerC;
components new TimerMilliC() as RoundTimerC;
components new TimerMilliC() as SendMeasTimerC;
// Message Declarations
components new AMSenderC(AM_ROUTINGMSG) as RoutingSenderC;
components new AMReceiverC(AM_ROUTINGMSG) as RoutingReceiverC;
components new AMSenderC(AM_MEASMSG) as MeasSenderC;
components new AMReceiverC(AM_MEASMSG) as MeasReceiverC;
// Packet Declarations
components new PacketQueueC(SENDER_QUEUE_SIZE) as RoutingSendQueueC;
components new PacketQueueC(RECEIVER_QUEUE_SIZE) as RoutingReceiveQueueC;
components new PacketQueueC(SENDER_QUEUE_SIZE) as MeasSendQueueC;
components new PacketQueueC(RECEIVER_QUEUE_SIZE) as MeasReceiveQueueC;
// Wiring
// Boot
SRTreeC.Boot->MainC.Boot;
// Radio
SRTreeC.RadioControl -> ActiveMessageC;
// Random
SRTreeC.Random->RandomC;
SRTreeC.Seed->RandomMlcgC.SeedInit;
// Timers
SRTreeC.RoutingMsgTimer->RoutingMsgTimerC;
SRTreeC.RoundTimer->RoundTimerC;
SRTreeC.SendMeasTimer->SendMeasTimerC;
// RoutingMsg
SRTreeC.RoutingPacket->RoutingSenderC.Packet;
SRTreeC.RoutingAMPacket->RoutingSenderC.AMPacket;
SRTreeC.RoutingAMSend->RoutingSenderC.AMSend;
SRTreeC.RoutingReceive->RoutingReceiverC.Receive;
// MeasMsg
SRTreeC.MeasPacket->MeasSenderC.Packet;
SRTreeC.MeasAMPacket->MeasSenderC.AMPacket;
SRTreeC.MeasAMSend->MeasSenderC.AMSend;
SRTreeC.MeasReceive->MeasReceiverC.Receive;
// Queues
SRTreeC.RoutingSendQueue->RoutingSendQueueC;
SRTreeC.RoutingReceiveQueue->RoutingReceiveQueueC;
SRTreeC.MeasSendQueue->MeasSendQueueC;
SRTreeC.MeasReceiveQueue->MeasReceiveQueueC;
}