Skip to main content
. 2016 May 9;16(5):656. doi: 10.3390/s16050656
Algorithm 2 The CoR-MAC algorithm for the node.
  •  1:

    Si← The slot which is located in the i’-th position;

  •  2:

    Φ ← The current time;

  •  3:

    Φscfp← The phase of SCFP;

  •  4:

    Φocfp← The phase of OCFP;

  •  5:

    Φcap← The phase of CAP;

  •  6:

    loop

  •  7:

    if BEACON is received from the coordinator then

  •  8:

      Synchronize itself to the coordinator;

  •  9:

      Record this Si based on CFP allocation map;

  • 10:

    else if The node has urgent data to transmit then

  • 11:

      if Φ ⊂ Φscfp then

  • 12:

       Send urgent DATA immediately;

  • 13:

      else if Φ ⊂ Φocfp then

  • 14:

       Send DATA with CSMA/CA after SIFS;

  • 15:

      else if Φ ⊂ Φcap then

  • 16:

       Send DATA with CSMA/CA;

  • 17:

      end if

  • 18:

    else if The node has time-critical data to transmit then

  • 19:

      if Φ ⊂ (ΦscfpΦocfp) then

  • 20:

       Send DATA after MIFS;

  • 21:

      else if Φ ⊂ Φcap 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 Φ ⊂ (ΦscfpΦocfp) then

  • 26:

       Send DATA with CSMA/CA after LIFS;

  • 27:

      else if Φ ⊂ Φcap then

  • 28:

       Send DATA with CSMA/CA;

  • 29:

      end if

  • 30:

    end if

  • 31:

    end loop