Skip to main content
. 2024 Feb 9;24(4):1142. doi: 10.3390/s24041142
Algorithm 1 Wi-SUN FAN association
  • 1:

    Nch: number of available channels

  • 2:

    Ic: channel index

  • 3:

    UDIscan: channel scan time

  • 4:

    V[] ← channel_function()

  • 5:

    Ic ← 0

  • 6:

    if node = JS1 then

  • 7:

        CHscanV[Ic]

  • 8:

        while is not associated do

  • 9:

            if the scan time has expired then

  • 10:

               resets the scan time

  • 11:

               Ic(Ic+1)

  • 12:

               CHscanV[Ic]

  • 13:

            end if

  • 14:

            if PA is received then

  • 15:

               node ← JS3

  • 16:

            end if

  • 17:

        end while

  • 18:

    end if

  • 19:

    if node = JS3 then

  • 20:

        while is not associated do

  • 21:

            if the scan time has expired then

  • 22:

               resets the scan time

  • 23:

               Ic(Ic+1)

  • 24:

               CHscanV[Ic]

  • 25:

            end if

  • 26:

            if PC is received then

  • 27:

               node JS4

  • 28:

            end if

  • 29:

        end while

  • 30:

    end if