Skip to main content
. 2021 Apr 1;21(7):2443. doi: 10.3390/s21072443
Algorithm 2 Sending Beacon
  • 1:

    procedureSending_Beacon

  • 2:

        while (OBU_Is_On) do

  • 3:

            Wait(Beacon_Interval_Time);

  • 4:

            Prepare_Beacon(BSM);

  • 5:

            Speed←Max(My_Speed,Speed);

  • 6:

            if (Speed<18) then

  • 7:

               nic.mac80211p.txPower←0.2;

  • 8:

               Counter←Counter−5;

  • 9:

            else if (Speed<36) then

  • 10:

               nic.mac80211p.txPower←0.8;

  • 11:

               Counter←Counter−10;

  • 12:

            else if (Speed<54) then

  • 13:

               nic.mac80211p.txPower←3.1;

  • 14:

            else

  • 15:

               nic.mac80211p.txPower←7;

  • 16:

               Counter←Def_Val;

  • 17:

            end if

  • 18:

            Speed←0;

  • 19:

            Checking_Pseudonym_Change_Trigger();

  • 20:

            Send_Beacon(BSM);

  • 21:

        end while

  • 22:

    end procedure