-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNodeC.nc
55 lines (42 loc) · 1.33 KB
/
NodeC.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
/**
* ANDES Lab - University of California, Merced
* This class provides the basic functions of a network node.
*
* @author UCM ANDES Lab
* @date 2013/09/03
* Adam Pluguez CSE160 Project1 Updated 2/12/19
*/
#include <Timer.h>
#include "includes/CommandMsg.h"
#include "includes/packet.h"
#define MAX_NODES 20
configuration NodeC{
}
implementation {
components MainC;
components Node;
components new AMReceiverC(AM_PACK) as GeneralReceive;
//ADDed
components new TimerMilliC() as neighborTimer;
components new ListC(moteN,MAX_NODES) as neighborList;
components new ListC(pack, MAX_NODES) as sentList;
components new ListC(linkState, MAX_NODES) as linkStateList;
Node.neighborTimer -> neighborTimer;
Node.sentList -> sentList;
Node.neighborList -> neighborList;
Node.linkStateList -> linkStateList;
Node -> MainC.Boot;
Node.Receive -> GeneralReceive;
components ActiveMessageC;
Node.AMControl -> ActiveMessageC;
components new SimpleSendC(AM_PACK);
Node.Sender -> SimpleSendC;
components CommandHandlerC;
Node.CommandHandler -> CommandHandlerC;
components NeighborDiscoveryC;
Node.NeighborDiscovery->NeighborDiscoveryC;
components FloodingC;
Node.Flooding->FloodingC;
components RoutingC;
Node.Routing->RoutingC;
}