Skip to main content
. 2020 Jan 19;20(2):548. doi: 10.3390/s20020548
Algorithm 4 Relay device
Input:Rmsg (Request message containing node ID, message ID and GPS coordinates)
   Ackmsg (Acknowledgment message)
   AVBnet (Available Networks)
Output:Rmsg (Request message containing node ID, message ID and GPS coordinates)
   Ackmsg (Acknowledgment message)
  • 1:

    procedure

  • 2:

     Step 1: defining and initializing variables

  • 3:

        Scan AVBnet

  • 4:

        Apply DIA Algorithm (assigns ID)

  • 5:

        Apply MMN Algorithm ( returns Min & Max ID)

  • 6:

     Step 2: detecting events

  • 7:

    while 1 do

  • 8:

      if Rmsg=true then

  • 9:

        send Rmsg to MinID

  • 10:

      end if

  • 11:

      if Ackmsg=true then

  • 12:

        send Ackmsg to MaxID

  • 13:

      end if

  • 14:

    end while

  • 15:

    end procedure