Research Article

GreenLink: An Energy Efficient Scatternet Formation for BLE Devices

Algorithm 2

NodeCompare.
Require:  ,
Ensure:  1  : > ;  0  : = ;  −1:
< ;
1: if    then
2: return 1
3: if    then
4: return  -1
5: if  .  then
6: if    then
7: return 1
8: if  .  then
9: return  -1
10: if    then
11: if    then
12: return 1
13: if    then
14: return  -1
15: if    then
16: return 0