Skip to main content
. 2022 May 5;22(9):3518. doi: 10.3390/s22093518
Algorithm 3. Node type determination
//avg_rssi indicates the average of RSSIs
//avr_snr indicates the average of SNRs
1:  At an Orphan node that receives k TCRs, k > 1:
2:    calculate avg_rssi and avg_snr with multiple TCRs;
3:    determine nodeType using avg_rssi and avg_snr as follows:
4:    if avg_rssiRSSI_Th1 and avg_snrSNR_Th1 then
5:       nodeType = 1HopR;
6:    else if avg_rssiRSSI_Th2 and avg_snrRSSI_Th2 then
7:       nodeType = 1Hop;
8:    else
9:       nodeType = 2HopCan;