Pass WiFi as parameter to library function

And thanks J-M-L for the tip about passing by reference.