|
Algorithm 2 The CoR-MAC algorithm for the node. |
-
1:
← The slot which is located in the i’-th position;
-
2:
Φ ← The current time;
-
3:
← The phase of SCFP;
-
4:
← The phase of OCFP;
-
5:
← The phase of CAP;
-
6:
loop
-
7:
if BEACON is received from the coordinator then
-
8:
Synchronize itself to the coordinator;
-
9:
Record this based on CFP allocation map;
-
10:
else
if The node has urgent data to transmit then
-
11:
if Φ ⊂
then
-
12:
Send urgent DATA immediately;
-
13:
else
if Φ ⊂
then
-
14:
Send DATA with CSMA/CA after SIFS;
-
15:
else
if Φ ⊂
then
-
16:
Send DATA with CSMA/CA;
-
17:
end if
-
18:
else
if The node has time-critical data to transmit then
-
19:
if Φ ⊂ ∪
then
-
20:
Send DATA after MIFS;
-
21:
else
if Φ ⊂
then
-
22:
Send DATA with CSMA/CA;
-
23:
end if
-
24:
else
if The node has non-time-critical data to transmit then
-
25:
if Φ ⊂ ∪
then
-
26:
Send DATA with CSMA/CA after LIFS;
-
27:
else
if Φ ⊂
then
-
28:
Send DATA with CSMA/CA;
-
29:
end if
-
30:
end if
-
31:
end loop
|